Under construction

Still being built. Things may change

Number Steps

Interview

Time limit1sMemory limit128 MB

Summary
Given a point, print the number written there by a fixed boustrophedon path over the plane, or No Number if the point is empty.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Starting from the point (0,0)(0, 0) on the plane, the non-negative integers 0,1,2,…0, 1, 2, \dots are written one per point following the pattern shown in the figure below. For example, 11, 22, and 33 are written at the points (1,1)(1, 1), (2,0)(2, 0), and (3,1)(3, 1) respectively, and the pattern continues in the same way.

Given the coordinates (x,y)(x, y) of a point, write a program that prints the number written at that point, or reports that no number is written there. Every input coordinate satisfies 0≤x,y≤50000 \le x, y \le 5000.

Input

The first line contains NN, the number of test cases. Each of the following NN lines contains two integers xx and yy, the coordinates of a point.

Output

For each point, print the number written at that point on its own line. If no number is written at that point, print No Number instead.

Examples3

  1. Example 1

    Input
    3
    4 2
    6 6
    3 4
    
    Expected output
    6
    12
    No Number
    
  2. Example 2

    Input
    4
    0 0
    1 1
    2 0
    3 1
    
    Expected output
    0
    1
    2
    3
    
  3. Example 3

    Input
    3
    0 1
    5 0
    1 0
    
    Expected output
    No Number
    No Number
    No Number