@@ -0,0 +1,893 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A  private static int digits(int n) %7B%0A    int d = 0;%0A    while (n %3E 0) %7B%0A      n /= 10;%0A      d++;%0A    %7D%0A    return d;%0A  %7D%0A%0A  public static void printKaprekarNumbers(int p, int q) %7B%0A    boolean found = false;%0A    for (int i = p; i %3C= q; i++) %7B%0A      int d = digits(i);%0A      long sq = (long) Math.pow(i, 2);%0A      long del = (long) Math.pow(10, d);%0A      long r = sq %25 del;%0A      long l = sq / del;%0A      if (l + r == i) %7B%0A        found = true;%0A        System.out.print(i + %22 %22);%0A      %7D%0A    %7D%0A    if (!found) %7B%0A      System.out.print(%22INVALID RANGE%22);%0A    %7D%0A    System.out.println();%0A  %7D%0A%0A  public static void main(String%5B%5D args) %7B%0A    Scanner in = new Scanner(System.in);%0A    int p = in.nextInt();%0A    int q = in.nextInt();%0A    printKaprekarNumbers(p, q);%0A  %7D%0A%7D%0A

add solution