Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Alpha numbers are a very special kind of numbers because they follow a very special rule - the biggest non-negative difference between
  2. all pairs must be larger than the last digit of the sum of all digits.Sounds hard?
  3.  
  4. For example, 186 is an alpha number.
  5.  
  6. The non-negative differences are 8 - 1 = 7, 8 - 6 = 2 and 6 - 1 = 5.
  7. The sum of all digits is 1 + 8 + 6 = 15.
  8. The biggest difference 7 is larger than the last digit of 15.
  9. Input
  10. Exactly 7 numbers, each on a new line.
  11.  
  12. Output
  13. Each alpha number on a new line, in the order given.
  14.  
  15. Constraints
  16. 100 <= number <= 999
  17.  
  18. Sample tests
  19. Input
  20. 186
  21. 144
  22. 782
  23. 764
  24. 882
  25. 909
  26. 511
  27. Output
  28. 186
  29. 909
  30. Input
  31. 135
  32. 357
  33. 791
  34. 357
  35. 913
  36. 579
  37. 135
  38. Output
  39. 791
  40. 913
  41. 579
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement