Notice
Recent Posts
문제 풀이 및 개발 공간
[백준] 달팽이는 올라가고 싶다 (bronze 1 본문
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[]args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st=new StringTokenizer(br.readLine());
int a=Integer.valueOf(st.nextToken());
int b=Integer.valueOf(st.nextToken());
int v=Integer.valueOf(st.nextToken());
int total=1+(v-a)/(a-b);
total= (v-a)%(a-b)!=0 ? total+1 : total;
System.out.println(total);
}
}
'백준공부 > java' 카테고리의 다른 글
[백준] 15829번 Hashing (bronze 2 (0) | 2024.02.27 |
---|---|
[백준] 2436번 공약수 (gold 5 (0) | 2024.02.27 |
[백준] 18111번 마인크래프트 (silver 2 (2) | 2024.02.14 |
[백준] 14888번 연산자 끼워넣기 (silver 1 (0) | 2024.02.14 |
[백준] 9372번 상근이의 여행 (silver 4 (0) | 2024.01.10 |