Go to diff to previous submission
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Fl { static int max(int x, int y) { return x > y ? x : y; } static int nsn(int a, int b) { int res = max(a, b); while (res <= a * b) { if ((res % a == 0) && (res % b == 0)) { break; } res++; } return res; } static int lotion(int n) { int x, y, a, b, c, res, nsn; x = n + 1; res = 0; while (x <= 2 * n) { nsn = x * n; //System.out.println(nsn); a = nsn / n; b = nsn / x; c = a - b; if ((nsn % b == 0) && (nsn % c == 0)) { y = nsn / c; //System.out.println(String.format("%d: {%d, %d}", n, x, y)); res++; } x++; } return res; } /** * @param args */ String line; while ((line = in.readLine()) != null && line.length() > 2) { } } }
--- c5.s998.cteam060.fl.java.0.Fl.java +++ c5.s1016.cteam060.fl.java.0.Fl.java @@ -31,5 +31,6 @@ while (x <= 2 * n) { - nsn = nsn(n, x); + nsn = x * n; + //System.out.println(nsn); a = nsn / n;