Untitled
//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