No.1041 Straight Line University
タグ : / 解いたユーザー数 379
作問者 :
Suunn
/ テスター :
trineutron
Problem Statement
Takahashi is a student at Straight Line University (abbreviated as SLU).
Today's lecture at Straight Line University covered collinear points (points that lie on the same straight line). Takahashi found today's lecture interesting, so he decided to draw $N$ points on the coordinate plane and investigate how many points a single straight line can pass through at most. The coordinates of the $i$-th point Takahashi drew are $(X_i,Y_i)$.
However, Takahashi got tired partway through and fell asleep. Please find the answer to this problem in his place.
Input
$N$ $X_1\ Y_1$ $X_2\ Y_2$ $\vdots$ $X_N\ Y_N$
$2\le N\le 100$
$0\le X_i,Y_i\le 100$
If $i \neq j $, then $(X_i,Y_i) \neq (X_j,Y_j)$
All input values are integers.
Output
Output the number of points passed through by the straight line that passes through the largest number of the points Takahashi drew.
Sample
Sample 1
Input
2 1 2 3 4
Output
2
There is no line passing through $2$ points other than the line through $(1,2) , (3,4)$.
Sample 2
Input
4 1 2 2 4 3 7 4 8
Output
3
$(1,2), (2,4), (4,8)$ lie on a single straight line.
Sample 3
Input
4 0 0 0 1 1 0 1 1
Output
2
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。