#S0010. 快递费用计算器
快递费用计算器
1. Description
Create a shipping cost calculator. Input package weight (kg) and destination zone (1-5), calculate fee based on:
- Zone1: 10元 base (≤3kg) + 2元/kg extra
- Zone2: 15元 base (≤3kg) + 3元/kg extra
- Zone3: 20元 base (≤5kg) + 4元/kg extra
- Zone4: 25元 base (≤5kg) + 5元/kg extra
- Zone5: 30元 base (≤10kg) + 6元/kg extra Output "Invalid input" for invalid zone or weight≤0
2. Input & Output
Input:
- Two values separated by space (weight zone)
data = input().split()
weight = float(data[0])
zone = int(data[1])
Output:
- Shipping cost (1 decimal) or error message
Example
# Input:
2.5 1
# Output:
10.0
# Input:
7 5
# Output:
30.0