HACKWITHINFY : Palindromic Divisibility


Any suggestions?

Constraints on K please? If K is small then it’s a simple question of dp.

1<=N<=10^4
1<=K<=10^2