백준2869: 달팽이는 올라가고 싶다
문제
https://www.acmicpc.net/problem/2869
문제 풀이
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int v = sc.nextInt();
int day = (v - b) / (a - b);
if((v-b) % (a-b) !=0){
day++;
}
System.out.println(day);
}
}
댓글남기기