Under construction

Still being built. Things may change

Decoration

Time limit1.5sMemory limit512 MB

Summary
Given N and K, find K distinct spacings below N where each next value is congruent to the previous value plus its divisor count, minimizing the sum, or print -1.
Level

Hard8 of 10

Topics
Graph, Number theory
Solved
No attempts yet

Statement

After months of lockdown, you are tired of your home's interior and decide to redesign it. You read many blog posts and magazines about Feng Shui decorating and recent home design trends. You settle on reproducing the idea of the designer Sweta Marc for the bookcase you will build.

According to S. Marc, a harmonious bookcase has several shelves spaced in a heterogeneous manner, following some precise rules. Such a bookcase has a serenity value NN and consists of K+1K+1 shelves. From bottom to top, the spaces between consecutive shelves are s1,…,sKs_1, \ldots, s_K millimeters. These spaces must satisfy the following properties:

  1. They are heterogeneous: no two spaces have the same height.
  2. They are not too high: for all i∈[1,K]i \in [1, K], 0≤si<N0 \leq s_i < N. One of the spaces may have size 00. This is one of the oddities that make Sweta's tastes so visually attractive. It wastes space, but you are ready to accept that for elegance, well-being, and trendiness.
  3. They are serene: for all i∈[1,K−1]i \in [1, K-1], si+1s_{i+1} is congruent modulo NN to sis_i plus the number of divisors of sis_i. Ms. Marc is sophisticated and loves arithmetic.

You tried to design a bookcase by Sweta Marc's advice, but you find it hard to satisfy all the requirements. The only solutions you found give a bookcase that is too tall for your place.

Therefore, you write a program that, given KK and NN, computes the spaces s1,…,sKs_1, \ldots, s_K of one of the minimum height bookcases. That is, one where the sum s1+⋯+sKs_1 + \cdots + s_K is smallest.

Input

The only line of input contains two integers NN and KK, separated by a space.

Output

Output a single line containing either −1-1 if it is not possible to satisfy Sweta Marc's prescriptions for the given KK and NN, or KK integers s1,…,sKs_1, \ldots, s_K, the spaces between the shelves of one of the minimum height bookcases that satisfy the constraints. If several solutions are possible, output any of them.

Constraints

1≤N≤1 000 0001 \leq N \leq 1\,000\,000

1≤K≤1 000 0001 \leq K \leq 1\,000\,000

Hints

We recall the following definitions, where aa and bb are arbitrary integers.

  • aa divides bb if there exists an integer qq such that b=aqb = aq.
  • aa is a divisor of bb if b≠0b \neq 0 and aa divides bb.
  • aa is congruent to bb if NN divides b−ab-a.

Examples2

  1. Example 1

    Input
    18 10
    
    Expected output
    11 13 15 1 2 4 7 9 12 0
    
  2. Example 2

    Input
    168 9
    
    Expected output
    1 2 4 7 9 12 18 24 32