Source Code
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <queue>
using namespace std;

int main() {
	int n, e, k;
	cin >> n >> e >> k;
	k = min(n, k);
	if(k == 1 || e == 0){
		cout << "Yes";
	}
	else if((n + k - 1) / k < min(n, 1 + e) && max(1, n - e) == 1){
		cout << "Yes";
	}
	else if((n + k - 1 ) / k >= min(n, 1 + e)){
		int cur = (n + k - 1) / k - min(n, 1 + e);
		if(cur + 1 >= max(1, n - e)){
			cout << "Yes";
		}
		else{
			cout << "No";
		}
	}
	else{
		cout << "No";
	}
	return 0;
}
Copy
Scientific Study Bahou
GNU G++17
3 ms
796 KB
Wrong Answer