e969. 3. 大吃大喝 (Big eater)
Tags :
Accepted rate : 830人/912人 ( 91% ) [非即時]
評分方式:
Tolerant

最近更新 : 2020-04-02 14:14

Content

題目:https://toi-reg.csie.ntnu.edu.tw/question/201903/B3-BigEater(Q).pdf

Wayne 是個饕客兼大胃王,而他最喜歡的食物就是麥噹噹的蘋果派和玉米濃湯,因此他決定要把口袋裡所有錢通通拿來吃 32 元的蘋果派和 55 元的大杯玉米濃湯。他最愛的吃法就是蘋果派與玉米濃湯交替著吃,也就是說若無法形成交替則不繼續進食,這是 Wayne 的堅持。請你幫忙寫程式列印出他大吃大喝的過程。

Input

 輸入總共有三個整數,以空白隔開。第一個整數 N ( 0 ≤ N ≤ 500 )為 Wayne 總共帶了多少錢,第二個整數 M ( 0 < M ≤ 60 )為他每隔幾分鐘進食一次,第三個 整數 K = 0 的話代表從蘋果派開始吃,K = 1 的話則代表從玉米濃湯開始。

Output

 每筆輸出包含經過時間、吃的食物與剩餘金額,請參考範例輸出。

Sample Input #1
65 5 0
Sample Output #1
0: Wayne eats an Apple pie, and now he has 33 dollars.
Sample Input #2
143 18 1
Sample Output #2
0: Wayne drinks a Corn soup, and now he has 88 dollars.
18: Wayne eats an Apple pie, and now he has 56 dollars.
36: Wayne drinks a Corn soup, and now he has 1 dollar.
Sample Input #3
55 1 1
Sample Output #3
0: Wayne drinks a Corn soup, and now he doesn't have
money.
Sample Input #4
31 10 0
Sample Output #4
Wayne can't eat and drink.
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (5%): 1.0s , <1K
公開 測資點#1 (5%): 1.0s , <1K
公開 測資點#2 (5%): 1.0s , <1K
公開 測資點#3 (5%): 1.0s , <1K
公開 測資點#4 (5%): 1.0s , <1K
公開 測資點#5 (5%): 1.0s , <1K
公開 測資點#6 (5%): 1.0s , <1K
公開 測資點#7 (5%): 1.0s , <1K
公開 測資點#8 (5%): 1.0s , <1K
公開 測資點#9 (5%): 1.0s , <1K
公開 測資點#10 (5%): 1.0s , <1K
公開 測資點#11 (5%): 1.0s , <1K
公開 測資點#12 (5%): 1.0s , <1K
公開 測資點#13 (5%): 1.0s , <1K
公開 測資點#14 (5%): 1.0s , <1K
公開 測資點#15 (5%): 1.0s , <1K
公開 測資點#16 (5%): 1.0s , <1K
公開 測資點#17 (5%): 1.0s , <1K
公開 測資點#18 (5%): 1.0s , <1K
公開 測資點#19 (5%): 1.0s , <1K
Hint :
Tags:
出處:
2019年3月TOI練習賽新手組 [管理者: pcshic (PCSHIC) ]

Status Forum 排行

ID User Problem Subject Hit Post Date
21151 fire5386 (becaidorz) e969
想不到再來看吧
1603 2020-04-20 19:37
37416 evelync0307@ ... (張盈兮) e969
吐血的換行號
31 2023-09-07 14:32
35028 wubaie (小億) e969
89 2023-05-03 13:45
30657 easontsai050 ... (KagariET01) e969
427 2022-06-03 22:09
21032 Easonsfriend (去寫./Problems?ow...) e969
文法
1156 2020-04-03 17:25