English · Original
Chinese · Translation
Formal · Original
_Connect the countless points with lines, till we reach the faraway yonder._
There are _n_ points on a coordinate plane, the _i_\-th of which being (_i_, _y__i_).
Determine whether it's possible to draw two parallel and non-overlapping lines, such that every point in the set lies on **exactly one** of them, and each of them passes through **at least one** point in the set.
## Input
The first line of input contains a positive integer _n_ (3 ≤ _n_ ≤ 1 000) — the number of points.
The second line contains _n_ space-separated integers _y_1, _y_2, ..., _y__n_ ( - 109 ≤ _y__i_ ≤ 109) — the vertical coordinates of each point.
## Output
Output "_Yes_" (without quotes) if it's possible to fulfill the requirements, and "_No_" otherwise.
You can print each letter in any case (upper or lower).
[samples]
## Note
In the first example, there are five points: (1, 7), (2, 5), (3, 8), (4, 6) and (5, 9). It's possible to draw a line that passes through points 1, 3, 5, and another one that passes through points 2, 4 and is parallel to the first one.
In the second example, while it's possible to draw two lines that cover all points, they cannot be made parallel.
In the third example, it's impossible to satisfy both requirements at the same time.
_Connect the countless points with lines, till we reach the faraway yonder._
There are #cf_span[n] points on a coordinate plane, the #cf_span[i]-th of which being #cf_span[(i, yi)].
Determine whether it's possible to draw two parallel and non-overlapping lines, such that every point in the set lies on *exactly one* of them, and each of them passes through *at least one* point in the set.
The first line of input contains a positive integer #cf_span[n] (#cf_span[3 ≤ n ≤ 1 000]) — the number of points.
The second line contains #cf_span[n] space-separated integers #cf_span[y1, y2, ..., yn] (#cf_span[ - 109 ≤ yi ≤ 109]) — the vertical coordinates of each point.
Output "_Yes_" (without quotes) if it's possible to fulfill the requirements, and "_No_" otherwise.
You can print each letter in any case (upper or lower).
In the first example, there are five points: #cf_span[(1, 7)], #cf_span[(2, 5)], #cf_span[(3, 8)], #cf_span[(4, 6)] and #cf_span[(5, 9)]. It's possible to draw a line that passes through points #cf_span[1, 3, 5], and another one that passes through points #cf_span[2, 4] and is parallel to the first one.
In the second example, while it's possible to draw two lines that cover all points, they cannot be made parallel.
In the third example, it's impossible to satisfy both requirements at the same time.
## Input
The first line of input contains a positive integer #cf_span[n] (#cf_span[3 ≤ n ≤ 1 000]) — the number of points.The second line contains #cf_span[n] space-separated integers #cf_span[y1, y2, ..., yn] (#cf_span[ - 109 ≤ yi ≤ 109]) — the vertical coordinates of each point.
## Output
Output "_Yes_" (without quotes) if it's possible to fulfill the requirements, and "_No_" otherwise.You can print each letter in any case (upper or lower).
[samples]
## Note
在第一个例子中,有五个点:#cf_span[(1, 7)], #cf_span[(2, 5)], #cf_span[(3, 8)], #cf_span[(4, 6)] 和 #cf_span[(5, 9)]。可以画一条经过点 #cf_span[1, 3, 5] 的直线,另一条经过点 #cf_span[2, 4] 且与第一条直线平行的直线。
在第二个例子中,虽然可以画出两条覆盖所有点的直线,但它们无法变得平行。
在第三个例子中,不可能同时满足两个要求。
**Definitions**
Let $ n \in \mathbb{Z} $, $ n \geq 3 $, be the number of points.
Let $ P = \{ (i, y_i) \mid i \in \{1, 2, \dots, n\} \} $ be the set of points on the coordinate plane, where $ y_i \in \mathbb{Z} $ and $ |y_i| \leq 10^9 $.
**Constraints**
1. $ 3 \leq n \leq 1000 $
2. $ -10^9 \leq y_i \leq 10^9 $ for all $ i \in \{1, \dots, n\} $
**Objective**
Determine whether there exist two distinct, parallel, non-overlapping lines $ \ell_1 $ and $ \ell_2 $, both with the same slope $ m \in \mathbb{R} $, such that:
- $ P \subseteq \ell_1 \cup \ell_2 $,
- $ \ell_1 \cap \ell_2 = \emptyset $,
- $ P \cap \ell_1 \neq \emptyset $ and $ P \cap \ell_2 \neq \emptyset $,
- Each point in $ P $ lies on exactly one of $ \ell_1 $ or $ \ell_2 $.
Equivalently, determine whether the set $ P $ can be partitioned into two nonempty subsets $ P_1 $ and $ P_2 $, such that all points in $ P_1 $ lie on a line of slope $ m $, all points in $ P_2 $ lie on a parallel line of slope $ m $, and the two lines are distinct.
API Response (JSON)
{
"problem": {
"name": "B. Tell Your World",
"description": {
"content": "_Connect the countless points with lines, till we reach the faraway yonder._ There are _n_ points on a coordinate plane, the _i_\\-th of which being (_i_, _y__i_). Determine whether it's possible to ",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 1000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF849B"
},
"statements": [
{
"statement_type": "Markdown",
"content": "_Connect the countless points with lines, till we reach the faraway yonder._\n\nThere are _n_ points on a coordinate plane, the _i_\\-th of which being (_i_, _y__i_).\n\nDetermine whether it's possible to ...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "_Connect the countless points with lines, till we reach the faraway yonder._\n\nThere are #cf_span[n] points on a coordinate plane, the #cf_span[i]-th of which being #cf_span[(i, yi)].\n\nDetermine whethe...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ n \\in \\mathbb{Z} $, $ n \\geq 3 $, be the number of points. \nLet $ P = \\{ (i, y_i) \\mid i \\in \\{1, 2, \\dots, n\\} \\} $ be the set of points on the coordinate plane, where $ y_i ...",
"is_translate": false,
"language": "Formal"
}
]
}