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

Yanghee 的算术

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1388    Accepted Submission(s): 994


Problem Description
Yanghee 是一个小学生。他的数学老师给全班同学布置了一道家庭作业,即根据

一张不超过5000的n(n<50)个正整数组成的数表,两两相加得到n(n-1)/2个和,然后把它们排序。例如,如果数表含有四个数1,3,4,9,那么正确答案是4,5,7,10,12,13。Yanghee 做完作业以后和小伙伴们出去玩了一下午,回家以后发现老师给的数表不见了,可是他算出的答案还在。你能帮助Yanghee根据他的答案计算出原来的数表吗?
 

Input
输入第1行是1个正整数N,3<=n<50.然后有若干行,每行10个正整数,共计n(n-1)/2个数. 输入的数据有唯一解.
 

Output
按从小到大输出n个数x[1],x[2],...,x[n],每行1个,使得任意2个数之和恰是输入的n(n-1)/2个数.
 

Sample Input
15 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 6 7 8 9 10 11 12 13 14 15 16 17 7 8 9 10 11 12 13 14 15 16 17 18 9 10 11 12 13 14 15 16 17 18 19 11 12 13 14 15 16 17 18 19 20 13 14 15 16 17 18 19 20 21 15 16 17 18 19 20 21 22 17 18 19 20 21 22 23 19 20 21 22 23 24 21 22 23 24 25 23 24 25 26 25 26 27 27 28 29
 

Sample Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 

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-11-25 09:03:52, Gzip enabled