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
hide comments
|
reo_j:
2012-07-01 15:14:59
any tricky case plz..!!! |
|
johnny:
2012-06-22 18:10:36
@devil: lol its a psudocode//// |
|
:):
2012-06-16 08:16:40
there is something wrong
|
|
Ashish Raj:
2012-06-01 11:58:27
nice 1 :) |
|
Artur Freitas:
2012-06-01 00:38:47
thank you very much ,Hemant Verma ! ;D |
|
Pranshul Agarwal:
2012-05-30 08:43:20
thnx Hemant Verma |
|
Hemant Verma:
2012-05-30 07:46:35
use unsigned long long |
|
Pranshul Agarwal:
2012-05-30 07:09:01
can smbdy tell why am i getting WA again n again?? is it right that we have to print "TAK" for 0 and 1 ???? |
|
Vrian7:
2012-05-29 02:41:15
very smallest code my code of resolution is 9 lines... :) |
|
Vrian7:
2012-05-29 02:39:17
You idea is wrong, for example for 144 is NIE |
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 |