fork download
  1. #include<stdio.h>
  2. int a[4], b[4],ans[4];
  3. int main() {
  4. for (int i = 0; i < 4; i++)scanf("%d%d", &a[i], &b[i]);
  5. for (int i = 3; i > 0; i--)ans[i] = b[i] - a[i], a[i - 1] -= b[i] - a[i];
  6. for (int i = 1; i < 4; i++)printf("%d\n", ans[i]);
  7. return 0;
  8. }
Success #stdin #stdout 0s 4172KB
stdin
1 2
1 1
1 1
1 2
stdout
1
1
1