407911: GYM102940 D Robot Toss

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Robot Tosstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Alice and Bob have become intelligent robots! They have acquired a ball and want to toss it back and forth to each other. However, the sneaky Eve wants to steal their ball.

Alice and Bob are at $$$(x_a, y_a)$$$ and $$$(x_b, y_b)$$$ on the coordinate plane, respectively, where both their locations are lattice points (the coordinates are integers). Eve is also located at a lattice point, and if the path of the ball crosses directly overhead of Eve, she is able to jump up and steal the ball. However, if Eve is not directly on the path, she will not be able to intercept the ball.

Given multiple possible locations of Eve, determine if Alice and Bob's game of toss would be interrupted.

Input

The first line of the input contains $$$x_a$$$ and $$$y_a$$$, Alice's location.

The next line of the input contains $$$x_b$$$ and $$$y_b$$$, Bob's location.

The next line contains $$$E$$$ $$$(1 \le E \le 100)$$$, the number of different possible locations of Eve.

The next $$$E$$$ lines each contain $$$x, y$$$, a possible location of Eve.

We know that $$$-10^4 \le x_a, x_b, x, y_a, y_b, y \le 10^4$$$.

Output

Output $$$E$$$ lines, where each line is a simple Yes or No, corresponding to if Eve can intercept Alice and Bob's ball.

ExampleInput
0 0
2 2
2
1 1
-1 -1
Output
Yes
No

加入题单

算法标签: