Exact a to the power b
Time limit1sMemory limit256 MB
Print the exact value of a to the power b for a decimal base without rounding or dropping digits.
- Level
Medium4 of 10
- Topics
- Implementation, Math, String
- Solved
- No attempts yet
Problem
You are given a real number and an integer . Write a program that computes exactly, with no rounding error.
The fractional part of has finitely many digits, so is also a finite decimal. Double precision floating point does not hold enough digits for it, so compute with integer arithmetic.
Input
The first line contains and , separated by a space. (, )
always contains a decimal point and has at most 9 digits after it. The last digit after the decimal point is not 0.
Output
Print the exact value of on the first line.
If has digits after the decimal point, the answer has exactly digits after the decimal point. Do not round, do not drop digits, and do not append extra zeros. When the integer part is 0, the line starts with 0..