Discount Dash
Rohan is shopping and wants to make the most of the store's sale. The store offers a special discount: if an item's price is ₹500 or more, it gets a 10% discount. Otherwise, it gets a flat ₹50 discount. Rohan wants to know the total amount he has to pay after all discounts are applied. Help Rohan calculate his final bill!
Input
The first line contains an integer N, the number of items Rohan is buying. The next N lines each contain a single integer, the original price of an item.
Output
Print a single integer, the total amount Rohan has to pay.
Constraints
1 <= N <= 1000. Each item price will be between 1 and 10000.
Example 1
3 600 400 500
1340
Item 1 (600) gets 10% off (540). Item 2 (400) gets 50 off (350). Item 3 (500) gets 10% off (450). Total = 540 + 350 + 450 = 1340.
Example 2
2 100 900
860
Item 1 (100) gets 50 off (50). Item 2 (900) gets 10% off (810). Total = 50 + 810 = 860.
Hints
# Read the input from stdin and print the answer.
import sys
def main():
data = sys.stdin.read().split()
# your code here
main()
3 600 400 500
2 100 900