結果
| 問題 |
No.2921 Seated in Classroom
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-07 11:43:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 498 ms / 2,000 ms |
| コード長 | 241 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 82,444 KB |
| 実行使用メモリ | 76,644 KB |
| 最終ジャッジ日時 | 2024-09-07 11:43:36 |
| 合計ジャッジ時間 | 4,611 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)