Mingle

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

요약
고리 모양으로 놓인 방들에서 각 플레이어가 자기 번호에서 k 이내의 방을 균등하게 무작위로 고를 때, 정확히 한 명만 들어간 방의 기댓값을 구한다.
난이도

어려움10점 중 8점

유형
동적 계획법, 조합론, 확률, 수학
정답자
아직 제출이 없습니다

문제

You and your friends are playing the popular childhood game, Mingle.

In the game of Mingle, nn players start by standing on a spinning circular platform in the middle of a circular arena. Each player has a unique number ranging from 11 to nn, and there are nn rooms also with unique numbers from 11 to nn arranged on the perimeter of the arena. The rooms are in numerical order, with room nn also being adjacent to room 11.

Cheerful music plays for a few seconds, and then the music stops, the circular platform stops spinning, and everyone has to run into a room. Initially, each player tries to target the room with the same number as their number, but because of the spinning, everyone is disoriented. As a result, player ii might enter a different room. Notably, the players have a disorientation factor of kk, which is the same for all players, and player ii might enter a room that is up to kk rooms away from their target room. All 2k+12k+1 candidate rooms are equally likely for each player and all players select their rooms independently. Every player who ends up alone in a room is a winner in that round of Mingle, even if the room’s number is not the same as the player’s number.

Compute the expected number of winners in a single round of Mingle.

입력

The first and only line of input contains two integers, nn (3≤n≤456)(3 \leq n \leq 456), and kk (1≤k≤n−12)(1 \le k \le \frac{n-1}{2}), where nn is the number of players playing, and kk is the disorientation factor of the players.

출력

Let ww be the expected number of winners in a single round of Mingle. It can be shown that ww can be written as ab\frac{a}{b} for relatively prime positive integers aa and bb. Output ab−1(mod998244353)ab^{-1} \pmod{998244353}.

예제1

  1. 예제 1

    입력
    3 1
    
    예상 출력
    332748119