|
||||||||||
NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/262144 K (Java/Others)Total Submission(s): 2054 Accepted Submission(s): 1119 Problem Description There are n numbers ${A}_{1},{A}_{2}....{A}_{n}$,your task is to check whether there exists there different positive integers i, j, k ($1\leq i , j , k \leq n$) such that ${A}_{i}-{A}_{j}={A}_{k}$ Input There are multiple test cases, no more than 1000 cases. First line of each case contains a single integer n.$(3\leq n\leq 100)$. Next line contains n integers ${A}_{1},{A}_{2}....{A}_{n}$.$(0\leq {A}_{i}\leq 1000)$ Output For each case output "YES" in a single line if you find such i, j, k, otherwise output "NO". Sample Input
Sample Output
Source | ||||||||||
|