A blob of mass has discovered it has the ability to separate itself into parts an infinite number of times. However, the blob does not split into equal parts, but rather every part will contain % of the blob's mass. Each split creates more blobs which also split, meaning the number of blobs multiplies every split. If the original blob of mass splits into parts times, what is the mass of the smallest blob?
Note that if the masses of the final blobs were {1, 1, 2, 3}
the mass of the smallest blob would be 1.
Input Specifications
The first and line of input contains four space separated integers , , and . The restrictions on these integers are as follows:
- k will not exceed the number of distinct blobs.
The second and last line of input will contain integers, . It is guaranteed the sum of all will be .
Output Specifications
A single number representing the mass of the smallest blob. This value may be a decimal.
Sample Input
100 2 2 1
40 60
Sample Output
16
Comments