#include "iostream"
#include "math.h"
#include<stdlib.h>
using namespace std;
int main()
{
int TestCase;
cin >> TestCase;
while (TestCase--)
{
int s1, s2, ans1, ans2;
cin >> s1 >> s2;
if (s1 < s2)
cout << "impossible" << endl;
else if ((s1 + s2) % 2 == 1)//没有考虑到这种情况,所以WA了两次!因为分数都是10的!
cout << "impossible" << endl;
else
{
ans1 = (s1 + s2) / 2;
ans2 = abs(int(s1 - s2)) / 2;
if (ans1 > ans2)
cout << ans1 << " " << ans2 << endl;
else
cout << ans2 << " " << ans2 << endl;
}
}
}
zoj 2388 Beat the Spread!
最新推荐文章于 2021-11-15 22:00:48 发布