Easy30 pts
Modified Kaprekar Numbers
A modified Kaprekar number n satisfies: square n, split the square into left part l and right part r (where r has exactly d digits, d = number of digits in n), then l + r = n. Find all such numbers in range [p, q]. Example: n=45 → square=2025 → split: l=20, r=25 (r has 2 digits, same as n) → 20+25=45 ✓. If no numbers found, output 'INVALID RANGE'.
Input
Two integers p and q (p ≤ q), one per line.
Output
Print all modified Kaprekar numbers in the range, space-separated, or 'INVALID RANGE' if none exist.
Sample
1 100
Expected
1 9 45 55 99
Loading editor…
Output
No output yet. Run your code to see results.