Submit | All submissions | Best solutions | Back to list |
NITT2 - hai jolly jolly jolly |
Alp and Gaut are like always opposite to each other. Once Alp told that he can identify a number which is divisible by 252 (He knows because that is his girlfriends birthday - 25/2). Now to come up against Alp, Gaut said he can identify whether the number is divisible by 525 (poor Gaut don't have a girl friend though). The truth is they don't know to do it for big numbers. So you are here to help them with a method. Given a number you have to tell whether the number is divisible by 252 and 525.
Input
Number of testcases in first line, T (T <= 100).
Each line contains one number N, whose divisibility is to be tested (1 <= N <= 1050000).
Output
Each line containing two Yes/No. one for 252 and one for 525.
Example
Input: 4 252 525 16884 21347 Output: Yes No No Yes Yes No No No
Added by: | jack(chakradarraju) |
Date: | 2012-09-29 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
|
||||||
2015-01-20 03:19:52 Ranjan Kumar Singh
time limit is too high .5 is more than enough for this problem |
||||||
2015-01-20 03:19:52 Cracker
this brings me to point 1... :P |
||||||
2015-01-20 03:19:52 P_Quantum
nice one..!! |
||||||
2015-01-20 03:19:52 Vishal Sharma
writing YES instead of Yes and same for No costed me three submissions |
||||||
2015-01-20 03:19:52 Sandeep Sharma
Writing N0(zero) instead of No costed me a WA..:p Easy one :D |
||||||
2015-01-20 03:19:52 anant kapoor
Can someone post a few more test cases. |
||||||
2015-01-20 03:19:52 Erti-Chris Eelmaa
Good refreshment of division rules:) |
||||||
2015-01-20 03:19:52 Ouditchya Sinha
Brute force in python will give TLE, try divisibility rules. :) |
||||||
2015-01-20 03:19:52 Anirudh Goyal
C :D Last edit: 2013-06-03 18:51:45 |
||||||
2015-01-20 03:19:52 shiva_hellgeek
Got ac! This problem brings up my half century!!! |