#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!
本文深入探讨了C++编程中位运算的使用及其在整数操作中的应用,通过实例展示了如何利用位操作提高代码效率。

1521

被折叠的 条评论
为什么被折叠?



