Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int32_t main() {
- double p, q, ans = 0;
- cin >> p >> q;
- int n;
- cin >> n;
- while(n--){
- int x; cin >> x;
- double pr_ans = x;
- pr_ans += max(q, floor(p * x) / 100);
- ans += pr_ans;
- }
- cout.precision(2);
- cout << fixed << ans << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment