OJ-Problems-Source/HDOJ/1194_autoAC.cpp

16 lines
323 B
C++
Raw Normal View History

2016-08-13 10:51:15 +08:00
#include <stdio.h>
int main ()
{
int n,s,d;
scanf ("%d",&n);
while (n--)
{
scanf ("%d%d",&s,&d);
if ((s+d)%2==0&&(s-d)%2==0&&(s+d)/2>=0&&(s-d)/2>=0)
printf ("%d %d",(s+d)/2,(s-d)/2);
else printf ("impossible");
printf ("\n");
}
return 0;
}