#32923: cpp cccccccc0000000000000000000000000000000044444444444444444


yp11151025@yphs.tp.edu.tw (803-23江紘宇)

學校 : 臺北市私立延平高級中學
編號 : 196814
來源 : [203.72.178.1]
最後登入時間 :
2024-01-15 16:38:36
c004. 10812 - Beat the Spread! -- UVa10812 | From: [203.72.178.1] | 發表日期 : 2022-11-17 17:26

#include<iostream>
using namespace std;
int main(){
    int t,s,d;
    while(cin>>t){
    while(t--){
    cin>>s>>d;
        if(((s+d)&1) || s<d)
    cout<<"impossible"<<endl;
        else
    cout<<(s+d)/2<<" "<<(s-d)/2<<endl;
        }
    }
return 0;
}

 
ZeroJudge Forum