atcoder#ABC239C. [ABC239C] Knight Fork
[ABC239C] Knight Fork
Score : points
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
.
0 0 3 3
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.
0 1 2 3
No
No lattice point satisfies the condition, so No
should be printed.
1000000000 1000000000 999999999 999999999
Yes
Point and point satisfy the condition.