Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. double ma[2100], ans, mi[2100];
  4. int a, b, c;
  5. int main()
  6. {
  7. double m[71] = {0, 22, 44, 64.33, 84.67, 105, 124, 143, 162, 181, 200, 218, 236, 254, 272, 290, 308, 326, 344,
  8. 362, 380, 392.13, 404.25, 416.38, 428.5, 440.63, 452.75, 464.88, 477, 489.13, 501.25, 513.38, 525.5,
  9. 537.63, 549.75, 561.88, 574, 586.13, 598.25, 610.38, 622.5, 634.63, 646.75, 658.88, 671, 683.13, 695.25,
  10. 707.38, 719.5, 731.63, 743.75, 755.88, 768, 780.13, 792.25, 804.38, 816.5, 828.63, 840.75, 852.88, 865,
  11. 863.5, 862, 860.5, 859, 857.5, 856, 854.5, 853, 851.5, 850};
  12. cin >> a >> b >> c;
  13. ans = 1000000000;
  14. for (int i = 1; i <= 70; i++) {
  15. ma[i] = m[i];
  16. mi[i] = ma[i];
  17. }
  18. for (int i = 71; i <= 2012; i++) {
  19. ma[i] = ma[i - 1] + 15.71;
  20. mi[i] = ma[i];
  21. }
  22. for (int i = 70; i >= 59; --i) {
  23. mi[i] = 850;
  24. }
  25. for (int i = 0; i <= 2 * c; i++){
  26. double f = mi[b + i] + mi[a + 2 * c - i];
  27. if (mi[b + i] != 0) f += 10;
  28. if (mi[a + 2 *c - i] != 0) f += 10;
  29. double s = mi[a + i] + mi[b + 2*c - i];
  30. if (mi[a + i] != 0) s += 10;
  31. if (mi[b + 2 * c - i] != 0) s += 10;
  32. ans = min(ans, min(s, f));
  33. }
  34. cout << fixed << setprecision(4) << ans;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement