땅 위에 달팽이가 있다. 이 달팽이는 높이가 V미터인 나무 막대를 올라갈 것이다.
달팽이는 낮에 A미터 올라갈 수 있다. 하지만, 밤에 잠을 자는 동안 B미터 미끄러진다. 또, 정상에 올라간 후에는 미끄러지지 않는다.
달팽이가 나무 막대를 모두 올라가려면, 며칠이 걸리는지 구하는 프로그램을 작성하시오.
첫째 줄에 달팽이가 나무 막대를 모두 올라가는데 며칠이 걸리는지 출력한다.
2 1 5
5 1 6
100 99 1000000000
4
2
999999901
public class bj2869_달팽이는올라가고싶다 {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int up = Integer.parseInt(st.nextToken());
int down = Integer.parseInt(st.nextToken());
int goal = Integer.parseInt(st.nextToken());
double result = 0;
goal -= up;
up -= down;
result = Math.ceil((double)goal/up);
System.out.println((int)(result+1));
}catch(IOException e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
}
}