CF BUDDY
← Problems·

1157D · N Problems During K Days

1900 · constructive algorithms, greedy, math

Problem: Polycarp has to solve exactly nn problems to improve his programming skill before an important programming competition. But this competition will be held very soon, most precisely, it will start in kk days. It means that Polycarp has exactly kk days for training!

Polycarp doesn't want to procrastinate, so he wants to solve at least one problem during each of kk days. He also doesn't want to overwork, so if he solves xx problems during some day, he should solve no more than 2x2x problems during the next day. And, at last, he wants to improve his skill, so if he solves xx problems during some day, he should solve at least x+1x+1 problem during the next day.

More formally: let [a1,a2,,ak][a_1, a_2, \dots, a_k] be the array of numbers of problems solved by Polycarp. The ii-th element of this array is the number of problems Polycarp solves during the ii-th day of his training. Then the following conditions must be satisfied:

  • sum of all aia_i for ii from 11 to kk should be nn;
  • aia_i should be greater than zero for each ii from 11 to kk;
  • the condition ai<ai+12aia_i < a_{i + 1} \le 2 a_i should be satisfied for each ii from 11 to k1k-1.

Your problem is to find any array aa of length kk satisfying the conditions above or say that it is impossible to do it.

Input Format: The first line of the input contains two integers nn and kk (1n109,1k1051 \le n \le 10^9, 1 \le k \le 10^5) — the number of problems Polycarp wants to solve and the number of days Polycarp wants to train.

Output Format: If it is impossible to find any array aa of length kk satisfying Polycarp's rules of training, print "NO" in the first line.

Otherwise print "YES" in the first line, then print kk integers a1,a2,,aka_1, a_2, \dots, a_k in the second line, where aia_i should be the number of problems Polycarp should solve during the ii-th day. If there are multiple answers, you can print any.

Sample Cases

Case 1

Input

26 6

Output

YES
1 2 4 5 6 8

Case 2

Input

8 3

Output

NO

Case 3

Input

1 1

Output

YES
1

Case 4

Input

9 4

Output

NO

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback