Lightoj 1021
Can Anyone give the idea for the following Problem LOJ — 1021 Painful Bases
AtCoder Beginner G problems upsolving