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

20245번 - Nunchucks Shop 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB25242395.833%

문제

Nathan owns a shop that sells souvenir nunchucks with unique design. Nunchucks is a traditional martial arts weapon consisting of two sticks connected with a chain. In Nathan's design, each stick is inlayed with $n$ gemstones arranged in a row. These gemstones are either quartz or onyx, and they create a nice black-and-white pattern. For aesthetics reasons, Nathan sells only nunchucks with exactly $k$ onyxes on both sticks in total. For example, here is one of the possible designs for $n=4$ and $k=5$.

Recently Nathan decided that it will be good to be able to sell nunchucks with every possible design. But that will require him to have nunchucks with all possible designs in the storage, and the number of possible designs is huge!

Thus, Nathan decided to compromise. He will have a number of sticks in his storage. When a customer orders some design, Nathan will take two sticks from the storage and combine them with a chain. Sticks are symmetrical, and Nathan can connect the chain to any end of the stick. For example, if $n=3$ and $k=2,ドル and Nathan has these sticks in the storage:

Then he can make nunchucks of any possible design. For example, if the customer asks for nunchucks of this design:

Then Nathan can make it from sticks 1 and 3.

Now Nathan wonders: what is the minimum number of sticks he should have in the storage to be able to make nunchucks of any possible design? Help him find this number.

입력

The input contains two integers $n$ and $k$ (1ドル\le n\le 50$; 0ドル\le k\le 2\cdot n$).

출력

Output one integer: the minimum number of sticks Nathan should have in the storage.

제한

예제 입력 1

3 2

예제 출력 1

7

예제 입력 2

4 1

예제 출력 2

3

예제 입력 3

5 0

예제 출력 3

2

예제 입력 4

50 50

예제 출력 4

626155273417404

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2020-2021 North-Western Russia Regional Contest N번

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

출처

대학교 대회

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

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