結果

問題 No.2921 Seated in Classroom
ユーザー kusirakusirakusirakusira
提出日時 2024-08-27 21:48:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 505 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 76,928 KB
最終ジャッジ日時 2024-08-27 21:48:55
合計ジャッジ時間 3,819 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 432 ms
76,244 KB
testcase_01 AC 269 ms
76,148 KB
testcase_02 AC 235 ms
76,428 KB
testcase_03 AC 438 ms
76,416 KB
testcase_04 AC 505 ms
76,928 KB
testcase_05 AC 36 ms
53,560 KB
testcase_06 AC 35 ms
53,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

def ceil(a, b):
    return (a+b-1)//b

if((1 <= t <= 2*10**5) == False): print("WA")
	
for i in range(t):
    n, m = map(int,input().split())
    if((1<= min(n,m) <= max(n,m) <= 10**9) == False): print("WA")
    a = ceil(n, 4)
    b = (8 * a - n)
    c = ceil(m - b, 8)
    ans = max(a, a + c)
    print(ans)
0