import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
public static int numeroAleatorio(int a, int b) {
final int min
= Math.
min(a, b
); final int max
= Math.
max(a, b
);
return min
+ (int)(Math.
random() * ((max
- min
) + 1)); }
public static int numeroAleatorio2(int a, int b) {
final int min
= Math.
min(a, b
); final int max
= Math.
max(a, b
);
return min + r.nextInt((max - min) + 1);
}
{
System.
out.
println(numeroAleatorio
(1000,
9999)); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyBpbnQgbnVtZXJvQWxlYXRvcmlvKGludCBhLCBpbnQgYikgewoJCWZpbmFsIGludCBtaW4gPSBNYXRoLm1pbihhLCBiKTsKCQlmaW5hbCBpbnQgbWF4ID0gTWF0aC5tYXgoYSwgYik7CgkJCgkJcmV0dXJuIG1pbiArIChpbnQpKE1hdGgucmFuZG9tKCkgKiAoKG1heCAtIG1pbikgKyAxKSk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgaW50IG51bWVyb0FsZWF0b3JpbzIoaW50IGEsIGludCBiKSB7CgkJZmluYWwgaW50IG1pbiA9IE1hdGgubWluKGEsIGIpOwoJCWZpbmFsIGludCBtYXggPSBNYXRoLm1heChhLCBiKTsKCQkKCQlSYW5kb20gciA9IG5ldyBSYW5kb20oKTsKCQlyZXR1cm4gbWluICsgci5uZXh0SW50KChtYXggLSBtaW4pICsgMSk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN5c3RlbS5vdXQucHJpbnRsbihudW1lcm9BbGVhdG9yaW8oMTAwMCwgOTk5OSkpOwoJfQp9