본문 바로가기
Java/알고리즘

[Java] 백준 2869번 : 달팽이는 올라가고 싶다

by EricJeong 2019. 8. 21.

 

 

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long A = in.nextLong();
		long B = in.nextLong();
		long V = in.nextLong();
		long answer = 0;
		long dis = A-B;
		
		V -= B;
		answer = V / dis;
		if(V % dis > 0)
			answer++;
		
		System.out.println(answer);
	}
}

 

 

 

댓글