結果
| 問題 |
No.604 誕生日のお小遣い
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-10 16:08:26 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 138 ms / 1,000 ms |
| コード長 | 771 bytes |
| コンパイル時間 | 4,004 ms |
| コンパイル使用メモリ | 74,704 KB |
| 実行使用メモリ | 41,592 KB |
| 最終ジャッジ日時 | 2024-11-21 19:20:49 |
| 合計ジャッジ時間 | 8,237 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
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;
long tmp2 = c - c / tmp * tmp;
if (tmp2 >= a) {
pr.println(c / tmp * a + a);
} else {
pr.println(c / tmp * a + tmp2);
}
}
}
// ---------------------------------------------------
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);
}
}
}