All submissions for this problem are available.
While his trip to an ancient palace Harry found a box, while wandering in the palace.
The box is rectangular and consists of a lock on it's each vertical face. He has also found two keys attached to the top of box. The box displays an arbitrary number N on it's top.
You have to find out whether this box can be opened by this number or not.
The box can be opened by a number, iff it is a multiple of number of keys and number of locks and number of corners in the rectangular box(all 3 conditions satisfying simultaneously).
If the box can be opened by the dispalyed number print YES otherwise NO.
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases is as follows.
- The first line of each test case contains a single integer N, which is displayed on the top of the box.
For each test case, Output YES if box can be opened otherwise NO.
- 1 ≤ T ≤ 108
- 1 ≤ N ≤ 1030
Subtask #1 (10 points):
- 1 ≤ N ≤ 108
Subtask #2 (40 points):
- 1 ≤ N ≤ 1018
Subtask #3 (50 points): original constraints
Input: 3 72 32 20 Output: YES YES NO
|Tags||cakewalk, chhekur, codh2018, divisibility, rules|
|Time Limit:||0.2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions