22341_PairsumoniousNumbers

2022-5-16 18:21| 发布者: Hocassian| 查看: 25| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506338580999-Problem List-采集的数据-后羿采集器.html

Pro.ID

22341

Title

Pairsumonious Numbers

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22341

AC

0

Submit

7

Ratio

0.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 6553/65536 K (Java/Others)
  • 描述

    validator没写好,到POJ提交吧

    For 10 > N > 2 numbers we form N×(N-1)/2 sums by adding every pair of the numbers. Your task is to find the N numbers given the sums.

    输入

    Each line of input contains N followed by N×(N-1)/2 integer numbers separated by a space.

    输出

    Description

    validator没写好,到POJ提交吧

    For 10 > N > 2 numbers we form N×(N-1)/2 sums by adding every pair of the numbers. Your task is to find the N numbers given the sums.

    Input

    Each line of input contains N followed by N×(N-1)/2 integer numbers separated by a space.

    Output

    For each line of input, output one line containing N integers in non-descending order such that the input numbers are pairwise sums of the N numbers. If there is more than one solution, any one will do; if there is no solution, print "Impossible".

    Sample Input

    3 1269 1160 1663
    3 1 1 1
    5 226 223 225 224 227 229 228 226 225 227
    5 216 210 204 212 220 214 222 208 216 210
    5 -1 0 -1 -2 1 0 -1 1 0 -1
    5 79950 79936 79942 79962 79954 79972 79960 79968 79924 79932

    Sample Output

    383 777 886
    Impossible
    111 112 113 114 115
    101 103 107 109 113
    -1 -1 0 0 1
    39953 39971 39979 39983 39989

    Source

    样例输入

    3 1269 1160 1663
    3 1 1 1
    5 226 223 225 224 227 229 228 226 225 227
    5 216 210 204 212 220 214 222 208 216 210
    5 -1 0 -1 -2 1 0 -1 1 0 -1
    5 79950 79936 79942 79962 79954 79972 79960 79968 79924 79932

    样例输出

    383 777 886
    Impossible
    111 112 113 114 115
    101 103 107 109 113
    -1 -1 0 0 1
    39953 39971 39979 39983 39989

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部