---
# System prepended metadata

title: k253. 庫存清理 (Stock)

---

# k253. 庫存清理 (Stock)
## 題目連結:[k253](https://zerojudge.tw/ShowProblem?problemid=k253)
## 解題想法
* 把每個區間分開算
* 會把包含的減掉0.0001(舉例: 0.8 --> 0.7999)，如此一來就不會把包含的一起扣掉了
## 程式碼
```python=
#input
total,ppl,price = map(int,input().split())

#80%~100%
if ppl -(total -  int(total *0.7999)) >= 0:
    a = (total -  int(total *0.7999))*int(price*0.5)
    ppl -= (total -  int(total *0.7999))
else:
    a = ppl*int(price*0.5)
    ppl = 0

#60%~80%
if ppl -(int(total*0.7999) -  int(total *0.5999)) >= 0:
    b = (int(total*0.7999) -  int(total *0.5999))*int(price*0.6)
    ppl -= (int(total*0.7999) -  int(total *0.5999))
else:
    b = ppl*int(price*0.6)
    ppl = 0

#40%~60%
if ppl -(int(total*0.5999) -  int(total *0.3999)) >= 0:
    c = (int(total*0.5999) -  int(total *0.3999))*int(price*0.8)
    ppl -= (int(total*0.5999) -  int(total *0.3999))
else:
    c = ppl*int(price*0.8)
    ppl = 0
#20%~40%
if ppl -(int(total*0.3999) -  int(total *0.1999)) >= 0:
    d = (int(total*0.3999) -  int(total *0.1999))*int(price*0.9)
    ppl -= (int(total*0.3999) -  int(total *0.1999))
else:
    d = ppl*int(price*0.9)
    ppl = 0


#output
a = int(a)
b = int(b)
c = int(c)
d = int(d)
print(a+b+c+d)
