immuntasir

2

Feb 11th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3. int T;
  4. scanf("%d",&T);
  5. while (T--) {
  6. int a,b;
  7. scanf("%d%d",&a,&b);
  8. int c = a+b;
  9. int d = a-b;
  10. if (b>a || (c%2) != 0 || (d%2) !=0) {
  11. printf("impossible\n");
  12. }
  13.  
  14. else {
  15. c = c/2;
  16. d = d/2;
  17. printf("%d %d\n",c,d);
  18. }
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment