Blocking the View

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Anton is developing a 2D graphics engine for video games. It must hit the market. In order to display the objects correctly, he needs to understand whether one object blocks the view to another one if the player is looking in some particular direction.

For the prototype Anton considers objects to be non-intersecting segments on the plane. The segment aa blocks the view to the segment bb in direction of the vector v\vec{v}, if there are such points AA on aa and BB on bb, that the vectors AB\overrightarrow{AB} and v\vec{v} are co-directed. In other words, there is a point on aa such that, if it starts moving along the direction of v\vec{v}, it would hit the segment bb.

Anton is busy looking for investors to his projects, so he asks you to implement this part of the graphics engine.

입력

The first line of input contains an integer nn, the number of tests that follow (1n50,0001 \le n \le 50\\,000).

Each of the following nn lines contains 10 integers: ax_1ax\_1, ay_1ay\_1, ax_2ax\_2, ay_2ay\_2, bx_1bx\_1, by_1by\_1, bx_2bx\_2, by_2by\_2, vxvx, vyvy --- coordinates of the endpoints of the first segment, coordinates of the endpoints of the second segment, and coordinates of the view direction vector. All coordinates do not exceed 10610^6 by their absolute values. It is guaranteed, that each segment has positive length, and that the direction vector v\vec{v} is non-zero.

출력

For every test print "Yes", if the first segment blocks the view to the second segment in the given direction, if it doesn't, print "No".