問題一覧 > 通常問題

No.2515 Similar Triangles

レベル : / AI推定難易度 : 115 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 229
作問者 : MasKoaTS / テスター : Shirotsume fky_
お気に入りにしたユーザー ProblemId : 10167 / 自分の提出
問題文最終更新日: 2023-10-25 00:05:03
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 410 (順位表) の他の問題:

Problem Statement

You are given $5$ positive integers $X_{1}, Y_{1}, X_{2}, Y_{2}, X_{3}$. Here, $X_{3}$ is even.

Consider the $4$ points $O(0, 0), A(X_{1}, Y_{1}), B(X_{2}, Y_{2}), C(X_{3}, 0)$ on a two-dimensional plane. Are the areas of the $2$ triangles $OAC$, $OBC$ equal?

Constraints

  • $1 \leq X_{1}, Y_{1}, X_{2}, Y_{2}, X_{3} \leq 100$

  • $X_{3}$ is even

  • $(X_{1}, Y_{1}) \neq (X_{2}, Y_{2})$

  • All inputs are integers

Input

The input is given in the following format.

$X_{1}$ $Y_{1}$ $X_{2}$ $Y_{2}$ $X_{3}$
  • The $1$st line contains $X_{1}, Y_{1}, X_{2}, Y_{2}, X_{3}$ in this order, separated by single-byte spaces

Output

If the areas of triangles $OAC$, $OBC$ are equal, print Yes; otherwise, print No, on $1$ line.

Sample

Sample 1
Input
1 5 3 5 8
Output
Yes

The areas of the $2$ triangles are both $20$.

Sample 2
Input
2 3 4 5 6
Output
No

The areas of triangles $OAC$, $OBC$ are $9$, $15$, respectively.

Sample 3
Input
1 77 100 77 2
Output
Yes

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