1600.Kuangyeye's Game

Time Limit: 1s Memory Limit: 256MB

Christmas Day is coming! To celebrate this great festival, Kuangyeye, a creative boy, wants to play a game with everyone. The rule is described as following: there are several balloons in the classroom, and you have a prop gun. To achieve a higher goal, you need to shoot as many balloons as you can with one bullet. Now you have to judge whether you can explosive all balloons with one shoot. In a rigorous word, there are n points on the plane, you need to judge if they are on the same line. In addition, the balloons may extremely tiny, so some of them may share the same coordinate.

Input Format(From the terminal/stdin)

The first line contains an integer $n$ which indicates the number of balloons. The next $n$ following
lines contain two integers $x_i$ and $y_i$, which represent the $X$ coordinate and the $Y$ coordinate of $i$-th balloon respectively.
$1 ≤n≤1000,1≤|x_i|,|y_i|≤1000$

Output Format(To the terminal/stdout)

If you can explosive all balloons with one shoot, output "Yes". Output "No" otherwise(without quotes).

Sample Input 1

Copy
2
1 1
-1 -1
 \n
 · \n
  ·  \n

Sample Output 1

Copy
Yes
   \n

Sample Input 2

Copy
3
1 2
2 1
3 3
 \n
 · \n
 · \n
 · \n

Sample Output 2

Copy
No
  \n

Hints

In the first sample, These two ballons are all on the line $x-y=0$.
In the second sample, We can't find a line which all these ballons on it.

Source: 2019 HNU新生赛

Submit

请先 登录

© 2025 FAQs