### 利用Python自動填寫google表單（不要傳給你老師XD）

有些老師會要求學生要製作一個google表單，然後要求學生去調查，真的是一件很麻煩的事情，還要到處麻煩別人。自己填又很浪費時間，尤其是表單選項超多的時候。身為資工具人，就要寫個程式秒殺它。這篇文章適合有基本程式能力的人創題目首先先試試簡單的情況，全單選提交一份看看打開提交頁面看看這時候打開瀏覽器的開發人緣工具 (如果開完還是邊緣人別找我XD(快捷鍵應該是 ctrl+shift+i)

Link: UVa 13278 - Angry Birds Transformers

13278 Angry Birds Transformers

Angry Birds Transformers is a side-scrolling shoot ’em up video game, the tenth installment in the Angry Birds series, a crossover between Angry Birds and Transformers, featuring battles between the Autobirds and Deceptihogs, Angry Birds versions of the Autobots and Decepticons. It is published by Rovio Entertainment with collaboration from Hasbro. [From Wikipedia] Six consecutive screenshots from this game are shown below:

As you can see that as the player moves from left to right he can see new objects and can try to destroy them. Given the location of all the objects you will have to find out the maximum number of objects that are visible at any point of the game by the player. For simplicity you can assume the following things:

- All objects can be considered as points in a two dimensional Cartesian coordinate system.
- The player runs along the x axis from left to right.
- The viewing angle of the eye of the player is 90 degree and symmetric along the straight line \(x = p_x\) , where \(p_x\) is the abscissa of the player location.
The following image will make things clear:

The goal is to find the maximum number of objects that can be seen at a time if the player moves along the x-axis. You can assume that if two or more objects and the location of the player are collinear, the player can still see all the objects. There is no need to find the location from where the maximum number of objects are visible as there can be more than one such place. The image above corresponds to the sample input.

Input

Input file contains at most 100 sets of inputs. Each set starts with a positive integer N ( \(N ≤ 10000\) ) denoting the total number of objects present in the scenario. Each of the next N lines contains two integers \((x_i, y_i)\) , denoting the Cartesian coordinate of the i-th object. Here ( \(0 < x_i ≤ 10000\) and \(0 < y_i ≤ 500\) ). Input is terminated by a line containing a single zero.

Output

For each set of inputs, produce one line of output. This line contains an integer that denotes the maximum number of objects visible by a player while running along the x-axis.

Sample Input

`5 2 3 6 6 9 9 11 6 14 4 0`

Sample Output

`4`

換成一維來處理

```
#include <iostream>
int main()
{
constexpr const int BASE = 501;
constexpr const int MAX = 10001 + 501 + BASE;
int objects, x, y, view, result;
int i;
int *diagonal_left, *diagonal_right;
std::ios::sync_with_stdio(false);
while (std::cin >> objects && objects)
{
diagonal_left = new int[MAX]();
diagonal_right = new int[MAX]();
while (objects--)
{
std::cin >> x >> y;
++diagonal_left[BASE + x + y];
++diagonal_right[BASE + x - y];
}
view = 0, result = 0;
for (i = 0; i <= MAX; ++i)
{
view += diagonal_right[i];
if (view > result) result = view;
view -= diagonal_left[i];
}
std::cout << result << std::endl;
delete[] diagonal_left, diagonal_right;
}
return 0;
}
```