The Numbers, Mason !
Mason is yet again in danger.
Consider an N digit number A.
let the new number formed by reversing the digits of A be called B .
Mason has to tell that how many N digit numbers A exist such that A + B = 10N - 1 ?
Note: A should not have any leading zeroes !
Quick. Help. over and out.
First line will contain the number of test cases T , then T lines follow each containing an integer N
For each test case , Print how many N digit numbers exist that satisfy the above equation ,in a new line!
1 <= T <= 100
0 <= N <= 105
2 5 2Output:
When N = 2, one possible number is 18.
A = 18 , Therefore B = 81
Since A + B = 99 .... (102 - 1 == 99)
That is, 18+81 = 99, Therefore it is one possible number ..
Can you find the other 8 ?
|Time Limit:||0.5 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, 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, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.