結果

問題 No.804 野菜が苦手
ユーザー もぐら 3.0
提出日時 2023-11-14 22:50:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,340 KB
実行使用メモリ 53,676 KB
最終ジャッジ日時 2024-09-26 04:20:50
合計ジャッジ時間 1,658 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C,D = map(int,input().split())

cnt=0
while D>0:
    if A>0:
        if B>=C:
            A-=1
            B-=C
            if D>=1+C:
                D-=1
                D-=C
                cnt+=1
            else:
                print(cnt)
                exit()
        else:
            print(cnt)
            exit()
    else:
        print(cnt)
        exit()

print(cnt)
0