結果

問題 No.2921 Seated in Classroom
ユーザー miho-4miho-4
提出日時 2024-10-12 14:51:20
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 156 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,484 KB
実行使用メモリ 67,560 KB
最終ジャッジ日時 2024-10-12 14:51:24
合計ジャッジ時間 1,427 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

t=inpt(input())
for _ in range(t):
	n,m=map(int,input().split())
	
	v=n//4
	m-=6*v
	m-=8-n%4
	
	ans=v
	if 0<v:
		ans+=v//8
		if 0<v%8:
			ans+=1
	print(ans)
0