백준 2869번 달팽이는 올라가고싶다.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
// 나머지 블럭이 한칸이든 두칸이든 남아있으면 하루를 더 Up해줘야된다.
// 시간 제한 때문에 Buffer 사용, Scanner 사용시 시간초과
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
int a = Integer.parseInt(st.nextToken()); // up
int b = Integer.parseInt(st.nextToken()); // down
int c = Integer.parseInt(st.nextToken()); // length
int total = (c - b) / (a - b);
// 나머지 블럭이 남아있는 경우를 체크 한다
if ((c - b) % (a - b) != 0) {
total++;
}
System.out.println(total);
}
}