?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
238967405 |
Practice: your_submissions_ |
1015D - 40 | C++20 (GCC 11-64) | Accepted | 31 ms | 1216 KB | 2023-12-26 17:31:32 | 2023-12-26 17:31:32 |
#include<bits/stdc++.h> #define int long long using namespace std; int n,k,s,t=1,x; signed main(){ cin>>n>>k>>s; if(s<k||s>(n-1)*k){ cout<<"NO"; return 0; } cout<<"YES\n"; while(k--){ x=min(n-1,s-k); s-=x; if(t==1) t+=x; else t-=x; cout<<t<<' '; } }
?
?
?
?