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 ≤ 1014.
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-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!! |
||||||||||||||
2012-07-19 07:42:31 Broken_Sword
whats the output for 0 and 1 ? |
||||||||||||||
2012-07-07 21:00:25 Aditya
HInt is, if 3 is muliplied to any number , can it be then expressed in the form 2^k ?no.. |