結果
| 問題 | No.2921 Seated in Classroom |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-07 11:43:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 332 ms / 2,000 ms |
| コード長 | 241 bytes |
| 記録 | |
| コンパイル時間 | 1,250 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 81,536 KB |
| 最終ジャッジ日時 | 2026-04-04 00:56:12 |
| 合計ジャッジ時間 | 2,436 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 |
ソースコード
t=int(input())
while t:
t-=1
m,n=map(int,input().split())
q,r=m//4,m%4
n=max(0,n-4*q)
if n==0:
print(q+(r>0))
continue
if n<=8-r:
print(q+1)
continue
n-=8-r
print(q+1+(n+7)//8)