問題一覧 > 通常問題

No.2628 Shrinkage

レベル : / AI推定難易度 : 1100 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 74
作問者 : noya2 / テスター : ebi_fly tassei903
お気に入りにしたユーザー ProblemId : 10589 / 自分の提出
問題文最終更新日: 2024-02-17 00:37:43
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
traP 作問ハッカソンコンテスト 002(day1) (順位表) の他の問題:

Problem Statement

There are $2$ points $P_1(x_1,y_1),P_2(x_2,y_2)$ on the $xy$-plane.

You may perform the following sequence of operations on them any number of times, $0$ or more.

  • Choose any $1$ point on the $xy$-plane and call it $C(x_c,y_c)$.
  • Choose any real number satisfying $0\lt k\lt 1$.
  • Let $d_1$ be the distance between $P_1$ and $C$. Move $P_1$ toward $C$ by $d_1k$.
  • Let $d_2$ be the distance between $P_2$ and $C$. Move $P_2$ toward $C$ by $d_2k$.

Is it possible to make $P_1,P_2$ coincide with $Q_1(X_1,Y_1),Q_2(X_2,Y_2)$, respectively, at the same time?

Find the answer for each of the $T$ cases.

Constraints

  • All input values are integers.
  • $1\le T\le 100$
  • $0\le x_1,y_1,x_2,y_2,X_1,Y_1,X_2,Y_2\le 10^9$
  • $(x_1,y_1)\neq (x_2,y_2)$
  • $(X_1,Y_1)\neq (X_2,Y_2)$

Input

$T$
$\mathrm{test}_1$
$\mathrm{test}_2$
$\vdots$
$\mathrm{test}_T$
Here, $\mathrm{test}_i$ denotes the $i$-th test case. Each test case is given in the following format.
$x_1$ $y_1$ $x_2$ $y_2$ $X_1$ $Y_1$ $X_2$ $Y_2$

Output

Print $T$ lines. On the $i$-th line, print the following for the $i$-th test case.

If it is possible to make $P_1,P_2$ coincide with $Q_1(X_1,Y_1),Q_2(X_2,Y_2)$, respectively, at the same time, print Yes. Otherwise, print No.

Sample

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

For the $1$st test case, choosing $(3,0),\dfrac{2}{3}$ as $C,k$ makes them coincide in $1$ operation.

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