Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
342 B
1
Indexable
Never
//Bai 9
#include <iostream>

using namespace std;
typedef long long ll;



int main(){
	freopen("test.inp","r",stdin);
	freopen("test.out","w",stdout);

	ll p, k; int n; cin >> p >> n >> k;
	ll m = p - n*(n+1)/2*k;
	if(m >= 0) cout << "YES" << endl;
	else{
		cout << "NO" << endl;
		cout << -m << endl;
	}

	return 0;
}
Leave a Comment