ProgMe

Untitled

Nov 28th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int32_t main() {
  6. double p, q, ans = 0;
  7. cin >> p >> q;
  8. int n;
  9. cin >> n;
  10. while(n--){
  11. int x; cin >> x;
  12. double pr_ans = x;
  13. pr_ans += max(q, floor(p * x) / 100);
  14. ans += pr_ans;
  15. }
  16. cout.precision(2);
  17. cout << fixed << ans << '\n';
  18. }
Advertisement
Add Comment
Please, Sign In to add comment