您的位置:首页 > 其它

UVa 10812 Beat the Spread!

2014-05-29 22:44 441 查看
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

int main()
{
int n;
int s, d;
scanf("%d", &n);
while (n-- > 0)
{
scanf("%d%d", &s, &d);
if (s < d || (s + d) & 1)
{
printf("impossible\n");
}
else
{
printf("%d %d\n", (s + d) >> 1, (s - d) >> 1);
}
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  uva