ural 1009. K-based Numbers. DP.