题干:

 

Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute difference between the two scores. 
Given the winning numbers for each type of bet, can you deduce the final scores? 

Input

The first line of input contains n, the number of test cases. n lines follow, each representing a test case. Each test case gives s and d, non-negative integers representing the sum and (absolute) difference between the two final scores.

Output

For each test case, output a line giving the two final scores, largest first. If there are no such scores, output a line containing "impossible". Recall that football scores are always non-negative integers.

Sample Input

2
40 20
20 40

Sample Output

30 10
impossible

题目大意:

   就是说有俩数x和y,现在告诉你    这两个数的和a、这两个数的差的绝对值b。  问你能否构造出这两个数,如果没有符合条件的解,输出-1,如果有,就从大到小输出x和y。

解题报告:

   水题啊,找个规律,发现如果加和为奇数的话,,肯定是不满足的啊(证明我也没细想,反正写出来之后小范围测试了一下没啥问题就交了)

AC代码:

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<set>
#include<string>
#include<cmath>
#include<cstring>
#define ll long long
#define pb push_back
#define pm make_pair
#define fi first
#define se second
using namespace std;
const int MAX = 2e5 + 5;
ll a,b;
int main()
{
	int t;
	cin>>t;
	while(t--) {
		scanf("%lld%lld",&a,&b);
		if(a<b) {
			puts("impossible");continue;
		}
		ll ans1 = (a+b)>>1;
		if(ans1*2 != (a+b)) {
			puts("impossible");continue;
		}
		ll ans2 = a-ans1;
		if(ans1 < ans2) swap(ans1,ans2);
		printf("%lld %lld\n",ans1,ans2);
	}
	return 0 ;
 }