import java.io.*;
public class Main {
/**
* http://acm.tju.edu.cn/toj/showp3445.html
* @author hunglee
*/
public static void main(String[] args) throws IOException {
StreamTokenizer in = new StreamTokenizer(new BufferedReader(
new InputStreamReader(System.in)));
int e, f, c;
in.nextToken();
e = (int) in.nval;
in.nextToken();
f = (int) in.nval;
in.nextToken();
c = (int) in.nval;
int res = 0;
e += f;
do {
f = e / c;
res += f;
e %= c;
e += f;
} while (e >= c);
System.out.println(res);
}
}
Chủ Nhật, 2 tháng 1, 2011
3445. Soda Surple
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét