#39936: 問個問題


litai0928705308@gmail.com (高麗菜)

學校 : 不指定學校
編號 : 231483
來源 : [111.246.31.195]
最後登入時間 :
2024-04-14 22:08:56
f375. 神奇肥料 Fertilizer -- TOI 練習賽202010新手組3 | From: [111.246.31.195] | 發表日期 : 2024-04-13 19:50

s, e, a = map(int, input().split())
for i in range(a*11):
    #print(i+1,s) #test
    if s >= e:
        print(i+1)
        break

    if (i+1)%9 == 0 or (i+1)%10 == 0: #take rest
        continue

    elif (i+1)%11 == 0: #unsalable
        if s > e: (這裡如果這樣寫10 10 1的側資,會輸出0行為甚麼?)(我知道 s < e 才是對的)
            a-=1
            if a == 0:
                print("unsalable")
                break
        s += s//10    
        continue
 
    elif (i+1)%3 == 0: #use fertil
        s += s//3

    else: #normal water
        s += s//10
# 10 10 1 error
 
ZeroJudge Forum