@@ -0,0 +1,768 @@
+import java.util.*;%0Aimport java.util.function.Function;%0Aimport static java.lang.Math.*;%0Aimport java.util.stream.*;%0A%0A/*%0AProblem name: 11634 Generate random numbers%0AProblem url: https://uva.onlinejudge.org/external/116/11634.pdf%0AAuthor: Andrey Yemelyanov%0A*/%0Apublic class _11634 %7B%0A  public static void main(String%5B%5D args)%7B%0A    Scanner s = new Scanner(System.in);%0A    while(s.hasNext())%7B%0A      int a0 = s.nextInt(); if(a0 == 0) break;%0A      System.out.println(countDistinct(a0));%0A    %7D%0A  %7D%0A%0A  static int countDistinct(int a0)%7B%0A    int count = 0;%0A    boolean%5B%5D dat = new boolean%5B10000%5D;%0A    int a = a0;%0A    while(!dat%5Ba%5D)%7B%0A      dat%5Ba%5D = true;%0A      a = func(a);%0A      count++;%0A    %7D%0A    return count;%0A  %7D%0A%0A  static int func(int x)%7B%0A    return (x * x / 100) %25 10000;%0A  %7D%0A%7D%0A

11634 Generate random numbers