結果

問題 No.915 Plus Or Multiple Operation
ユーザー AEnAEn
提出日時 2022-05-25 10:33:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 1,697 ms
コンパイル使用メモリ 81,648 KB
実行使用メモリ 53,500 KB
最終ジャッジ日時 2023-10-20 19:08:20
合計ジャッジ時間 2,387 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

Q = int(input())
for i in range(Q):
    A, B, C = map(int, input().split())
    if C == 1:
        print(A*B)
        continue
    cnt = 0
    while True:
        if A <= 2*C:
            cnt += 2
            break
        A, b = A//C, A%C
        if A > 0:
            cnt += 1
        if b > 0:
            cnt += 1
        if A == 0:
            break
    print(B*cnt)
0