#PCBBAY0000016. Precision động theo dữ liệu vào (Dynamic Decimal Precision)
Precision động theo dữ liệu vào (Dynamic Decimal Precision)
Dynamic Decimal Precision
Version: Phuoc Hung OJ Extended
Problem Statement
Given a real number and an integer , print in fixed-point notation with exactly digits after the decimal point. When , print no decimal point.
Input
The only line contains a real number and integer , separated by whitespace.
Output
Print with exactly decimal places; omit the decimal point when .
Subtasks
- Subtask 1 (100 points): and .
Examples
Example 1
Input
3.1415926 4
Output
3.1416
Explanation. For input 3.1415926 4, applying .4f formatting produces exactly 3.1416 (including any trailing zeros, separators or exponent characters).
Example 2
Input
12.5 0
Output
12
Explanation. For input 12.5 0, applying .0f formatting produces exactly 12 (including any trailing zeros, separators or exponent characters).
Example 3
Input
-0.00456 5
Output
-0.00456
Explanation. For input -0.00456 5, applying .5f formatting produces exactly -0.00456 (including any trailing zeros, separators or exponent characters).