2.10 英语翻译打卡

链接:Beat the Spread! | JXNUOJ

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    总分是负数
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值