F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Pairs

Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 825    Accepted Submission(s): 418


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
4 1 3 4 6 3 1 1 1 0
 

Sample Output
Yes No
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-12 10:04:40, Gzip enabled