#PCBBAY0000037. Lãi đơn và định dạng cuối (Simple Interest with Final Formatting)
Lãi đơn và định dạng cuối (Simple Interest with Final Formatting)
Simple Interest with Final Formatting
Version: Phuoc Hung OJ Extended
Problem Statement
An initial principal earns simple interest at rate per period for periods. Every period’s interest is calculated on the original principal, not on accumulated interest. The final amount is . Print with exactly 2 decimal places.
Input
The only line contains three real values , , : principal, rate per period and number of periods.
Output
Print the amount after periods with exactly 2 decimal places.
Subtasks
- Subtask 1 (100 points): ; ; .
Examples
Example 1
Input
1000 0.05 2
Output
1100.00
Explanation. Substituting 1000, 0.05, 2 into P × (1 + r × t) gives approximately 1100. The required output formatting produces 1100.00.
Example 2
Input
1234.56 0.0375 3
Output
1373.45
Explanation. Substituting 1234.56, 0.0375, 3 into P × (1 + r × t) gives approximately 1373.448. The required output formatting produces 1373.45.
Example 3
Input
0 0.1 10
Output
0.00
Explanation. Substituting 0, 0.1, 10 into P × (1 + r × t) gives approximately 0. The required output formatting produces 0.00.