Under construction

Still being built. Things may change

Cornhusker

Time limit1sMemory limit1024 MB

Summary
Given five ears' kernel rows and lengths, plus the ear count and kernel weight factor, the task prints the integer bushels per acre estimate.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Corn farmers estimate their yield before harvest to find the approximate number of bushels their farm will produce. The estimate shows whether they have enough grain bin storage or must store the corn elsewhere, such as at a co-op, which costs $$$. Farmers also use the estimate when they negotiate future corn prices. Estimates are usually made one or two months before harvest, when the ears have formed and most kernels are developed, which makes counting easier. According to the University of Nebraska-Lincoln, Nebraska Extension for Educators, the standard method estimates corn yield in bushels per acre. To simplify the calculation, it uses an area of 1/1000th of an acre. With 30" row spacing, that area is a section of one row about 17'5" long. Within that section, five ears are chosen at random. For each ear, count the kernels by multiplying the number of kernel rows around the ear by the number of kernels along its length. Add the five totals and divide by five to get the average kernels per ear. Multiply this average by the number of ears in the 17'5" section. This gives the total kernels in 1/1000th of an acre. Divide that total by the Kernel Weight Factor (KWF). The KWF depends on how wet or dry the growing season is and is typically between 75 (wet) and 95 (dry). The quotient is the number of bushels per acre the farmer can expect to harvest. For example, suppose the average number of kernels per ear is 512 (16 kernels around by 32 kernels long), there are 25 ears in the 17'5" row, and the KWF is 85. The farmer can expect: 25×51285 = 150 bushels\frac{25\times 512}{85}\ = \ 150\ bushels Since farmers are quite conservative in their estimates, all calculations are done as integers with no rounding.

Input

The input has two lines. The first line contains 10 space-separated integers, the number of kernels around (A) and the number of kernels long (L) for each of five ears of corn, where 8≤A≤248 \leq A \leq 24 and 20≤L≤5020 \leq L \leq 50. The second line contains two space-separated integers: the number of ears of corn N in the 17'5" row (10≤N≤5010 \leq N \leq 50) and the KWF (75≤KWF≤9575 \leq KWF \leq 95).

Output

Output a single integer, the estimated number of bushels of corn per acre the farmer can expect.

Examples3

  1. Example 1

    Input
    16 32 16 32 16 32 16 32 16 32
    25 85
    
    Expected output
    150
    
  2. Example 2

    Input
    14 30 15 32 15 34 14 34 16 32
    27 75
    
    Expected output
    172
    
  3. Example 3

    Input
    16 24 16 34 16 40 14 30 16 35
    28 95
    
    Expected output
    150