File tree 3 files changed +31
-0
lines changed
out/production/BOJ_JAVA/BOJ
3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ package BOJ ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+ import java .util .StringTokenizer ;
7
+
8
+ public class BOJ_4796 {
9
+ public static void main (String [] args ) throws IOException {
10
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
11
+
12
+ int i = 1 ;
13
+ while (true ){
14
+ StringTokenizer st = new StringTokenizer (br .readLine ());
15
+ StringBuilder sb = new StringBuilder ();
16
+ int L = Integer .parseInt (st .nextToken ());
17
+ int P = Integer .parseInt (st .nextToken ());
18
+ int V = Integer .parseInt (st .nextToken ());
19
+
20
+ if (L == 0 && P == 0 && V == 0 ) break ;
21
+
22
+ int mok = V / P ;
23
+ int sum = V % P ;
24
+
25
+ sb .append ("Case " ).append (i ).append (": " ).append (mok * L + Math .min (L , sum ));
26
+ System .out .println (sb );
27
+ i ++;
28
+ }
29
+ br .close ();
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments