This page is still under construction.

Parts of this page are still being built. What you see may change.

Exact a to the power b

Time limit1sMemory limit256 MB

Summary
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 aa and an integer bb. Write a program that computes aba^b exactly, with no rounding error.

The fractional part of aa has finitely many digits, so aba^b 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 aa and bb, separated by a space. (0<a<1000 < a < 100, 1≤b≤1001 \le b \le 100)

aa 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 aba^b on the first line.

If aa has kk digits after the decimal point, the answer has exactly k×bk \times b 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..

Examples3

  1. Example 1

    Input
    3.141592 3
    
    Expected output
    31.006257328285746688
    
  2. Example 2

    Input
    0.1 10
    
    Expected output
    0.0000000001
    
  3. Example 3

    Input
    1.01 5
    
    Expected output
    1.0510100501