Problem E
Pete's Power Problem
Pete, the highly anthropomorphized baby processor, has always wanted a superpower. Super-precise power calculation powers, to be exact. Unfortunately, he has found that too many programs cut (well, truncate) his significant figures! He thinks all the numbers between $0$ and $100$ should be allowed to have their powers reported as is, with all digits included. (It’s sort of the principle of the thing, but he doesn’t know how to count above $100$ yet).
Your task? Create a program that can compute the exact value of $B^x$.
Input
The input consists of the real number $B$ ($0 < B < 100$), followed by the integer $x$ ($1 \leq x \leq 25$). $B$ contains at most $4$ digits after the decimal point and will be given in the same format as the output.
Output
Print the exact value of $B^x$. You must print it in the following format:
-
If $B^x < 1$, print it in the form $0.f$.
-
If $B^x$ is an integer, print it in the form $i$ without leading zeros.
-
If $B^x > 1$ and is not an integer, print it in the form $i.f$ without leading or trailing zeros.
In all of the above cases, $i$ and $f$ must be a number consisting of the digits $0$-$9$. Take care not to accidentally print the answer scientific notation.
Sample Input 1 | Sample Output 1 |
---|---|
3.1415 1 |
3.1415 |
Sample Input 2 | Sample Output 2 |
---|---|
3.1415 2 |
9.86902225 |
Sample Input 3 | Sample Output 3 |
---|---|
3.1415 25 |
2681801326766.3400395160303701562931688365295885588394517117755219903514950718245223400022258294522762298583984375 |
Sample Input 4 | Sample Output 4 |
---|---|
0.0001 25 |
0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 |
Sample Input 5 | Sample Output 5 |
---|---|
10 10 |
10000000000 |