#P1422. 小玉家的电费

小玉家的电费

Xiaoyu's Electricity Bill

Problem Source

Luogu P1422

Problem Description

Summer is here, and every household is using far more electricity — and paying far more for it. Xiaoyu's family received an electricity bill today. It reads: according to the regulation Min Dian Jia [2006] No. 27, the tiered pricing is as follows:

  • For the portion of monthly usage up to and including 150150 kWh: 0.44630.4463 yuan per kWh;
  • For the portion between 151151 and 400400 kWh: 0.46630.4663 yuan per kWh;
  • For the portion of 401401 kWh and above: 0.56630.5663 yuan per kWh.

Xiaoyu wants to check whether the billed amount is correct. Write a program that, given the total electricity used, computes the bill according to these rates.

Input Format

The input is a single positive integer: the total electricity used (in kWh), not exceeding 1000010000.

Output Format

Output one number, kept to 1 decimal place (in yuan, kept to 1 decimal place).

Sample Input

267

Sample Output

121.5

Hint

  • The three tiers are additively accumulated: each tier only charges for the part of the usage that falls within that tier's band — you do not compute the whole usage at a single tier's rate.
  • First break the sample down on paper (how does 267 kWh split into two bands?) before writing code.
  • Keep 1 decimal place.