Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <cstdio>
- using namespace std;
- int main(){
- int n, a, b, c, mm;
- cin >> mm >> n >> a >> b >> c;
- if (a > b)
- swap(a, b);
- if (b > c)
- swap(b, c);
- if (a > b)
- swap(a, b);
- if (mm == 2)
- cout << a << endl;
- else
- cout << ((a + b - n) > 0 ? (a + b - n) : 0) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement