Nice Lines

아직 제출이 없습니다시간 제한0.2초메모리 제한1024 MB

문제

Roxette the pirate princess has arrived to the secret island in the Remeian archipelago. There, a famous treasure, the golden nice lines is rumoured to be buried.

The secret island is a square, 2×10122 × 10^{12} by 2×10122 × 10^{12} meters long and tall. Any point on the island is described using Cartesian coordinates, with (0,0)(0, 0) being at the center, and the two axes being parallel to its sides.

There are NN golden nice lines buried on the island. The iith one for 0i<N0 ≤ i < N occupies the set of all real-valued points (x,y)(x, y) described by the linear equation y=a_ix+b_iy = a\_ix + b\_i.

Roxette can use a special device, called a lineometer. Given any point pp on the island, the lineometer will compute the sum of the distances1 from point pp to each of the NN golden nice lines.

Unfortunately, the lineometer has a limited number of uses. Can you help Roxette find the treasure with a small enough number of lineometer uses?


1The Euclidean distance between a point and a line is the length of the shortest line segment that touches both the line and the point.

제한

  • 1N1001 ≤ N ≤ 100
  • 10,000a_i,b_i10,000−10\\,000 ≤ a\_i , b\_i ≤ 10\\,000
  • No two lines are parallel.