JDCC '16 Contest 5 P2 - Scientific Notation

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

When working with numbers that are really big, it is common to use scientific notation to shorten their representation. In scientific notation, numbers are written in the form: \displaystyle  M \times 10^N

Where M is a decimal number between 1.00 and 9.99, which we will always round to two decimal places, and N is an integer. For example:

\displaystyle  987 = 9.87 \times 10^2 \displaystyle  1209 = 1.21 \times 10^3

We can also convert numbers out of scientific notation, rounding if needed. For example:

\displaystyle  1.21 \times 10^3 = 1210 \displaystyle  9.87 \times 10^1 = 99

Given a number in either decimal notation or scientific notation, convert the number to its alternate form.

Input

Each test case contains one number N (1 \le N \le 10^9) represented either in decimal or scientific notation. N is guaranteed to fit in a 32-bit integer.

Output

For each test case, output N in scientific notation if N is in decimal notation or output N in decimal notation if it is in scientific notation.

Sample Input

987

Sample Output

9.87 * 10^2

Sample Input

1.21 * 10^3

Sample Output

1210

Comments

There are no comments at the moment.