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
~~diva~~:
20161227 14:54:26
no need of bit maipulation , just check if the number is becoming 3,6 or 12 at any time within the while loop .if yes, only then it's forming an infinite loop! Last edit: 20161227 15:07:49 

deepak1228:
20161221 18:11:49
https://www.hackerearth.com/practice/notes/bitmanipulation/


apurvgs:
20161220 14:41:20
easy problem,,just if condition and bit manipulation Last edit: 20161224 13:27:44 

scorpion_ajay:
20161219 17:02:38
use your pen :p 

humble_fool:
20161209 07:53:15
AC in one go. Bits manipulation is the key. Although you can do it using log2 but try Bits Manipulation, you will learn something new. :) 

spartax:
20161130 07:07:47
HINT: if n is a power of 2, it gets reduced to 1. and if n is not a power of 2, then if n is even, it becomes odd. Think what happens to odd integers and you'll get theta(1) solution :) 

radeonguy:
20161128 18:29:04
HINT : you may want to use double instead of float if using log2 

mohitgupta07:
20161117 10:21:02
Donot use that log function. It will give you wa... find another way to get power of 2. umm... how about bit manipulation ;) 

aditya_rev:
20161103 18:01:28
ez as brainf##ck 

sudiptob2:
20161024 09:12:06
For those who are getting WA for log(n)/log(2)

Added by:  Krzysztof Lewko 
Date:  20111109 
Time limit:  0.906s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  AMPPZ 2011 