|
||||||||||
PairsTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 828 Accepted Submission(s): 420 Problem Description Given n positive integers, is it possible to divide them into pairs so that the sum of each pair is the same? Input The input contains several test cases. The first line of each case contains a single integer n (2 ¡Ü n ¡Ü 100). The second line contains n positive integers not greater than 1000. These numbers are sorted in non-decreasing order. The last case is followed by a single zero, which should not be processed. Output For each case, output ¡®Yes¡¯ or ¡®No¡¯ depending on whether or not the pairing is possible. Sample Input
Sample Output
Source | ||||||||||
|