Lightoj 1021 — Painful Bases
Can Anyone give the idea for the following Problem LOJ — 1021 Painful Bases
Codeforces Round 943 Solution Discussion