結果
| 問題 | No.2921 Seated in Classroom | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-10-13 02:08:13 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 441 ms / 2,000 ms | 
| コード長 | 631 bytes | 
| コンパイル時間 | 270 ms | 
| コンパイル使用メモリ | 82,432 KB | 
| 実行使用メモリ | 76,416 KB | 
| 最終ジャッジ日時 | 2024-10-13 02:08:18 | 
| 合計ジャッジ時間 | 3,536 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 5 | 
ソースコード
"""input"""
#int-input
# input = sys.stdin.readline
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
#str-input
def SI(): return input()
def MSI(): return input().split()
def SI_L(): return list(SI())
def SI_LI(): return list(map(int, SI()))
#multiple-input
def LLI(n): return [LI() for _ in range(n)]
def LSI(n): return [SI() for _ in range(n)]
#1-indexを0-indexでinput
def MI_1(): return map(lambda x:int(x)-1, input().split())
def TI_1(): return tuple(MI_1())
def LI_1(): return list(MI_1())
t = II()
for _ in range(t):
    n,m = MI()
    print(max((n-1)//4,(n+m-1)//8)+1)
            
            
            
        