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

建议使用的浏览器:

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

7254:Maximum Triangles

Special Judge 特殊评判
题目描述
We called a triangle is good if and only If the triangle contains the origin.

You need to find $n$ points on the plane, satisfying:

- None any two of them and the origin should be collinear.
- The coordinates of each point should be an integer and in the range $[-50000,50000]$.
- Under the above limits, the number of good triangles made up of those $n$ points should be maximized.

Output the maximum number and a set of the coordinates of those $n$ points for which the maximum is reached.
输入解释
The first line of input contains a single integer $T(1\leq T\leq 10)$, indicating the number of test cases.

Each of the next $T$ lines contains a single integer $n(1\leq n\leq 2\times 10^5)$, describing the number of points you have to find for that test case.

It is guaranteed that the sum of $n$ over all test cases does not exceed $10^6$.
输出解释
For each test case print $(n+1)$ lines. The first line should contain a single integer, denoting the maximum number of good triangles. The $i$-th of the next $n$ lines should contain two space-separated integers $x_i,y_i(|x_i|,|y_i|\leq 50000)$, denoting the coordinates of the $i$-th point of the set. If there are multiple solutions, output any.

输入样例
1
3
输出样例
1
0 1
-1 -1
1 -1

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

源链接: HDU-7254

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

共提交 0

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