Company: Infosys_12july
Difficulty: medium
Permutaria Royal Dance Problem Description In the grand kingdom of Permutaria, a magnificent royal dance is held every year. The king orders N noble dancers, numbered 1 to N, to perform in a specific sequence. The dancers are arranged in a sequence K for the performance. However, to make the event exciting the i-th dancer to perform is asked to wait in position r where |r-i| >= X. Find the total number of ways in which you can form K. Since the answer can be large return it modulo 998244353. Input Format The first line contains an integer, N denoting the number of dancers. The next line contains an integer, X denoting the minimum difference between the current position and the original position. Examples Example 1: Input: 1 1 Output: 0 Explanation: N = 1 (Only 1 dancer) X = 1 (Minimum difference constraint) Valid permutation: Since there is only one dancer, they must be in position 1. However, the rule states that dancer 1 cannot be placed in position 1 because |1 - 1| Example 2: Input