#K33557. Update Credit Balances
Update Credit Balances
Update Credit Balances
You are given the task of updating the credit balances for a set of customers. For each customer with a balance \(b_i\), if \(b_i \ge m\) (where \(m\) is a given threshold), the balance is increased by \(p\)% (i.e. the new balance becomes \(b_i + \frac{p}{100} \cdot b_i\)). Otherwise, the balance remains unchanged. The resulting balances must be printed, each formatted to exactly two decimal places.
Input: The first line contains three integers \(n\), \(m\), and \(p\), representing the number of customers, the threshold balance, and the percentage increase, respectively. The second line contains \(n\) integers representing the initial balances of the customers.
Output: Output \(n\) lines, each containing the updated balance for a customer formatted to two decimal places.
Constraints: It is guaranteed that the input values are such that calculations can be performed using standard floating-point arithmetic.
inputFormat
The input is read from stdin
and consists of two lines:
- The first line contains three space-separated integers \(n\), \(m\), and \(p\).
- The second line contains \(n\) space-separated integers representing the initial balances.
outputFormat
Print \(n\) lines to stdout
. Each line should contain the updated balance formatted to exactly two decimal places.
5 100 10
90 100 110 140 80
90.00
110.00
121.00
154.00
80.00
</p>