#P7621. Discounted Purchase Calculation

    ID: 20814 Type: Default 1000ms 256MiB

Discounted Purchase Calculation

Discounted Purchase Calculation

Given that there are \( n \) types of goods, with each type \( i \) having a unit price \( a_i \) (in yuan) and quantity \( b_i \). The total cost is:

\( T = \sum_{i=1}^{n} (a_i \times b_i) \).

Then the total cost is discounted by 85% (i.e. multiplied by 0.85), and any amount less than one tenth (i.e. less than 0.1 yuan) is discarded. Formally, the final amount to be paid is:

\( Payment = \lfloor 0.85 \times T \times 10 \rfloor / 10 \),

where \( \lfloor x \rfloor \) denotes the floor function (i.e. rounding down to the nearest integer).

inputFormat

The first line contains a positive integer \( n \) representing the number of types of goods. Each of the following \( n \) lines contains two numbers \( a_i \) and \( b_i \) separated by a space, where \( a_i \) is the unit price and \( b_i \) is the quantity of the \( i^{th} \) good.

outputFormat

Output the final payment amount after applying the discount and truncating any amount less than 0.1 yuan. The result should be printed with one digit after the decimal point.

sample

1
100 1
85.0