Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cargo_count = int(input())
- total_cargo = 0
- total_price = 0
- bus = 0
- truck = 0
- train = 0
- for i in range(cargo_count):
- cargo_weight = int(input())
- total_cargo += cargo_weight
- if cargo_weight <= 3:
- total_price += cargo_weight * 200
- bus += cargo_weight
- elif 4 <= cargo_weight <= 11:
- total_price += cargo_weight * 175
- truck += cargo_weight
- elif cargo_weight >= 12:
- total_price += cargo_weight * 120
- train += cargo_weight
- print(f"{(total_price / total_cargo):.2f}")
- print(f"{(bus / total_cargo * 100):.2f}%")
- print(f"{(truck / total_cargo * 100):.2f}%")
- print(f"{(train / total_cargo * 100):.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment