結果

問題 No.2921 Seated in Classroom
ユーザー yumechi
提出日時 2024-10-26 16:54:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 487 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 5,399 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 78,368 KB
最終ジャッジ日時 2024-10-26 16:54:22
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
for _ in [0]*int(input()):
	n, m = map(int, input().split(" "))
	t_ans, mod = math.ceil(n/4), n%4
	m -= (t_ans * 4)
	if mod > 0:
		m -= (4 - mod)
	m_ans = math.ceil(m/8)
	if m_ans > 0:
		t_ans += m_ans
	print(t_ans)
0