結果

問題 No.2366 登校
ユーザー shobonvipshobonvip
提出日時 2023-06-30 14:05:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 76,628 KB
最終ジャッジ日時 2023-09-22 05:11:45
合計ジャッジ時間 3,313 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,364 KB
testcase_01 AC 70 ms
71,448 KB
testcase_02 AC 69 ms
71,216 KB
testcase_03 AC 69 ms
71,216 KB
testcase_04 AC 74 ms
71,352 KB
testcase_05 AC 70 ms
71,316 KB
testcase_06 AC 70 ms
71,160 KB
testcase_07 AC 71 ms
71,260 KB
testcase_08 AC 68 ms
71,348 KB
testcase_09 AC 69 ms
71,372 KB
testcase_10 AC 70 ms
71,372 KB
testcase_11 AC 68 ms
71,296 KB
testcase_12 AC 70 ms
71,148 KB
testcase_13 AC 70 ms
71,368 KB
testcase_14 AC 70 ms
71,444 KB
testcase_15 AC 71 ms
71,240 KB
testcase_16 AC 69 ms
71,200 KB
testcase_17 WA -
testcase_18 AC 70 ms
71,216 KB
testcase_19 AC 71 ms
71,428 KB
testcase_20 AC 70 ms
71,212 KB
testcase_21 AC 71 ms
71,152 KB
testcase_22 WA -
testcase_23 AC 71 ms
71,372 KB
testcase_24 AC 94 ms
76,628 KB
testcase_25 WA -
testcase_26 AC 71 ms
71,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k,t = map(int,input().split())
targ = n+m-2-t

if targ <= 0:
	print(0)
	exit()

ans = 10 ** 18

for i in range(k):
	a, b, c, d = map(int,input().split())
	c -= 1
	if c == 0: continue
	ans = min(ans, ((targ+c-1)//c) * d)

if ans == 10 ** 18:
	print(-1)
else:
	print(ans)
0