BlueBook - Digits and Sums

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem types
BlueBook

Write a program that will find all the three-digit natural numbers that are equal to the sum of the cubes of their digits. The range of numbers will be 100MN999. The input will be two numbers: M and N where M is the lesser 3 digit number and N is the greater 3 digit number.

Sample Input

Copy
100 200

Sample Output

Copy
153

Explanation for Sample Output

For example, the number 153=1×1×1+5×5×5+3×3×3 should be outputted.


Comments


  • 1
    fireheartjerry  commented on Jan. 23, 2023, 11:41 p.m.

    If there are multiple answers, separate them with a newline ('\n' in most languages).