SHARE
TWEET

Untitled

a guest Nov 9th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <iostream>
  3. #include <string>
  4. #include <cmath>
  5. #include <algorithm>
  6. #include <vector>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int p, r, v;
  12.     vector <unsigned long long> k(4);
  13.     cin >> v >> p >> r;
  14.    
  15.     for (int i = 0; i < 4; i++) cin >> k[i];
  16.    
  17.     if (16000 < v) {
  18.         k[3] += (v-16000)*p;
  19.         if (v*r > k[3]) cout << 4;
  20.     }
  21.     else if (8000 < v) {
  22.         k[2] += (v-8000)*p;
  23.         if (v*r > k[2]) cout << 3;
  24.     }
  25.     else if (4000 < v){
  26.         k[1] += (v-4000)*p;
  27.         if (v*r > k[1]) cout << 2;
  28.     }
  29.     else if (2000 < v){
  30.         k[0] += (v-2000)*p;
  31.         if (v*r > k[0]) cout << 1;
  32.     }
  33.     else cout << v*r;
  34.  
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top