CF961D.Pair Of Lines

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given nn points on Cartesian plane. Every point is a lattice point (i. e. both of its coordinates are integers), and all points are distinct.

You may draw two straight lines (not necessarily distinct). Is it possible to do this in such a way that every point lies on at least one of these lines?

输入格式

The first line contains one integer nn (1<=n<=105)(1<=n<=10^{5}) — the number of points you are given.

Then nn lines follow, each line containing two integers xix_{i} and yiy_{i} (xi,yi<=109)(|x_{i}|,|y_{i}|<=10^{9}) — coordinates of ii -th point. All nn points are distinct.

输出格式

If it is possible to draw two straight lines in such a way that each of given points belongs to at least one of these lines, print YES. Otherwise, print NO.

输入输出样例

  • 输入#1

    5
    0 0
    0 1
    1 1
    1 -1
    2 2
    

    输出#1

    YES
    
  • 输入#2

    5
    0 0
    1 0
    2 1
    1 1
    2 3
    

    输出#2

    NO
    

说明/提示

In the first example it is possible to draw two lines, the one containing the points 11 , 33 and 55 , and another one containing two remaining points.

首页