#abc239c. C - Knight Fork
C - Knight Fork
Score : points
问题描述
在 坐标平面上,是否存在一个格点,其到两个格点 和 的距离都为 ?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
On an -coordinate plane, is there a lattice point whose distances from two lattice points and are both ?
Notes
A point on an -coordinate plane whose and coordinates are both integers is called a lattice point.
The distance between two points and is defined to be the Euclidean distance between them, .
The following figure illustrates an -plane with a black circle at and white circles at the lattice points whose distances from are . (The grid shows where either or is an integer.)
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If there is a lattice point satisfying the condition, print Yes
; otherwise, print No
.
Sample Input 1
0 0 3 3
Sample Output 1
Yes
- The distance between points and is ;
- the distance between points and is ;
- point is a lattice point,
so point satisfies the condition. Thus, Yes
should be printed.
One can also assert in the same way that also satisfies the condition.
Sample Input 2
0 1 2 3
Sample Output 2
No
No lattice point satisfies the condition, so No
should be printed.
Sample Input 3
1000000000 1000000000 999999999 999999999
Sample Output 3
Yes
Point and point satisfy the condition.
update @ 2024/3/10 10:18:54