문제

 

 

풀이

주어진 조건대로 풀이하면 된다.

#include <iostream>

using namespace std;

int main() {
	int x, y, z;
	int date = 1;

	cin >> x >> y >> z;

	date += (z - x) / (x - y);
	
	if ((z - x) % (x - y) != 0) date++;

	if (x >= z) cout << 1;
	else cout << date;

	return 0;
}

'백준 > 기하' 카테고리의 다른 글

2292번: 벌집 [C++]  (0) 2023.04.06
14215: 세 막대 / C++  (0) 2023.03.21
5073: 삼각형과 세 변 / C++  (0) 2023.03.21
10101: 삼각형 외우기 / C++  (0) 2023.03.21
9063: 대지 / C++  (0) 2023.03.21

+ Recent posts