Recharge on V-Day
All submissions for this problem are available.
Rohit has money X with which he can recharge on Love's website.The money he will recieve as talktime is the largest prime factor of X. But since it is Loves's website
and we know Love is selfless hence he sometimes allows him to break X into different prime denominations and do recharge.So find out his loss in doing recharge on Loves's website.
loss= X - talktime recieved.
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows."
- Each test case contains integer X and a character y or n depending whether X can be broken or not
- For each test case, output a single line containing the loss incurred by the user.
- 1 ≤ T ≤ 10^4
- 1 ≤ X ≤ 10^9
14 y20 n
Example case 1. ...
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, 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
If you are still having problems, see a sample solution here.