Preparando MOJI

Maximal GCD

1000ms 262144K

Description:

You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ..., ak, that their sum is equal to n and greatest common divisor is maximal.

Greatest common divisor of sequence is maximum of such numbers that every element of sequence is divisible by them.

If there is no possible sequence then output -1.

Input:

The first line consists of two numbers n and k (1 ≤ n, k ≤ 1010).

Output:

If the answer exists then output k numbers — resulting sequence. Otherwise output -1. If there are multiple answers, print any of them.

Sample Input:

6 3

Sample Output:

1 2 3

Sample Input:

8 2

Sample Output:

2 6

Sample Input:

5 3

Sample Output:

-1

Informação

Codeforces

Provedor Codeforces

Código CF803C

Tags

constructive algorithmsgreedymath

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:15:08

Relacionados

Nada ainda