Codeforces 1343D - Constant Palindrome Sum , How to Find here the value Of X

In Such Problem how do we approach to find the value Of X as X can range between 2 to 2*K . Any help will be highly appreciated.

This will help you a lot, clear explanation of the problem by

Thanks brother