1913 A math game

Time Limit : 2000/1000 MS(Java/Others) | Memory Limit : 131072/65536 KB(Java/Others)

Submits : 0 | Solved : 0

Description

Two students HXZ and ZJS have just learn how to sum two positive numbers together.And they are very interested in it,so they invent a game to practice.
The role is as below:
HXZ write n numbers on the paper and add each pair of them together,then have a chang of the order of the sums, give the sums to ZJS .For example,the number he  write is 1 2 3 4,than the number ZJS gets may be 3,5,7,5,4,6.(1+2,2+3,3+4,1+4,1+3,2+4)or 3,7,5,5,6,4 etc.
What shoule ZJS do is get the number HXZ writes on the paper.
But ZJS finds it so hard and he turns the problem to you, who is good at programming!

Input

Many cases ,each case start with a number n>1,tells you how many numbers HXZ writes,than n*(n-1)/2 number which ZJS gets

Output

You shoule first output all the possible answers ,small to large.each in a line , separated by a space. numbers are sorted in lexicographical (alphabetical) order. (if no answer,print no blank line)

ZJS finds that the problem may have many possibilities ,and HXZ  may play trick on him that there may be even no answer.So if there is no answer ,You should output a line containing sentence”Don't play trick on me!”
If there if more than one possibilities, You should output a line containing sentence”Not exactly!”
Else , You should output a line containing sentence”Good ,I've solved the problem!”
After each case ,output a blankline.
be careful,all the numbers are between 1 and 5000.

Sample Input

3
10 15 18
3
10 12 14

Sample Output

Don't play trick on me!

4 6 8
Good ,I've solved the problem!


HINT

简单的意思就是对一些数字两两求和,给出所有的和求原来的数字

Source

软件协会

[ Top ] | [ Submit ]