Competitive Programing Typical 90 Problem day5

Day 5. It is a really hard problem for me, but I manage to write codes and grasp the meaning of them. There are 3 answers. Each of them has own perspective. 1st one is Digit DP, 2nd one is matrix exponentiation, last one is Doubling. Code is below. 1st one. #1st solution N, B, K = map(int,input().s…