#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int N, D, K; void display(vector &vec) { for (int i = 0; i < vec.size(); i++) { if (i > 0) { cout << " "; } cout << vec[i]; } cout << endl; } bool check(int i, int d, int k) { int minAmount = 0; int maxAmount = 0; for (int j = i, k2 = 0; j <= N && k2 < k; j++, k2++) { minAmount += j; } for (int j = N, k2 = 0; j >= i && k2 < k; j--, k2++) { maxAmount += j; } return (minAmount <= d && d <= maxAmount); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cin >> N >> D >> K; vector vec; for (int i = 1; i <= N; i++) { if (K == 0) { break; } if (check(i + 1, D - i, K - 1)) { vec.push_back(i); D -= i; K--; } } if (vec.size() == 0 || K != 0) { cout << -1 << endl; } else { display(vec); } return 0; }