Under construction

Still being built. Things may change

Gahui and Sousenkyo 4

Time limit1sMemory limit512 MB

Summary
Given the top vote count v and a gap k, pick the most distinct vote counts from 1 to v so that no two differ by exactly k.
Level

Medium5 of 10

Topics
Math, Greedy, Implementation
Solved
No attempts yet

Problem

Gahui is watching the annual character election. After the election, the top 16 characters receive large benefits for one year. For that reason, fans vote hard to get their favorite characters into the top 16. Remarkably, at least one Cinderella appears in every election and achieves an outstanding result.

While watching the election, Gahui starts thinking about the following problem. The election has these four facts:

  • No two characters have vote counts that differ by exactly kk.
  • Every character has a different vote count.
  • Every character has at least one vote.
  • The character ranked 1st has vv votes.

Gahui wants to know the maximum number of characters that can take part in the election. Help Gahui find it.

Input

The input is one line with vv and kk separated by a space.

Output

Print nn on the first line, where nn is the number of characters taking part in the election.

On each of the following nn lines, print the number of votes of one character, in rank order. If there are multiple solutions, you may print any of them.

Constraints

1≤v≤250 0001 \le v \le 250\,000

1≤k≤100 0001 \le k \le 100\,000

Examples1

  1. Example 1

    Input
    5 3
    
    Expected output
    3
    5
    3
    1