NSTEPS

1
100 155
1
100 98
1
1000 998
1
10000 9998
4
10000 9998
1000 998
100 98
100 155
1
100 155
3
4 2
6 6
3 4
#include 
#include 
using namespace std;

int main()
{
	int arrX[20001], arrY[20001];
	arrX[0] = 0;
	arrY[0] = 0;
	arrX[1] = 1;
	arrY[1] = 1;
	int j = 1, k = 1, a = 0, b = 1;
	while(j < 20001) 
	{
		arrY[++k] = a;
		arrY[++k] = b;
	    a += 2;
	    b += 2;
	   	arrX[++j] = a;
	   	arrX[++j] = b;
	   	arrX[++j] = a;
	    arrX[++j] = b;
	    arrY[++k] = a;
		arrY[++k] = b;
	}
	int t;
	scanf("%d", &t);
	while(t--) 
	{
		int x, y, y1, y2;
		scanf("%d%d", &x, &y);
		if(x >= 0 && y>=0 && x <= 10000 && y<= 10000)
		{
			int i = 0;
			while(arrX[i] != x)
			{
				i++;
			}
			y1 = arrY[i];
			y2 = arrY[i+2];
			if(y == y1)
			{
				printf("%d", i);
			}
			else if(y == y2)
			{
				printf("%d", i+2);
			}
			else
			{
				printf("No Number");
			}
		}
		else
		{
			printf("No Number");
		}
		printf("\n");
	}	
	return 0;
}
3
1
1
3
1
3
1
2
3
1
4
2
4 2
1 
7 5
4
4 2
6 2
3 4
5 4
4
4 2
6 6
3 4
5 4
4
55 55
55 53
100 102
100 98
1
7 9
1
9 7
4
1555 1555
7855 7853
1000 1002
1000 9998
4
1555 1555
7855 7853
1000 1002
10000 99998
4
1555 1555
7855 7853
1000 1002
10000 99998
4
1555 1555
7855 7853
1000 1002
10000 9998
5
1555 1555
7855 7853
1000 1002
10000 9998
0 0
5
1555 1555
7855 7853
1000 1002
10000 9998
5000 4998
3
1 3
3 1
47 45
1
987 654
2
0 0
10000 10000
2
0 0
10001 10000
5
1555 1555
7855 7853
1000 1002
10000 9998
0 0
5
1555 1555
7855 7853
1000 1002
10000 9998
5000 4998
4
10000 9998
1000 998
57 57
100 155
4
10000 9998
1000 998
57 58
100 155
4
10000 9998
1000 998
56 58
100 155
4
10000 9998
1000 998
58 56
100 155
4
10000 9998
1000 998
58 55
100 155
1
100 98
1
10000 9998
1
1000 1002

4
4 2
6 6
3 4
5 4
4
4 2
6 2
3 4
5 4
1
7 7
1
9 7
1
9 9
1
10000 10000
1
209080564737271234567890
23451678950887564732123456
1
10000 9889
1
10000 9878
2
1000 998
2 4
5
3 3
5 5
7 7
4 4
6 6
5
3 3
5 5
7 7
9 9
11 11