A New Restaurant
All submissions for this problem are available.
Chef opens a new restaurant in the city of Byteland which can be represented in x-y plane. Chef’s restaurant is at point R(0,0). All the (x,y) points in Byteland where x and y both are integers represent a building. One fine day, Chef wants to know the number of buildings which are exactly D unit away from chef restaurant.
- First line contains a number T, number of test cases. Each of the next T line contains a number D
For each test case print the number of buildings which are exactly D unit away from (0,0).
Input: 1 1
Example case 1.There will be 4 points at a distance of 1 unit from Chefs restaurant, these are (1,0), (-1,0), (0,1), (0,-1)
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.5, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.