QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100

#3769. Collinear Points

统计

Bobo has drawn three line segments $s_1$, $s_2$, and $s_3$ on a plane. The left endpoint of segment $s_i$ is $(a_i, y_i)$ and the right endpoint is $(b_i, y_i)$. Determine whether it is possible to find three points $p_1$, $p_2$, and $p_3$ such that:

  • $p_i$ lies on segment $s_i$;
  • $p_1$, $p_2$, and $p_3$ are collinear.

Input

The input contains multiple test cases. Process until the end of the file.

Each test case consists of three lines. The first line contains three integers $a_1, b_1, y_1$. The second line contains three integers $a_2, b_2, y_2$. The third line contains three integers $a_3, b_3, y_3$.

  • $0 \leq a_i < b_i \leq 10^9$
  • $0 \leq y_1 < y_2 < y_3 \leq 10^9$
  • The number of test cases does not exceed $10^4$.

Output

For each test case, output Yes if three such collinear points exist, otherwise output No.

Examples

Input 1

0 1 0
0 1 1
0 1 2
0 1 0
1 2 1
0 1 2
0 1 0
2 3 1
0 1 2

Output 1

Yes
Yes
No

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.