fork download
  1. #include <stdio.h>
  2.  
  3. #define max(a, b) ((a) > (b) ? (a) : (b))
  4.  
  5. int main(void)
  6. {
  7. int a, b, c;
  8. int n;
  9.  
  10. scanf("%d %d %d", &a, &b, &c);
  11. scanf("%d", &n);
  12.  
  13. printf("%d %d %d\n", max(0, n - a), max(0, 2 * n - b), max(0, 3 * n - c));
  14.  
  15. return (0);
  16. }
  17.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty