[Solution] Chip Move Codeforces Solution
There is a chip on the coordinate line. Initially, the chip is located at the point . 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 , the length of the second move — by , the third — by , and so on.
For example, if , then the sequence of moves may look like this: , because is divisible by , is divisible by , is divisible by , is divisible by .
occupied
You are given two positive integers and . Your task is to count the number of ways to reach the point , starting from , for every . The number of ways can be very large, so print it modulo . Two ways are considered different if they differ as sets of visited positions.
The first (and only) line of the input contains two integers and ().
Print integers — the number of ways to reach the point , starting from , for every , taken modulo .
No comments:
Post a Comment