Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define fr ifrst
- #define sc second
- #define pb push_back
- #define mk make_pair
- #define sz(s) s.size()
- #define all(s) s.begin(),s.end()
- #define ll long long
- using namespace std;
- const int N = 1e5 + 7;
- const int inf = 1e9 + 7;
- int n, a, b;
- main() {
- cin >> n >> a >> b;
- ll ans = 0;
- while (a || b){
- int t1 = 0, t2 = 0;
- if (b){
- t1 = min(b, n);
- }
- if (a){
- t2 = min(a, n - t1);
- }
- a -= t2;
- a += t1;
- b -= t1;
- ans += 20;
- }
- ans -= 10;
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement