LogiQuest

359. Shopping Cart Total

EasyArithmetic

Items have price and quantity. If the subtotal is at least ₹1000, apply a 10% discount. Then add 5% tax. Print the final amount with 2 decimals.

Input format

Line 1: n Next n lines: price qty

Output format

The final amount.

Example 1

Input

2
250 2
100 3

Output

840.00

Example 2

Input

3
400 1
300 1
300 1

Output

945.00

Constraints

1 ≤ n ≤ 1000

Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.

Loading the MyLoginn IDE…