結果

問題 No.915 Plus Or Multiple Operation
コンテスト
ユーザー AEn
提出日時 2022-05-25 10:33:44
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 371 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,915 ms
コンパイル使用メモリ 84,904 KB
実行使用メモリ 53,896 KB
最終ジャッジ日時 2026-04-09 01:06:11
合計ジャッジ時間 3,335 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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