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

建议使用的浏览器:

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

7223:Quel'Thalas

题目描述
$\space \space$ *Desperate magic addiction once made us miserable. Territory occupied by natural disasters made us wandering. But the misery should be put behind and we shall enter a new chapter.*

$\space \space$ *Us the same blood flows,we will bring back the glory of the sun again!*

$\space \space$ *Salama ashal'anore!*

Kael'thas has a magic square which contains all points on the 2D plane whose coordinates are integers within $[0,n]$.

He can draw several straight fire lines on the plane. Each line will cover all the points on it. Note that the lines have no endpoints and extend to infinity in both directions.

And there is one special rule: he cannot draw a line that covers the point $(0,0)$ because his throne is on $(0,0)$.

What is the minimum number of lines he needs to draw so that the lines will cover all the points of the magic square except $(0,0)$?
输入解释
The input consists of multiple test cases.

The first line contains one integer $T\ (1\leq T\leq50)$ denoting the number of test cases.

The following are T test cases.

Each test case consists of one line containing one integer $n\ (0\leq n\leq 50)$.
输出解释
For each test case, output one line containing one integer indicating the answer.
输入样例
1
2
输出样例
4
来自杭电HDUOJ的附加信息
Hint One possible answer for the sample is : x = 1, x = 2, y = 1, y = 2

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7223

最后修改于 2022-09-15T06:17:28+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 524288/524288K(Java/Others)