No.2515 Similar Triangles
タグ : / 解いたユーザー数 229
作問者 :
MasKoaTS
/ テスター :
fky_
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もしくは右上の雲マークをクリックしてアカウントを作成してください。