NSTEPS  Number Steps
Starting from point (0,0) on a plane, we have written all nonnegative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively and this pattern has continued.
You are to write a program that reads the coordinates of a point (x, y), and writes the number (if any) that has been written at that point. (x, y) coordinates in the input are in the range 0...10000.
Input
The first line of the input is N, the number of test cases for this problem. In each of the N following lines, there is x, and y representing the coordinates (x, y) of a point.
Output
For each point in the input, write the number written at that point or write No Number if there is none.
Example
Input: 3 4 2 6 6 3 4 Output: 6 12 No Number
hide comments
yigoli:
20190103 02:06:28
Both N are capital!!! "No Number" 

sudesh12345:
20181215 20:51:56
@arrandale


sudesh12345:
20181215 20:49:41
AC in first attempt.


arrandale:
20181215 11:24:33
Do we have to take all inputs at a time all together and print their results together or take one input ,print its output then take another input ,print its output and so on.


trungams:
20181214 02:51:21
got WA twice bc I did not capitalize the n in 'No Number' :'( 

chinmay_sharma:
20181207 11:06:22
i am getting time limit exceed


aashish_a2z:
20181130 16:12:08
Very easy...Just observe the pattern...If someone then u can.....


unseen07:
20181110 17:19:48
why do you guys show off your solution here? Don't spoil it for others please. 

adipat:
20181012 16:30:55
All you need to do is check if the number falls on the required line (y=x, y=x2) which means there is a valid result. Once you do that , find the number(n) in terms of x. It's a straightforward formula if you consider x being even and odd for both cases. Just observe the repetitive pattern and derive the formula. 

artistic_15:
20180909 21:23:14
AC in first go! Be careful check all possible combinations of coordinates before submitting. 
Added by:  Camilo Andrés Varela León 
Date:  20061125 
Time limit:  1.159s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  Asia  Tehran 2000 