#C5564. Right-Angled Triangle Triplet Checker

    ID: 49227 Type: Default 1000ms 256MiB

Right-Angled Triangle Triplet Checker

Right-Angled Triangle Triplet Checker

Given a list of positive integers, determine if any three of them can be the lengths of the sides of a right-angled triangle. A triangle is right-angled if the square of its longest side is equal to the sum of the squares of the other two sides, i.e. $a^2 + b^2 = c^2$ where c is the longest side.

You are required to read the input from stdin. The first line contains an integer n, the number of elements. The second line contains n space-separated positive integers.

Output True if there exist any three numbers that can form the sides of a right-angled triangle, otherwise output False.

inputFormat

The input is given in two lines:

  1. The first line contains a single integer n, representing the number of elements in the list.
  2. The second line contains n space-separated positive integers.

Read the input from stdin.

outputFormat

Output a single line, either True or False, indicating whether any three numbers can form the sides of a right-angled triangle.

Write the output to stdout.

## sample
4
3 4 5 6
True