##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given three positive integers , , and . You need to find the number of arrays of length that satisfy the following conditions:
Formally, let for . The size of the set must be exactly .
Since the answer can be very large, output it modulo .
The array length is and the elements are chosen from . The prefix GCD sequence must contain exactly distinct values, which means . The valid arrays and their corresponding prefix GCD sequences are:
There are valid arrays in total.
The maximum possible number of distinct prefix GCDs for elements up to is (for example, the division chain ). It is mathematically impossible to have distinct values, so the answer is .