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 10812 Beat the Spread! (陷阱)
- HDU1194 POJ2301 UVA10812 ZOJ2388 Beat the Spread!【数学】
- UVa 10812 - Beat the Spread!
- UVa 10812 - Beat the Spread!
- UVa 10812 - Beat the Spread!
- 10812 - Beat the Spread!
- [结题报告]10812 - Beat the Spread! Time limit: 3.000 seconds
- 10812 - Beat the Spread!
- 杭电1194-Beat the Spread
- HDU 1194 Beat the Spread!
- hdu1194-Beat the Spread!
- HDOJ1194 Beat the Spread!
- HDOJ 1194 Beat the Spread!
- zoj 2388.Beat the Spread!
- Beat the Spread!
- HOJ 2100 Beat the Spread!
- ZOJ2388 Beat the Spread!
- 1194:Beat the Spread!
- 杭电ACM1194——Beat the Spread!
- HDOJ 1194 Beat the Spread!(简单题)