Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 03. Logistics
- cargo = int(input())
- ton_van = 0
- ton_tir = 0
- ton_train = 0
- all_tons = 0
- for i in range(1, cargo + 1):
- ton = int(input())
- if ton <= 3:
- ton_van += ton
- all_tons += ton
- elif ton >= 4 and ton <= 11:
- ton_tir += ton
- all_tons += ton
- elif ton >= 12:
- ton_train += ton
- all_tons += ton
- price_van = ton_van * 200
- price_tir = ton_tir * 175
- price_train = ton_train * 120
- procent_ton = (price_tir + price_train + price_van) / all_tons
- procent_van = (ton_van / all_tons) * 100
- procent_tir = (ton_tir / all_tons) * 100
- procent_train = (ton_train / all_tons) * 100
- print(f"{procent_ton:.2f}")
- print(f"{procent_van:.2f}%")
- print(f"{procent_tir:.2f}%")
- print(f"{procent_train:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement