結果

問題 No.2194 兄弟の掛け引き
ユーザー MasKoaTSMasKoaTS
提出日時 2023-01-20 22:05:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 1,000 ms
コード長 306 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 71,308 KB
最終ジャッジ日時 2023-09-05 14:23:02
合計ジャッジ時間 2,485 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,128 KB
testcase_01 AC 78 ms
71,308 KB
testcase_02 AC 77 ms
71,308 KB
testcase_03 AC 76 ms
71,024 KB
testcase_04 AC 77 ms
70,856 KB
testcase_05 AC 76 ms
71,304 KB
testcase_06 AC 75 ms
71,132 KB
testcase_07 AC 75 ms
71,124 KB
testcase_08 AC 75 ms
71,176 KB
testcase_09 AC 77 ms
71,168 KB
testcase_10 AC 77 ms
71,124 KB
testcase_11 AC 77 ms
70,892 KB
testcase_12 AC 77 ms
70,852 KB
testcase_13 AC 76 ms
70,888 KB
testcase_14 AC 77 ms
71,128 KB
testcase_15 AC 78 ms
71,096 KB
testcase_16 AC 79 ms
71,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c = map(int,input().split())
ans = set([])
if(c % a == 0):
    ans.add(c // a)
if((c + b) % a == 0):
    ans.add((c + b) // a)
    
flag = True
for k in sorted(ans):
    x = k * a
    if(x - b > 0):
        x -= b
    if(x != c):
        continue
    print(k)
    flag = False
if(flag):
	print(-1)
    
0