GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Thursday 4 August 2022

[Solution] Chip Move Codeforces Solution




D. Chip Move
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

There is a chip on the coordinate line. Initially, the chip is located at the point 0. You can perform any number of moves; each move increases the coordinate of the chip by some positive integer (which is called the length of the move). The length of the first move you make should be divisible by k, the length of the second move — by k+1, the third — by k+2, and so on.

For example, if k=2, then the sequence of moves may look like this: 0471944, because 40=4 is divisible by 2=k74=3 is divisible by 3=k+1197=12 is divisible by 4=k+24419=25 is divisible by 5=k+3.

Solution Click Below:-  👉CLICK HERE👈

👇👇👇👇👇

 occupied

You are given two positive integers n and k. Your task is to count the number of ways to reach the point x, starting from 0, for every x[1,n]. The number of ways can be very large, so print it modulo 998244353. Two ways are considered different if they differ as sets of visited positions.

Input

The first (and only) line of the input contains two integers n and k (1kn2105).

Output

Print n integers — the number of ways to reach the point x, starting from 0, for every x[1,n], taken modulo 998244353.

No comments:

Post a Comment