Advertisement
Guest User

A

a guest
Feb 27th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define fr ifrst
  4. #define sc second
  5. #define pb push_back
  6. #define mk make_pair
  7. #define sz(s) s.size()
  8. #define all(s) s.begin(),s.end()
  9. #define ll long long
  10.  
  11. using namespace std;
  12.  
  13. const int N = 1e5 + 7;
  14. const int inf = 1e9 + 7;
  15.  
  16. int n, a, b;
  17.  
  18. main() {
  19.     cin >> n >> a >> b;
  20.     ll ans = 0;
  21.     while (a || b){
  22.         int t1 = 0, t2 = 0;
  23.         if (b){
  24.             t1 = min(b, n);
  25.         }
  26.         if (a){
  27.             t2 = min(a, n - t1);
  28.         }
  29.         a -= t2;
  30.         a += t1;
  31.         b -= t1;
  32.         ans += 20;
  33.     }
  34.     ans -= 10;
  35.     cout << ans;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement