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