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(e == 0){
		cout << "Yes";
	}
	else if(k < min(n, 1 + e) && max(1, n - e) == 1){
		cout << "Yes";
	}
	else if(k >= min(n, 1 + e)){
		int cur = k - min(n, 1 + e) + 2;
		if(cur >= max(1, n - e)){
			cout << "Yes";
		}
		else{
			cout << "No";
		}
	}
	else{
		cout << "No";
	}
	return 0;
}
Copy
Scientific Study azoz
GNU G++17
2 ms
744 KB
Wrong Answer