Submit | All submissions | Best solutions | Back to list |
SHAKTI - SHAKTIMAN AND KILWISH |
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
Input contains test cases t (< 10^5) and followed by t numbers (1 ≤ N ≤ 106).
Output
If Shaktimaan wins that game then print "Thankyou Shaktiman" otherwise print "Sorry Shaktiman".
Example
Input: 2 212 424 Output: Thankyou Shaktiman Thankyou Shaktiman
Added by: | aqfaridi |
Date: | 2014-01-24 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
|
|||||||
2015-12-01 12:48:03 ashuamit
how 212 is thankyou shaktima plz elaborate once . thanking u in advance :) |
|||||||
2015-08-24 21:30:09
Beautiful Concept ?? Game Theory ?? Algorithms ?? What are you guys talking about ?? This question can be solved in 2 lines in python. |
|||||||
2015-08-10 22:12:08
cant get what everyone talking about i got AC within 10 min just by checking odd/even. |
|||||||
2015-08-07 18:39:53 Anik Dasgupta
does anybody know how to solve this question ? please email me if you do. thank you :) |
|||||||
2015-08-03 14:16:10 (Tjandra Satria Gunawan)(曾毅昆)
Submit bruteforce algo ==> AC find pattern based on my bruteforce algo, submit that pattern ==> AC What an easy problem :p |
|||||||
2015-08-02 07:21:21 Anant Upadhyay
nice question! |
|||||||
2015-08-01 16:18:15 Anurag Sharma
learnt game theory :) |
|||||||
2015-07-16 06:17:34
its not easy for me, i don't know how others find it easy.. |
|||||||
2015-07-05 16:17:07 Poonam
i didn't get the question...can someone help in understanding it |
|||||||
2015-03-30 20:15:12 Dushyant Singh
I found this very helpful for this problem - https://www.youtube.com/watch?v=-8H15d5ibW4 Last edit: 2015-08-11 17:38:01 |