poj 2301(水题)

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

 

posted @ 2021-07-31 15:20  智人心  阅读(13)  评论(0)    收藏  举报