Problems > Right Triangle

Right Triangle

Difficulty: 1100 2000 ms 128 MB

math geometry

Do the three points form a right triangle (non-degenerate)?

Input: one line with six integers: x1 y1 x2 y2 x3 y3.

Output: YES or NO.

Constraints:

  • |coordinates| ≤ 104

Sample Tests

Input 1
0 0 3 0 0 4
Output 1
YES
Input 2
0 0 1 1 2 2
Output 2
NO

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.