D. Is it rated - 3
*special; combinatorics; dp; math
The first line contains a string \(S\).The second line contains an integer \(X\).Constraints \(|S|=3\) \(0 \le X \le 10^9\) The input is guaranteed to be valid.