結果

問題 No.2953 Maximum Right Triangle
ユーザー のーと
提出日時 2024-11-08 22:06:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 54,068 KB
最終ジャッジ日時 2024-11-08 22:06:41
合計ジャッジ時間 1,362 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
	D,x,y=map(int,input().split())
	if x==0:
		print(D*y)
		continue
	if y==0:
		print(D*x)
		continue
	if x>=y:
		if x+y>D:
			print(0)
			continue
		k=min((D-y)//x,x//y)//1
		print(k*(x**2+y**2))
	else:
		if x+y>D:
			print(0)
			continue
		k=min((D-x)//y,y//x)//1
		print(k*(x**2+y**2))
0