NITT2 - hai jolly jolly jolly

no tags 

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

hide comments
Ranjan Kumar Singh: 2015-01-20 03:19:52

time limit is too high .5 is more than enough for this problem

Cracker: 2015-01-20 03:19:52

this brings me to point 1... :P

P_Quantum: 2015-01-20 03:19:52

nice one..!!

Vishal Sharma: 2015-01-20 03:19:52

writing YES instead of Yes
and same for No costed me three submissions

Sandeep Sharma: 2015-01-20 03:19:52

Writing N0(zero) instead of No costed me a WA..:p
Easy one :D

anant kapoor: 2015-01-20 03:19:52

Can someone post a few more test cases.

Erti-Chris Eelmaa: 2015-01-20 03:19:52

Good refreshment of division rules:)

Ouditchya Sinha: 2015-01-20 03:19:52

Brute force in python will give TLE, try divisibility rules. :)

Anirudh Goyal: 2015-01-20 03:19:52

C :D

Last edit: 2013-06-03 18:51:45
shiva_hellgeek: 2015-01-20 03:19:52

Got ac!
This problem brings up my half century!!!


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