結果

問題 No.604 誕生日のお小遣い
ユーザー kichirb3
提出日時 2018-03-16 20:32:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-21 14:38:53
合計ジャッジ時間 1,710 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.604 誕生日のお小遣い
https://yukicoder.me/problems/no/604

"""
import sys
from sys import stdin
from math import ceil
input = stdin.readline


def solve(A, B, C):
    if A == 1:
        return ceil(C / B)

    cycle_income = B + (A - 1)
    cycle = C // cycle_income
    ans = C - (cycle_income * cycle) + A * cycle
    return ans


def main(args):
    A, B, C = map(int, input().split())
    ans = solve(A, B, C)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
0