Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int t,s,d,x,y;
  5. scanf("%d",&t);
  6. while(t--)
  7. {
  8. scanf("%d%d",&s,&d);
  9. if(0<s&&0<d)
  10. {
  11. x=(s+d)/2;
  12. y=(s-d)/2;
  13. if(0>x||0>y)
  14. {
  15. printf("Impossible");
  16. }
  17. else
  18. {
  19. printf("%d %d\n",x,y);
  20. }
  21. }
  22.  
  23.  
  24. }
  25. return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement