-
Notifications
You must be signed in to change notification settings - Fork 7
/
Ancient
70 lines (64 loc) · 1.4 KB
/
Ancient
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define MAX 200010
#define MOD 1000000007
#define INF 1e15
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi 3.14159265358979323846
#define endl "\n"
#define coutflg if(flg){cout << "YES\n";}else{cout << "NO\n";}
#define coutyes cout << "YES\n";
#define coutno cout << "NO\n";
#define flush fflush(stdout);
#define fixedprec cout << fixed << setprecision(18);
void solve(){
ll n,k,s;
cin >> n >> k >> s;
ll maxa = (n-1)*k;
ll mina = 1*k;
if(s>maxa || s<mina){
cout << "NO\n";
return;
}
cout << "YES\n";
ll j = s/k;
ll left = s%k;
ll c = 1;
for(ll i=1;i<=k;i++){
if(i%2){
c += j;
if(left){
c++;
left--;
}
}
else{
c -= j;
if(left){
c--;
left--;
}
}
cout << c << " ";
}
cout << endl;
}
int main(){
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
// freopen("output.txt", "w", stdout);
#endif
fast
ll t,q;
q = 1;
// cin >> q;
for(t=1;t<=q;t++){
// cout << "Case #" << t << ": ";
solve();
}
}