Submit solution
Points:
3
Time limit:
2.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Java
In mathematics, there is a very special constant that can help with calculating exponents. The constant , which is approximately
can calculate
using the formula
. Using the following Java methods, use
to calculate an exponent, then use
Math.pow
to calculate it again.
Math.exp(double) // Raises the constant e to the power of the given double.
Math.log(double) // Gives the natural logarithm of the given double.
Input
The first line of input contains
.
The next line of input contains
.
Output
On the first line, output the calculated value of using the formula
.
On the next line, output the value of using the
Math.pow
method.
Sample Input
7
5
Sample Output
16806.99999999998
16807.0
Comments