#13119: C++簡易參考解答


shawn2000100 (東華財金)

學校 : 國立東華大學
編號 : 57300
來源 : [27.53.168.5]
最後登入時間 :
2021-09-19 19:53:19

#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;
}