atcoder#AGC025A. [AGC025A] Digits Sum
[AGC025A] Digits Sum
Score : points
Problem Statement
Takahashi has two positive integers and .
It is known that plus equals . Find the minimum possible value of "the sum of the digits of " plus "the sum of the digits of " (in base ).
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum possible value of "the sum of the digits of " plus "the sum of the digits of ".
15
6
When and , the sums of their digits are and , which minimizes the value in question.
100000
10