#P4030. Tank

    ID: 2907 远端评测题 5000ms 65MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>The 36th ACM/ICPC Asia Regional Shanghai Site —— Online Contest

Tank

Problem Description

Surprisingly, the king of the Quadruple Island Kingdom suddenly declares war on its neighbor country, the Utopia Land. After that, the King dispatches a large number of tanks for first attack. You, as the Defense Minister of Utopia Land, are certainly under mass of pressure. In order to defense the enemy, you decide to use the new secret weapon: laser cannon. This kind of weapon is so powerful that can easily destroy any thing at a line in a moment, or course, including tanks.
However, Because of some designing flaw, you can use such weapon just once during the war. The only hope is that you can choose a good moment and right way to use it so that as many tanks as possible can be destroyed.
A tank can be described as a point whose coordinate is (Xi, Yi) on a 2D-plain with speed vector (VXi, VYi) per second. Starting at time 0, you can use your laser cannon at any position and in any direction at any INTEGER number of seconds after time 0. It is possible that some tanks will meet at the same point while moving, and they will not influence each other anyway.

Input

There are multiple test cases and the number of test cases is no more than 100.
For each test cases, The first line contains a single integer N (1 <= N <= 100) indicating the number of tanks. Then N lines are following that describing the tanks respectively. Each of them consists of four nonzero integer Xi, Yi, VXi and VYi separated by single space where |Xi|,|Yi| <= 100,000,000 and |VXi|,|VYi| <= 100 denoting the initial position of a tank and the speed vector. Input will end when N = 0.

Output

For each test case, output one line with a single integer indicating the largest number of tanks which can be destroyed by the laser cannon.

4 10 10 -1 -1 3 1 4 6 2 8 5 -1 1 3 1 4 0
3