結果
問題 | No.2921 Seated in Classroom |
ユーザー |
|
提出日時 | 2024-10-12 14:43:05 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 209 ms / 2,000 ms |
コード長 | 390 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 82,336 KB |
実行使用メモリ | 97,520 KB |
最終ジャッジ日時 | 2024-10-12 14:43:23 |
合計ジャッジ時間 | 2,209 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 |
ソースコード
import sysinput = sys.stdin.readlineT = int(input())NM = [list(map(int, input().split())) for _ in range(T)]for n, m in NM:r = (n+3)//4amari = r*4-nnokori = mif nokori<=amari:print(r)else:nokori -= amariif nokori<=r*4:print(r)else:nokori-=r*4r2 = (nokori+7)//8print(r+r2)