From the 1996 UF ACM High School Programming Competition

Whoa, big!

There are lots of big numbers all around us. For example, there are around 602,204,500,000,000,000,000,000 molecules in a mere eighteen grams of water. The Andromeda galaxy, the nearest to our own, lies about 1,470,000,000,000,000,000 miles away.

Unfortunately, your bank balance does not rank among these large numbers. Every little job, even figuring out something silly like how many feet deep Florida would be in silver dollars, can help. So when a group of scientists approach you about exactly that, you happily agree...

Problem Statement

Write a program to illustrate the magnitude of a number N, where N is a large real number given in scientific notation. Calculate, to the nearest integer, how many feet deep a pile of N silver dollars covering the state of Florida would be.

Assume that Florida has 58,560 square miles of land, while a silver dollar is 1/2 inches in diameter and 3/32 inch in thickness. Also assume that the silver dollars will be stacked neatly in columns placed edge-to-edge (see figure above).

Notes

Numbers will be given in scientific notation with E denoting the exponant. The input 1.54E21 would be the number 1.54 x 10^21.

The example's number is intentionally incorrect.

You can assume that the number of feet deep is less than 30,000 and greater than zero.

Fractional values of .5 are rounded up.

Examples

Enter a huge number: 1.54E21
Florida would be piled be 13 feet deep in 1.5400e+21 silver dollars.

Grader's Test Data

Enter a huge number: 1.47E18
Florida would be piled 1319 feet deep in 1.470000e+18 silver dollars.

Enter a huge number: 1.11e15
Florida would be piled 1 foot deep in 1.110000e+15 silver dollars.

Enter a huge number: 7e16
Florida would be piled 63 feet deep in 7.000000e+16 silver dollars.

Enter a huge number: 6.022e18
Florida would be piled 5403 feet deep in 6.022000e+18 silver dollars.


The answers above are incorrect. If memory serves, they're off by a factor of 12, and so is the solution.

Solutions

C solution by Jason Riedy:
silver.c