insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Print all Spy numbers in a range (a number where sum of digits equals product of digits, e.g., 1124).

Print all Spy numbers in a range (a number where sum of digits equals product of digits, e.g., 1124).

Difficulty: Medium

Phase: 6 · Mixed Logical Challenges

XP Reward: 20 XP

Topics: Mixed Logical Challenges, Medium

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Given range L and R on separate lines, print all Spy numbers (digit sum equals digit product) separated by space. Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input: 1000 1200

Output: 1124 1142

Explanation: Sample execution for input 1000 1200