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
thiyagumessi:
20191208 13:38:16
Hint: Use line equations


trhgquan:
20191102 16:35:24
For one who is trying, look the figure CAREFULLY, use a ruler or a pencil if you have one. Cost me 5 WA to realised the special. Last edit: 20191102 16:36:53 

vishvas07:
20191002 05:09:58
don't forget \n(new line) 

pankajnegi_113:
20190928 07:36:38
AC in one GO! Just need to see little pattern in x and y then you are good to go ;) 

iamrajanjharj:
20190627 10:05:46
Observe the path the numbers follow on the graph and difference between the numbers. The problem is easy. 

wolfie10:
20190521 13:13:16
basic if else...level 0 problem..


towhid1zaman:
20190521 07:51:46
its easy problems, I got WA for my silly mistake.. you have to write 3 or 4 lines if, else if, then its AC, go... 

man_u_13:
20190514 13:45:28
for y=x2 case...i was deriving the pattern as (x1)th even number is x is even and (x1)th odd number if x is odd...which led to WA. How is this logic not working in the pattern later on..can anyone explain? 

rotto:
20190421 01:31:04
snake_123 make sure that x is always bigger or the same as y and the difference is always 2 

snake_123:
20190420 08:02:01
sum of even coordinates is equal to the number and sum of odd coordinate 1 is equal to the number along with x>=y.. but it is not working

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 