Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int T;
- scanf("%d",&T);
- while (T--) {
- int a,b;
- scanf("%d%d",&a,&b);
- int c = a+b;
- int d = a-b;
- if (b>a || (c%2) != 0 || (d%2) !=0) {
- printf("impossible\n");
- }
- else {
- c = c/2;
- d = d/2;
- if (c>d) {
- printf("%d %d\n",c,d);
- }
- else {
- printf("%d %d\n",d,c);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment