結果

問題 No.604 誕生日のお小遣い
ユーザー bluemeganebluemegane
提出日時 2021-04-24 10:35:27
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 510 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 61,200 KB
実行使用メモリ 22,804 KB
最終ジャッジ日時 2023-09-17 13:33:03
合計ジャッジ時間 3,192 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,832 KB
testcase_01 AC 57 ms
22,772 KB
testcase_02 AC 57 ms
20,804 KB
testcase_03 AC 57 ms
20,748 KB
testcase_04 AC 58 ms
20,732 KB
testcase_05 AC 57 ms
20,664 KB
testcase_06 AC 57 ms
22,772 KB
testcase_07 AC 57 ms
20,756 KB
testcase_08 AC 56 ms
20,712 KB
testcase_09 AC 57 ms
20,900 KB
testcase_10 AC 58 ms
20,644 KB
testcase_11 AC 57 ms
20,640 KB
testcase_12 AC 59 ms
22,708 KB
testcase_13 AC 58 ms
22,772 KB
testcase_14 AC 57 ms
20,732 KB
testcase_15 AC 56 ms
20,764 KB
testcase_16 AC 57 ms
20,764 KB
testcase_17 AC 56 ms
20,644 KB
testcase_18 AC 57 ms
20,832 KB
testcase_19 AC 57 ms
22,764 KB
testcase_20 AC 56 ms
18,724 KB
testcase_21 AC 58 ms
22,804 KB
testcase_22 AC 57 ms
20,720 KB
testcase_23 AC 57 ms
20,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = long.Parse(line[0]);
        var b = long.Parse(line[1]);
        var c = long.Parse(line[2]);
        getAns(a, b, c);
    }
    static void getAns(long a, long b, long c)
    {
        var s = a + b - 1;
        var t = c / s;
        var t2 = c % s;
        if (t * s + a - 1 >= c) Console.WriteLine(t * a + t2);
        else Console.WriteLine(t * a + a);
    }
}
0