poj 2301(水题)

#include<iostream>
using namespace std;
int main(){
    int a,b,n,c,d;
    scanf("%d",&n);
    while(n--){
        scanf("%d%d",&a,&b);
        if((a+b)%2==1||a<b){
            printf("impossible\n");
            continue;
        }
        c = (a+b)/2;
        d = (a-b)/2;
        printf("%d %d\n",c,d);
    }
    return 0;
}

 

posted @ 2021-11-18 18:25  智人心  阅读(23)  评论(0)    收藏  举报