結果

問題 No.2194 兄弟の掛け引き
ユーザー Mat_hMat_h
提出日時 2023-03-02 20:31:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 457 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 11,876 KB
実行使用メモリ 10,152 KB
最終ジャッジ日時 2023-10-17 16:35:43
合計ジャッジ時間 1,728 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,152 KB
testcase_01 AC 28 ms
10,152 KB
testcase_02 AC 28 ms
10,152 KB
testcase_03 AC 28 ms
10,152 KB
testcase_04 AC 28 ms
10,152 KB
testcase_05 AC 28 ms
10,152 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 28 ms
10,152 KB
testcase_09 AC 27 ms
10,152 KB
testcase_10 AC 29 ms
10,152 KB
testcase_11 AC 28 ms
10,152 KB
testcase_12 AC 29 ms
10,152 KB
testcase_13 AC 28 ms
10,152 KB
testcase_14 AC 28 ms
10,152 KB
testcase_15 AC 28 ms
10,152 KB
testcase_16 AC 28 ms
10,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Main():
    a,b,c=map(int,input().split())
    ans1,ans2=-1,-1
    if c>b:
        ans1=c+b
    else:
        ans1=c+b
        ans2=c
    if ans1%a!=0 and ans2%a!=0:
        print(-1)
        exit()
    if ans1%a==0 and ans1!=-1:
        ans1//=a
    if ans2%a==0 and ans2!=-1:
        ans2//=a
    if ans2==-1:
        print(ans1)
    elif ans1==ans2:
        print(ans1)
    else:
        print(min(ans1,ans2))
        print(max(ans1,ans2))

Main()  
0