Promi_38

cf 991A

Jan 12th, 2021
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     int a, b, c, n;
  6.     scanf("%d %d %d %d", &a, &b, &c, &n);
  7.    
  8.     if(a < c || b < c) printf("-1\n");
  9.     else if(n > a + b - c) printf("%d\n", n - (a + b - c));
  10.     else printf("-1\n");
  11. }
Advertisement
Add Comment
Please, Sign In to add comment