Devu and Adding Two Numbers
Devu is a little boy. He does not know how to take carries while adding two numbers in decimal base. eg. He will struggle in adding numbers 83 and 19, because
3 + 9 = 12 and he needs to take a carry of 1.
You are given an integer n. Can you write it in terms of sum of two positive integers such that while adding them in base 10, Devu doesn't need to use any carries.
First line of the input contains an integer T denoting number of test cases.
For each test case, there is a single line containing an integer n.
For each test case, print a single line YES or NO according to situation in the problem.
- 1 ≤ T ≤ 1000
- 1 ≤ n ≤ 10^5
Input: 2 1 9 Output: NO YES
Example case 1. 1 can not written in desired way.
Example case 2. 9 can be written as sum of 2 and 7. Devu doesn't need to use any carries here.
|Tags||admin2, cakewalk, iitk, wpc, wpc1, wpc1401|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, 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, CLOJ, FS|
Fetching successful submissions