21139_BeattheSpread!

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

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

Pro.ID

21139

Title

Beat the Spread!

Title链接

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

AC

68

Submit

174

Ratio

39.08%

时间&空间限制

  • Time Limit: 0/0 MS (Java/Others)     Memory Limit: 0/0 K (Java/Others)
  • 描述

    Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores.

    Given the winning numbers for each type of bet, can you deduce the final scores?

    输入

    The first line of input contains n, the number of test cases. n lines follow, each representing a test case.

    Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.

    输出

    Description

    Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores.

    Given the winning numbers for each type of bet, can you deduce the final scores?

    Input

    The first line of input contains n, the number of test cases. n lines follow, each representing a test case.

    Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.

    Output

    For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.

    Sample Input

    2
    40 20
    20 40

    Sample Output

    30 10
    impossible

    Hint

    请无视本题。

    Source

    样例输入

    2
    40 20
    20 40

    样例输出

    30 10
    impossible

    提示

    请无视本题。


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部