#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(x,y) for(int x = 0;x < (y);x++) #define LLI long long int #define FORR(x,arr) for(auto& x:arr) #define ALL(a) (a.begin()),(a.end()) #define _L(x) cout<<(x)<> n >> d >> k; if(k > n) { cout << -1 << endl; return 0; } int minValue = 0; for(int i = 1;i <= k;i++) { minValue += i; } int maxValue = 0; for(int i = n;i >= n-k+1;i--) { maxValue += i; } if(d > maxValue || d < minValue) { cout << -1 << endl; return 0; } if(d == minValue) { for(int i = 1;i <= k;i++) { cout << i << " "; } cout << endl; return 0; } if(d == maxValue) { for(int i = n - k + 1;i <= n;i++) { cout << i << " "; } cout << endl; return 0; } int distance = n - k; int diff = d - minValue; int div = diff / distance; int mod = diff % distance; int asis = k - div; if(mod != 0) { asis--; } for(int i = 1;i <= asis;i++) { cout << i << " "; } if(mod != 0) { cout << asis + 1 + mod << " "; for(int i = asis + 2 + distance; i < asis + 2 + distance + div;i++) { cout << i << " "; } cout << endl; return 0; } for(int i = asis + 1 + distance; i < asis + 1 + distance + div;i++) { cout << i << " "; } cout << endl; return 0; }