백준 2869 c++

magicdrill·2024년 3월 15일

백준 문제풀이

목록 보기
156/675

백준 2869 c++

#include <iostream>

using namespace std;

int main(void)
{
	int A, B, V;
	int temp = 0, total = 1;

	cin >> A >> B >> V;
	if ((B >= 1 && B < A) && (A >= 1 && A <= V) && (V >= 1 && V <= 1000000000))
	{
		if ((V-A)%(A-B) == 0)
		{
			total = ((V-A)/(A-B)) + 1;
		}
		else
		{
			total = ((V - A) / (A - B)) + 2;
		}
		cout << total << endl;
	}
	else
	{
		;
	}
	return 0;
}

0개의 댓글