Advertisement
Saleh127

Untitled

Apr 25th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6. int a,b,c,d,s,n,t,i,j,k;
  7. cin>>t;
  8. while(t--)
  9. {
  10. cin>>s>>d;
  11. if((s+d)%2==0 && s>=d)
  12. {
  13. a=(s+d)/2;
  14. b=s-a;
  15. cout<<max(a,b)<<" "<<min(a,b)<<endl;
  16. }
  17. else cout <<"impossible\n";
  18.  
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement