#K71322. Discounted Total Calculation

    ID: 33506 Type: Default 1000ms 256MiB

Discounted Total Calculation

Discounted Total Calculation

You are given a collection of item prices. First, compute the total sum of these prices and then apply the discount according to the following rules:

  • If \(100 \leq S \leq 200\), a discount of \(10\%\) is applied.
  • If \(S > 200\), a discount of \(20\%\) is applied.
  • If \(S < 100\), no discount is provided.

After applying the discount, output the final total cost rounded to two decimal places.

inputFormat

The input consists of two lines. The first line contains an integer \(n\) representing the number of items. The second line contains \(n\) space-separated integers, each representing the price of an item in dollars.

outputFormat

Print the final amount after applying the discount, formatted to exactly two decimal places.

## sample
5
30 20 50 40 10
135.00