Problem Statement | |||||||||||||
You are given pairwise distances between four hypothetical points. You need to return "YES" if there exist four points in space with such distances between them, and "NO" otherwise (all quotes for clarity only). The distances are given as a String[] d, each element of which is a single-space separated list of integers. The j-th integer of the i-th element of d gives the distance between the i-th and j-th points. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | d will contain exactly 4 elements. | ||||||||||||
- | Each element of d will contain exactly 4 integers, separated by single spaces. | ||||||||||||
- | Each integer in d will be between 0 and 10, inclusive, and contain no extra leading zeroes. | ||||||||||||
- | The i-th integer of the i-th element of d will be 0. | ||||||||||||
- | The j-th integer of the i-th element of d will be equal to the i-th integer of the j-th element of d. | ||||||||||||
- | The j-th integer of the i-th element of d will be between 1 and 10, inclusive, when i is not equal to j. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|