結果

問題 No.604 誕生日のお小遣い
ユーザー Grenache
提出日時 2017-12-10 16:00:01
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 3,407 ms
コンパイル使用メモリ 75,076 KB
実行使用メモリ 54,468 KB
最終ジャッジ日時 2024-11-30 11:18:38
合計ジャッジ時間 7,689 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder604 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		long a = sc.nextLong();
		long b = sc.nextLong();
		long c = sc.nextLong();

		if (c <= a) {
			pr.println(c);
		} else {
			long tmp = a - 1 + b;

			pr.println(c / tmp * a + c - c / tmp * tmp);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0