gahui and sousenkyo 4

시간 제한1초메모리 제한512 MB

요약
1위의 득표수 v와 간격 k가 주어질 때, v를 포함하고 어떤 두 수도 k만큼 차이나지 않는 서로 다른 양의 정수 집합의 최대 크기를 구하고 순위대로 출력한다.
난이도

보통10점 중 6점

유형
그리디, 수학, 정수론, 구현
정답자
아직 제출이 없습니다

문제

Gahui is watching the annual character election. After the election, The top 16 characters receive enormous benefits for one year. For that reason, fans vote passionately to get their favorite characters into the top 16. Remarkably, at least one Cinderella appears in every election, achieving an outstanding outcome.

While watching the character's election, Gahui suddenly think about the following problem. There are the following four facts in the election:

  • There are no two characters with a difference in kk votes count.
  • Every character has a different number of votes.
  • All character have at least one vote count.
  • The character that ranked 1st has vv votes count.

She wants to know the maximum number of characters participating in the election. Help Gahui.

입력

vv and kk are given separated by spaces.

출력

Print nn in the first line. nn is the number of characters participating in the election.

In the following nn lines, print the number of votes obtained by rank.

If there are multiple solutions, you may output any of them.

제한

  • 1≤v≤250,0001 \le v \le 250\\,000
  • 1≤k≤100,0001 \le k \le 100\\,000

예제1

  1. 예제 1

    입력
    5 3
    
    예상 출력
    3
    5
    3
    1