2869_달팽이는 올라가고 싶다

bgy·2021년 12월 30일
0

백준

목록 보기
8/21

막대 높이에서 올라갈 수 있는 거리 빼기

#include <iostream> 
#include <vector>

using namespace std;


int main() {
	int a, b, v;
	int time;
	cin >> a >> b >> v;
	v -= a;
	if (v % (a - b)==0) {
		time = v / (a - b)+1;
	}
	else {
		time = v / (a - b)+2;
	}
	cout << time;
	return 0;
}

0개의 댓글