Can You Reach There?
시간 제한2초메모리 제한2048 MB
각 질의에서 두 표시점과 현재 위치로 만든 선분 위의 점으로 이동할 수 있을 때, 한 점에서 다른 점에 도달할 수 있는지 판정한다.
문제
You are given distinct marked points on a 2D plane, numbered from to . Marked point has coordinates .
In this problem, you are given scenarios, numbered from to . In each scenario , four integers , , , and are given, indicating that you initially stand at and aim to reach by repeating the steps described below any number of times.
In a single step, you choose two marked points and , which may be identical. Let denote the point where you are currently standing, and define a point by
.
In other words, is chosen so that the vector from to has the same direction and length as the vector from to . You may then move to any point on the segment , including the point itself, and you will stand at that new point.
For each scenario, determine whether the objective can be achieved using the described steps. Note that all scenarios are independent of each other.
입력
The first line of input contains two integers and (, ). The -th of the next lines contains two integers and (). The input guarantees that no two marked points have the same coordinates.
The next lines represent the scenarios. The -th of these lines contains four integers , , , and (; ).
출력
Output lines. The -th line should contain yes if the objective of scenario is achievable, or no otherwise.