https://www.acmicpc.net/problem/2869
2869번: 달팽이는 올라가고 싶다
첫째 줄에 세 정수 A, B, V가 공백으로 구분되어서 주어진다. (1 ≤ B < A ≤ V ≤ 1,000,000,000)
www.acmicpc.net
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int A, B, V;
cin >> A >> B >> V;
if (A > V)
cout << 1;
else
{
// (V-A): Height raised during the daytime on Day 1
// (A-V): Height that rises on a day
if ((V - A) % (A - B) == 0) // If divided, the climb is complete
cout << (V - A) / (A - B) + 1;
else // Otherwise, it goes up one more day, exceeding V.
cout << (V - A) / (A - B) + 2;
}
return 0;
}