Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/262144 K (Java/Others) Total Submission(s): 156 Accepted Submission(s): 114
Problem Description
There are n numbers
A1,A2....An,your task is to check whether there exists there different positive integers i, j, k (
1≤i,j,k≤n) such that
Ai−Aj=Ak
Input
There are multiple test cases, no more than 1000 cases.
First line of each case contains a single integer n.
(3≤n≤100).
Next line contains n integers
A1,A2....An.
(0≤Ai≤1000)
Output
For each case output "YES" in a single line if you find such i, j, k, otherwise output "NO".