結果

問題 No.2128 Round up!!
コンテスト
ユーザー prussian_coder
提出日時 2022-11-20 20:00:45
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 235 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 225 ms
コンパイル使用メモリ 95,696 KB
実行使用メモリ 85,952 KB
最終ジャッジ日時 2026-09-01 19:27:46
合計ジャッジ時間 4,274 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

T=int(input())
import math
for _ in range(T):
	N,A,B=map(int,input().split())
	if A<B:
		A,B=B,A
	c=B//math.gcd(A,B)
	ans=(c-N//A)*2
	if (N%A)==0 and (N%B)==0:
		print(0)
	else:	
		if (-N%B)<(-N%A) and (N%B)!=0:
			ans+=1
		print(ans)
0