All submissions for this problem are available.
Krishna Murthy is one of the top businessmen in London. He is known for his intelligent and witty tricks. In one of his favourite games:
He gives his opponent two similar looking golf balls one made of gold and the other made of silver, he also asks the opponent a number N to assess his intelligence while he challenges him to pick a ball.
He has a hidden logic behind the selection process which is:
If the opponent gives a number which follows the correct criterion he is intelligent and picks the gold ball and wins the challenge. If not, he picks the silver ball.
The criterion is:
The number of perfect squares between 1 and N is a prime number.
The first line contains an integer T which denotes the number of test cases.
T lines follow each with an integer N which denotes the number selected by the opponent.
The output must contain a single line to print "golden ball is selected." or "silver ball is selected."
- 1 ≤ T ≤ 103
- 1 ≤ N ≤ 109
Input: 4 56 52 90 26 Output: golden ball is selected. golden ball is selected. silver ball is selected. golden ball is selected.
Consider 56, the number of perfect squares between 1 and 56 is 7.i.e.,1,4,9,16,25,36,49.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions