General MotorsOA #2
Come Looking for the Smallest Num Which Must Be > Than a Specific Num.
Estimated EasyJudge-ready
Topics (AI-labelled)Bits & Math
Find the smallest X>Z such that digitSum(X)=2×digitSum(Z).
The standard input/output conventions and constraints added by this site are given under "Input".
Input
1≤Z≤500.
Output
Output X.
Example 1
Input:
10
Output:
11
Example 2
Input:
14
Output:
19
Example 3
Input:
99
Output:
9999
Example 4
Input:
1
Output:
2
Example 5
Input:
500
Output:
505
Editorial
Loading solution…