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-12-18 19:27:31 Insomniac
AC in 1st go!!!!....jst a simple trick
2014-12-14 10:25:40 Swapnil Walke
At first it seems complex but little paper work gives u the logic !! AC in 1 go :)
2014-12-11 16:36:41 kartikeya mishra
wrong problem description i wud say....I know i submitted wrong solution a/c to question but it is giving AC...bullshit

Last edit: 2014-12-11 16:39:13
2014-11-20 17:46:41 Jasdeep Singh
please remove this easy solutions
2014-10-29 13:16:28 Abhishek Gupta
just hit n trial approach on some numbers gave me the solution
2014-09-30 09:40:49 Govind Lahoti
damn easy problem
2014-09-28 17:20:19 Ayush Agarwal
can anyone provide explanantion to the sample cases
2014-09-25 00:03:12 Vikash kumar das
@hitesh garg observe the output u will get the solution
2014-09-24 15:29:09 HITESH GARG
i don't understand the question..plz anyone..can i see the solution... anyone
2014-09-17 11:30:15 DHRUV PACHAURI
Very easy !!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.