-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathหมอบกู๋.py
30 lines (30 loc) · 982 Bytes
/
หมอบกู๋.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""หมอบกู๋"""
def main():
"""หาราคาที่จ่ายและร้านที่ไปซื้อข้าวกะเพราหมูกรอบไช่ดาว"""
budget = float(input())
iso = 0
restau = 1
lowcost = 0
lowrest = 1
while iso < 50:
cost = float(input())
if iso == 5 or iso == 10 or iso == 15 or iso == 20 or iso == 25 or \
iso == 30 or iso == 35 or iso == 40 or iso == 45:
restau = restau + 1
iso += 1
if lowcost == 0:
lowcost = cost
lowrest = restau
if cost <= lowcost:
if cost == lowcost:
pass
else:
lowcost = cost
lowrest = restau
if budget >= cost:
print("%.2F\n%d" %(cost, restau))
break
if iso == 50:
print("%.2F\n%d" %(lowcost, lowrest))
break
main()