Sphere Online Judge

SPOJ Problem Set (classical)


Problem code: SHAKTI

Since very long time shaktiman and kilwish have been fighting with each other but the fight never came to end . So finally I came to rescue . I decided that the result of the fight will be decided by a mathematical game , in which I will write a number (N) . Kilwish and shaktiman will play the game alternatively and each of them would subtract a number(n) [n is less than N] such that N modulo n gives zero. The game is repeted turn by turn until the one , who now cannot make a further move looses the game

Shaktiman being weak at mathematics asks you for help , whether or not he can win in that particular case. If Shaktimaan wins that game then print "Thankyou Shaktiman" otherwise print "Sorry Shaktiman".The game begins with shaktimaan playing first move.It is well understood that both of them will make moves in optimal way.


Input contains test cases t (< 10^5) and followed by t numbers (1 <= N <= 10^6 ).


If Shaktimaan wins that game then print "Thankyou Shaktiman" otherwise print "Sorry Shaktiman".

Sample Input:

Sample Output:

Thankyou Shaktiman
Thankyou Shaktiman

Added by:αqfαяι∂ι™
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel Pentium G860 3GHz)

hide comments
2014-09-17 11:30:15 DHRUV PACHAURI
Very easy !!
2014-08-29 20:22:45 गाैरव
ac in ist attempt first time :P
2014-08-23 21:26:27 Siddhartha Sinha
piece of cake :D ... !
2014-07-01 19:00:57 chin
beautiful concept..(y)
2014-06-30 21:03:09 Utsav Tiwary
The problem condenses into a simpler one.
2014-06-20 03:04:04 PeacefulWarrior
AC in 1st attemp !!! :D
too easy same as piece of cake :)
2014-05-29 12:34:04 Shadow_Walker
Shey ! I wasted 2 days thinking abt the logic ignoring the fact that 1 is also a factor always .. not a good prob
2014-03-27 13:07:15 ^_^
Valar Morghulis!! :D
2014-03-23 19:56:15 Anubhav Balodhi
@Mitch thank U, yes this is an easy one...
2014-03-01 01:42:15 a b
it intresting to solve it by understanding the proof... nt jst observation
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.