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.
第一行输入n,测试数据的组数,接着输入n行,每行代表一组测试数据。每行给两个数s,d,s表示两支队伍的sum总分,d表示difference分差。
输出:
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.
对于每组测试数据,先输出总分更大的那个。如果不满足条件,则输出impossible.已知每支队伍的分数不能是负的。
2 40 20 20 40
样例输出:
30 10 //30+10=40 30-10=20 impossible 总分是负数