Logo
(追記) (追記ここまで)

19806번 - Blocking the View 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB5710730.435%

문제

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 $a$ blocks the view to the segment $b$ in direction of the vector $\vec{v},ドル if there are such points $A$ on $a$ and $B$ on $b,ドル that the vectors $\overrightarrow{AB}$ and $\vec{v}$ are co-directed. In other words, there is a point on $a$ such that, if it starts moving along the direction of $\vec{v},ドル it would hit the segment $b$.

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 $n,ドル the number of tests that follow (1ドル \le n \le 50,000円$).

Each of the following $n$ lines contains 10 integers: $ax_1,ドル $ay_1,ドル $ax_2,ドル $ay_2,ドル $bx_1,ドル $by_1,ドル $bx_2,ドル $by_2,ドル $vx,ドル $vy$ --- 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 10ドル^6$ by their absolute values. It is guaranteed, that each segment has positive length, and that the direction vector $\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".

제한

예제 입력 1

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

예제 출력 1

Yes
No

힌트

출처

Olympiad > Russian Olympiad in Informatics > Russia Team High School Programming Contest > Russia Team High School Programming Contest 2019 B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /