Advertisement
erfanul007

UVa 10812

Apr 14th, 2021
629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     unsigned int n,i,x,y,s;
  5.     scanf("%u",&n);
  6.     for(i=1;i<=n;i++){
  7.         scanf("%u %u",&x,&y);
  8.         s=x+y;
  9.         if(x<y || s%2!=0)
  10.             printf("impossible\n");
  11.         else{
  12.             x=s/2;
  13.             y=x-y;
  14.             printf("%d %d\n",x,y);
  15.  
  16.         }
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement