UVa 10812 Beat the Spread! (陷阱)2014-07-28 csdn博客 synapse7
10812 - Beat the Spread!
Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1753蛋碎了,被水题坑到了。。完整代码:
/*0.018s*/#include<cstdio>int main(){int t, s, d;scanf("%d", &t);while (t--){scanf("%d%d", &s, &d);if (s < d || (s + d) & 1) puts("impossible");else printf("%d %d
", (s + d) >> 1, (s - d) >> 1);}return 0;}