Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. double ma[2100], ans;
  4. double mi[2100];
  5. int a, b, c;
  6. int main()
  7. {
  8. double m[71] = {0, 22, 44, 64.33, 84.67, 105, 124, 143, 162, 181, 200, 218, 236, 254, 272, 290, 308, 326, 344,
  9. 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,
  10. 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,
  11. 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,
  12. 863.5, 862, 860.5, 859, 857.5, 856, 854.5, 853, 851.5, 850};
  13. cin >> a >> b >> c;
  14. ans = 1000000000;
  15. for (int i = 1; i <= 70; i++) {
  16. ma[i] = m[i] * 100;
  17. mi[i] = ma[i];
  18. }
  19. for (int i = 71; i <= 2012; i++) {
  20. ma[i] = ma[i - 1] + 1571;
  21. mi[i] = ma[i];
  22. }
  23. for (int i = 70; i >= 59; --i) {
  24. mi[i] = 85000;
  25. }
  26. for (int i = 0; i <= 2 * c; i++){
  27. double f = mi[b + i] + mi[a + 2 * c - i];
  28. if (mi[b + i] != 0) f += 1000;
  29. if (mi[a + 2 *c - i] != 0) f += 1000;
  30. double s = mi[a + i] + mi[b + 2*c - i];
  31. if (mi[a + i] != 0) s += 1000;
  32. if (mi[b + 2 * c - i] != 0) s += 1000;
  33. ans = min(ans, min(s, f));
  34. }
  35. cout << fixed << setprecision(4) << double(ans / 100);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement