summaryrefslogtreecommitdiff
path: root/10812/beat.c
diff options
context:
space:
mode:
Diffstat (limited to '10812/beat.c')
-rw-r--r--10812/beat.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/10812/beat.c b/10812/beat.c
new file mode 100644
index 0000000..58312fe
--- /dev/null
+++ b/10812/beat.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+int main(){
+ int tc;
+ scanf("%d", &tc);
+ while(tc--){
+ int s, d, s1, s2;
+ scanf("%d %d", &s, &d);
+
+ if(s < d || (s-d)%2!=0){
+ printf("impossible\n");
+ }
+ else{
+ s1 = (s-d)/2;
+ s2 = s1+d;
+ printf("%d %d\n", s2, s1);
+ }
+ }
+}