結果

問題 No.2921 Seated in Classroom
コンテスト
ユーザー Hyoka7
提出日時 2024-10-12 14:56:42
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 405 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 64 ms
コンパイル使用メモリ 82,748 KB
実行使用メモリ 85,028 KB
最終ジャッジ日時 2026-09-14 20:33:00
合計ジャッジ時間 3,453 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

t = int(input())
for i in range(t):
    charge, noncharge = map(int, input().split())
    cs, ncs = 0, 0
    cs += charge // 4
    noncharge -= cs * 4
    charge %= 4
    if charge > 0:
        cs += 1
        noncharge -= 8 - charge
    if noncharge <= 0:
        print(cs)
    else:
        cs += noncharge // 8
        noncharge %= 8
        if noncharge > 0:
            cs += 1
            print(cs)
0