Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Alpha numbers are a very special kind of numbers because they follow a very special rule - the biggest non-negative difference between
- all pairs must be larger than the last digit of the sum of all digits.Sounds hard?
- For example, 186 is an alpha number.
- The non-negative differences are 8 - 1 = 7, 8 - 6 = 2 and 6 - 1 = 5.
- The sum of all digits is 1 + 8 + 6 = 15.
- The biggest difference 7 is larger than the last digit of 15.
- Input
- Exactly 7 numbers, each on a new line.
- Output
- Each alpha number on a new line, in the order given.
- Constraints
- 100 <= number <= 999
- Sample tests
- Input
- 186
- 144
- 782
- 764
- 882
- 909
- 511
- Output
- 186
- 909
- Input
- 135
- 357
- 791
- 357
- 913
- 579
- 135
- Output
- 791
- 913
- 579
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement