// #pragma comment(linker, "/STACK:1073741824") #include #include #include using namespace std; using namespace __gnu_pbds; #pragma region Macros #if __has_include("debug.h") #include "debug.h" #else #define print__(...) 10 #endif using ll = long long; using u64 = unsigned long long; using u32 = unsigned int; using ld = long double; using cd = complex; #define _overload4(_1,_2,_3,_4,name,...) name #define _overload3(_1,_2,_3,name,...) name #define _rep1(n) for(ll i=0;i=0;i--) #define _rrep2(i,n) for(ll i=n-1;i>=0;i--) #define _rrep3(i,a,b) for(ll i=b-1;i>=a;i--) #define _rrep4(i,a,b,c) for(ll i=a+(b-a-1)/c*c;i>=a;i-=c) #define rrep(...) _overload4(__VA_ARGS__,_rrep4,_rrep3,_rrep2,_rrep1)(__VA_ARGS__) #define each(i,a) for(auto &i:a) #define sum(...) accumulate(range(__VA_ARGS__),0LL) #define dsum(...) accumulate(range(__VA_ARGS__),double(0)) #define _range(i) (i).begin(),(i).end() #define _range2(i,k) (i).begin(),(i).begin()+k #define _range3(i,a,b) (i).begin()+a,(i).begin()+b #define range(...) _overload3(__VA_ARGS__,_range3,_range2,_range)(__VA_ARGS__) #define _rrange(i) (i).rbegin(),(i).rend() #define _rrange2(i,k) (i).rbegin(),(i).rbegin()+k #define _rrange3(i,a,b) (i).rbegin()+a,(i).rbegin()+b #define rrange(...) _overload3(__VA_ARGS__,_rrange3,_rrange2,_rrange)(__VA_ARGS__) #define MIN(...) min_element(range(__VA_ARGS__)) #define MAX(...) max_element(range(__VA_ARGS__)) #define pb push_back #define eb emplace_back #define ppb pop_back #define ppf pop_front #define len(c) static_cast(c.size()) #define fi first #define se second #define elif else if #define unless(a) if(!(a)) #define mp make_pair #define mt make_tuple #define unique(c) sort(range(c)), c.erase(unique(range(c)), c.end()); #define ook order_of_key // order_of_key (k) : Number of items strictly smaller than k . #define fbo find_by_order // find_by_order(k) : K-th element in a set (counting from zero). using Pi = pair; using Pl = pair; template using Tree = tree, rb_tree_tag, tree_order_statistics_node_update>; template using vc = vector; template using vvc = vector>; template using vvvc = vector>; template using vvvvc = vector>; template using max_heap = priority_queue; template using min_heap = priority_queue, greater>; template bool chmin(T& a, const T& b){ if(a > b) {a = b; return true;} return false;} template bool chmax(T& a, const T& b){ if(a < b) {a = b; return true;} return false;} template struct infinity{ static constexpr T value = numeric_limits::max() / 2; static constexpr T mvalue = numeric_limits::min() / 2; static constexpr T max = numeric_limits::max(); static constexpr T min = numeric_limits::min(); }; #if __cpp_variable_templates >= 201304L template constexpr T INF = infinity::value; #endif const ll inf = infinity::value; const ld EPS = 1e-8; constexpr ld PI = 3.1415926535897932384626; // lower bound template int arglb(const std::vector &v, const T &x) { return std::distance(v.begin(), std::lower_bound(range(v), x)); } // upper bound template int argub(const std::vector &v, const T &x) { return std::distance(v.begin(), std::upper_bound(range(v), x)); } template T binpow(T x, T n){T res = T(1); while(n){if(n & 1) res *= x; x *= x; n >>= 1;} return res;} template T modpow(T x, T n, T mod){T res = T(1); while(n){if(n & 1) (res *= x) %= mod; (x *= x) %= mod; n >>= 1;} return res;} template T gcd(T a, T b){ return b == T(0) ? a : gcd(b, a % b);} template T lcm(T a, T b){ return a / gcd(a, b) * b;} template T POPF(deque &que) { T a = que.front(); que.ppf(); return a; } template T POPB(deque &que) { T a = que.back(); que.ppb(); return a; } template T POP(max_heap &que) { T a = que.top(); que.pop(); return a; } template T POP(min_heap &que) { T a = que.top(); que.pop(); return a; } template T POP(queue &que) { T a = que.front(); que.pop(); return a; } template T POP(vc &que) { T a = que.back(); que.ppb(); return a; } inline Pl extGCD(ll a, ll b) { const ll n = a, m = b; ll x = 1, y = 0, u = 0, v = 1; ll t; while (b) { t = a / b; std::swap(a -= t * b, b); std::swap(x -= t * u, u); std::swap(y -= t * v, v); } if (x < 0) x += m, y -= n; return {x, y}; } // Print void print() { cout << "\n"; } template void print(Head&& head, Tail&&... tail) { cout << head; if (sizeof...(Tail)) cout << " "; print(forward(tail)...); } // double input seems slow on CF void read(double& x) { string t; cin >> t; x = stod(t); } void read(long double& x) { string t; cin >> t; x = stold(t); } template void read(T& x) { cin >> x; } template void read(Arg& first, Args&... rest) { read(first); read(rest...); } auto get_ans(bool cond = true, string yes = "YES", string no = "NO"){cout << (cond ? yes : no) << '\n';} template void dump(T print_dump_val, bool _exit = false, bool _nendl = false){ cout << print_dump_val; if(_exit) exit(0); if(_nendl) cout << '\n'; return; } template auto vect(const T& v, int n) { return vector(n, v); } template auto vect(const T& v, int n, D... m) { return vector(n, vect(v, m...)); } template::value, typename T_container::value_type>::type> std::istream& operator >> (std::istream &is, T_container &v) { for(T &x : v) {is >> x;} return is; } template istream &operator>>(istream &is, std::pair &pa) { is >> pa.first >> pa.second ; return is; } template std::istream &operator>>(std::istream &is, std::tuple &tpl) { std::apply([&is](auto &&... args) { ((is >> args), ...);}, tpl); return is; } template T get(){ T t; cin >> t; return t;} #ifdef LOCAL template ostream &operator<<(ostream &os, const std::vector &vec) { for (auto v : vec) os << v << ' '; return os; } #endif template ostream &operator<<(ostream &os, const std::pair &p) { os << p.fi << ' ' << p.se; return os; } template ostream &operator<<(ostream &os, const std::tuple &tpl) { std::apply([&os](auto &&... args) { ((os << args << ' '), ...);}, tpl); return os; } // Bit OPS int popcnt(int x) { return __builtin_popcount(x); } int popcnt(u32 x) { return __builtin_popcount(x); } int popcnt(ll x) { return __builtin_popcountll(x); } int popcnt(u64 x) { return __builtin_popcountll(x); } int popcnt_mod_2(int x) { return __builtin_parity(x); } int popcnt_mod_2(u32 x) { return __builtin_parity(x); } int popcnt_mod_2(ll x) { return __builtin_parityll(x); } int popcnt_mod_2(u64 x) { return __builtin_parityll(x); } // (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2) int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); } int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); } int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } // (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2) int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); } int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); } int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } // Floor, Ceil, Divmods template T floor(T a, T b) { return a / b - (a % b && (a ^ b) < 0); } template T ceil(T x, T y) { return floor(x + y - 1, y); } template T bmod(T x, T y) { return x - y * floor(x, y); } template pair divmod(T x, T y) { T q = floor(x, y); return {q, x - q * y}; } // Graph 2D Dirs constexpr Pi dx8[8] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}}; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const char dir[4] = {'D', 'R', 'U', 'L'}; // ? is -1 vc s_to_vi(const string& S, char first_char){ vc A(size(S)); rep(size(S)) A[i] = (S[i] != '?' ? S[i] - first_char : -1); return A; } // stable sort template vector argsort(const vector &A) { vector ids(size(A)); iota(range(ids), 0); sort(range(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); }); return ids; } // Pref SUM template vector cumsum(vector &A, bool off = 1) { int N = A.size(); vector B(N + 1); rep(N) { B[i + 1] = B[i] + A[i]; } if (off == 0) B.erase(B.begin()); return B; } // rearrange a vector according to another vector template vc rearrange(const vc &A, const vc &I) { vc B(size(I)); rep(i, size(I)) B[i] = A[I[i]]; return B; } //BinCount vc bincount(vc& A, ll si){ vc C(si); each(x, A) ++C[x]; return C; } // Binary Search template ll binary_search(F check, ll ok, ll ng, bool check_ok = true){ if(check_ok) assert(check(ok)); while(abs(ok - ng) > 1){ auto x = (ng + ok) / 2; tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x)); } return ok; } struct custom_hash { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM); }}; // RNG u64 RNG_64() { static uint64_t x_ = uint64_t(chrono::duration_cast( chrono::high_resolution_clock::now().time_since_epoch()) .count()) * 10150724397891781847ULL; x_ ^= x_ << 7; return x_ ^= x_ >> 9; } u64 RNG(u64 lim) { return RNG_64() % lim; } ll RNG(ll l, ll r) { return l + RNG_64() % (r - l); } // Split string vc split(string S, string seps = " ,"){ vc res = {""}; each(s, S){ if(count(range(seps), s)) res.eb(""); else res.back() += s; } return res; } // Y - Combinator namespace std{ template class y_combinator_result{ Fun fun_; public: template explicit y_combinator_result(T &&fun) : fun_(std::forward(fun)) {} template decltype(auto) operator() (Args&&... args){ return fun_(std::ref(*this), std::forward(args)...);} }; } template decltype(auto) y_combinator(Fun&& fun){ return y_combinator_result>(std::forward(fun));} #pragma endregion void run_test_cases(){ int N, K; cin >> N >> K; if(N % K) return print(-1); vc A; K = N / K; rep(K) A.eb(1); int num = 2; while(len(A) != N) A.eb(num++); each(x, A) cout << x << ' '; } void run_case(bool testcase = false, bool query = false){ int case_cnt = 1; if(testcase) cin >> case_cnt; for(;case_cnt--;){ run_test_cases(); if(!query) cout << endl; } } signed main(){ auto start = std::chrono::system_clock::now(); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #endif cout << setprecision(16) << fixed; run_case(); auto end = std::chrono::system_clock::now(); auto duration = std::chrono::duration_cast(end - start); cerr << "Your code took " << duration.count() << "ms" << endl; time_t now = time(0); // get current dat/time with respect to system char* dt = ctime(&now); // convert it into string cerr << "The local date and time is: " << dt; // print local date and time }