問題一覧 > 通常問題

No.3180 angles sum

レベル : / AI推定難易度 : 1350 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 59
作問者 : Cafe1942 / テスター : tsunamayo123 kk2a sclara
お気に入りにしたユーザー ProblemId : 12339 / 自分の提出
問題文最終更新日: 2025-06-13 21:31:06
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 470 (順位表) の他の問題:

Problem Statement

On a $2$-dimensional plane, there are points $O = (0,0)$ $,$ and $G = (10^{100},0)$. There are also $3$ points $A = (A_X,A_Y)$ $,$ $B = (B_X,B_Y)$ $,$ $C = (C_X,C_Y)$ that do not coincide with $O$ $,$ $G$. Here, it is guaranteed that points $A,B$ lie in the region where both the $X$ coordinate and the $Y$ coordinate are non-negative, and that point $C$ lies in the region where the $Y$ coordinate is non-negative.

In the following, the symbol $\angle$ denotes the angle that is at most $180$ degrees. Print Yes if $\angle AOG + \angle BOG = \angle COG$, and No otherwise.

Solve $T$ independent test cases.

Constraints

  • $1 \leq T \leq 200000 $
  • $0 \leq A_X , B_X \leq 10^6 $
  • $-10^6 \leq C_X \leq 10^6 $
  • $0 \leq A_Y , B_Y \leq 10^6 $
  • $0 \leq C_Y \leq 10^6 $
  • $(A_X , A_Y) , (B_X , B_Y) , (C_X , C_Y) \neq (0 , 0)$
  • All values in the input are integers.

Input

The input is given in the following format. $CASE_i$ $(1 \leq i \leq T)$ denotes the $i$-th test case.
$T$
$CASE_1$
$CASE_2$
$\vdots$
$CASE_T$
Each test case is given in the following format.
$A_X$ $A_Y$ $B_X$ $B_Y$ $C_X$ $C_Y$

Output

Print $T$ lines in total. On the $i$-th line $(1 \leq i \leq T)$, print the answer for the $i$-th test case.

Sample

Sample 1
Input
4
2 1 3 1 1 1
4 4 5 6 -4 6
1 1 1 1 0 1
0 7 0 8 -9 0
Output
Yes
No
Yes
Yes

For the $1$-st test case, $\angle AOG$ is approximately $26.565051177$ degrees, $\angle BOG$ is approximately $18.434948823$ degrees, and their sum is $45$ degrees. Also, $\angle COG$ is $45$ degrees. Therefore, print Yes.

For the $4$-th test case, note that points $A,B,C$ may lie on the coordinate axes. Note also that points $A,B,C$ never coincide with the origin $O$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。