UVa 10812 - Beat the Spread!

时间:2023-03-09 08:18:39
UVa 10812 - Beat the Spread!

  题目大意:知道一场橄榄球比赛比分的和以及差的绝对值,算出这两个数。注意判断结果的可能性(比分为非负数)。

 #include <cstdio>

 int main()
{
#ifdef LOCAL
freopen("in", "r", stdin);
#endif
int n;
scanf("%d", &n);
int s, d, a, b;
while (n--)
{
scanf("%d%d", &s, &d);
if (s < d || (s+d)%)
{
printf("impossible\n");
continue;
}
a = (s+d) / ;
b = s - a;
printf("%d %d\n", a, b);
}
return ;
}