当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1663:Number Steps

题目描述
Starting from point (0,0) on a plane, we have written all non-negative 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...5000.
输入解释
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.
输出解释
For each point in the input, write the number written at that point or write No Number if there is none.
输入样例
3
4 2
6 6
3 4
输出样例
6
12
No Number

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Tehran 2000

源链接: POJ-1663

最后修改于 2020-10-29T06:10:26+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000