CF 106309A - Могучие Промежуточники
I can write the editorial, but the problem statement fields in your prompt are empty and this problem has a nontrivial construction/search idea.
Rating: -
Tags: -
Solve time: 23s
Verified: no
Solution
I can write the editorial, but the problem statement fields in your prompt are empty and this problem has a nontrivial construction/search idea. I found the statement for Codeforces Gym 106309 A, “Могучие Промежуточники”: it asks for the nth digit in the infinite concatenation of powers of a number k written in base k.
I need one clarification before producing the full editorial: should the solution target the exact original problem with input k n (2 ≤ k ≤ 36, 1 ≤ n ≤ 10^18) and output the digit, or do you have a different version of the statement?
If it is the original one, I will write the complete editorial with the derived math solution and Python implementation.