Submit | All submissions | Best solutions | Back to list |
WILLITST - Will it ever stop |
When Bob was in library in University of Warsaw he saw on one of facades caption :"Will it ever stop?" and below some mysterious code:
while n > 1 if n mod 2 = 0 then n:=n/2 else n:=3*n+3
Help him finding it out !
Input
In first line one number n<=10^14.
Output
Print "TAK" if program will stop, otherwise print "NIE"
Example
Input: 4 Output: TAK
Added by: | Krzysztof Lewko |
Date: | 2011-11-09 |
Time limit: | 0.906s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | AMPPZ 2011 |
hide comments
|
||||||||||||||
2012-12-14 13:09:53 simon
anyone knows why if n % 2 == 0: is accepted while if not n % 2: give NZEC? |
||||||||||||||
2012-11-07 22:56:59 malioboro
tricky test case, be careful |
||||||||||||||
2012-10-17 14:42:19 gourav
18th :) |
||||||||||||||
2012-10-02 20:48:19 rathor ashu
Same Algo c => NZEC. C++ => AC |
||||||||||||||
2012-09-27 18:25:03 Vikas Kushwaha
easy one :) |
||||||||||||||
2012-09-17 22:16:48 Omar Simón Francisco Prieto Chacón - osfprieto
Is it just one input number or several test cases? |
||||||||||||||
2012-09-08 10:18:29 Vrian7
@:) It is pascal, this is not c++ or java.. |
||||||||||||||
2012-09-07 18:23:44 code warrior
how to operate on such a large numbers. declaring string of such length is not allowed.. suggesstions r welcomed |
||||||||||||||
2012-08-15 15:18:14 piyush agarwal
any hint please..i m getting wa again n again...or any tricky case!! |