Logo
(追記) (追記ここまで)

30796번 - gahui and sousenkyo 4 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB234948242.487%

문제

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 $k$ votes count.
  • Every character has a different number of votes.
  • All character have at least one vote count.
  • The character that ranked 1st has $v$ votes count.

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

입력

$v$ and $k$ are given separated by spaces.

출력

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

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

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

제한

  • 1ドル \le v \le 250,000円$
  • 1ドル \le k \le 100,000円$

예제 입력 1

5 3

예제 출력 1

3
5
3
1

There are user outputs and verdicts.

no n 1st 2nd 3rd verdict
#1 3 5 3 1 correct
#2 3 3 2 1 wrong
#3 3 5 2 1 wrong

[Table 1] user's output and verdict

  • #2 is wrong because the ranked 1st character votes count is not 5.
  • #3 is wrong because the vote difference between ranked 1st and 2nd place is 3.

힌트

출처

Contest > BOJ User Contest > 가희와 함께 하는 코딩 테스트 > 가희와 함께 하는 6회 코딩 테스트 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /