Summer is coming , The electricity consumption of each household has increased a lot , The corresponding electricity bill also paid more . Xiaoyu's family received a notice of electricity charge today . According to the price of electricity in Fujian [2006]27 Regulation No , The monthly electricity consumption is 150 Kilowatt hours and below per kilowatt hour 0.4463 Yuan Executive , The monthly electricity consumption is 151~400 The part of kWh is per kWh 0.4663 Yuan Executive , The monthly electricity consumption is 401 Kilowatt hours and above per kilowatt hour 0.5663 Yuan Executive , Figure out how much electricity should be paid .
ElectricityConsumption=int(input())
ElectricStep=[150,400]
Price=[0.4463,0.4663,0.5663]
if(ElectricityConsumption<=150):
ElectricityBill=ElectricityConsumption*Price[0]
elif(151<=ElectricityConsumption<=400):
ElectricityBill=66.945+(ElectricityConsumption-ElectricStep[0])*Price[1]
else:
ElectricityBill=183.52+(ElectricityConsumption-ElectricStep[1])*Price[2]
print("%.1f"%ElectricityBill)
Self writing code , The problem stems from the valley of Los Angeles