?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
142531466 |
Practice: i_will_be_champ |
1015D - 40 | C++14 (GCC 6-32) | Accepted | 46 ms | 8 KB | 2022-01-12 19:12:30 | 2022-01-12 19:12:30 |
#include<bits/stdc++.h> using namespace std; int main() { long long n,k,s,t=1,x;cin>>n>>k>>s; if(s<k||s>(n-1)*k){cout<<"NO";exit(0);} cout<<"YES\n"; while(k--) { x=min(n-1,s-k);s-=x; t==1?t+=x:t-=x; cout<<t<<' '; } }
?
?
?
?