gahui and sousenkyo 4
시간 제한1초메모리 제한512 MB
1위의 득표수 v와 간격 k가 주어질 때, v를 포함하고 어떤 두 수도 k만큼 차이나지 않는 서로 다른 양의 정수 집합의 최대 크기를 구하고 순위대로 출력한다.
문제
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 votes count.
- Every character has a different number of votes.
- All character have at least one vote count.
- The character that ranked 1st has votes count.
She wants to know the maximum number of characters participating in the election. Help Gahui.
입력
and are given separated by spaces.
출력
Print in the first line. is the number of characters participating in the election.
In the following lines, print the number of votes obtained by rank.
If there are multiple solutions, you may output any of them.