giabinh

UncowedForces

Dec 1st, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define fto(i, l, r) for (int i=l; i<=r; ++i)
  4.  
  5. using namespace std;
  6.  
  7. int hs, hu, m[8], w[8], ans = 0;
  8. int d[] = {0, 500, 1000, 1500, 2000, 2500};
  9. float s[8];
  10.  
  11. int main() {
  12.     #ifndef ONLINE_JUDGE
  13.         freopen("UncowedForces.inp", "r", stdin);
  14.     #endif // ONLINE_JUDGE
  15.  
  16.     fto(i, 1, 5) scanf("%d", &m[i]);
  17.     fto(i, 1, 5) scanf("%d", &w[i]);
  18.     scanf("%d%d", &hs, &hu);
  19.  
  20.     fto(i, 1, 5)
  21.     {
  22.         float tmp = 0.3 * d[i];
  23.         float _tmp = (1 - m[i]/250) * d[i] - 50 * w[i];
  24.         cout << tmp << " " << _tmp << endl;
  25.         if (tmp > _tmp) s[i] = tmp; else s[i] = _tmp;
  26.     }
  27.     fto(i, 1, 5) cout << s[i] << " "; cout << endl;
  28.  
  29.     fto(i, 1, 5) ans += (int) s[i];
  30.     ans += 100 * hs - 50 * hu;
  31.  
  32.     cout << ans;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment