Skip to content

Instantly share code, notes, and snippets.

@dalcon10028
Created January 21, 2020 12:31
Show Gist options
  • Select an option

  • Save dalcon10028/926b874aac75fd894e164ff0f6c70113 to your computer and use it in GitHub Desktop.

Select an option

Save dalcon10028/926b874aac75fd894e164ff0f6c70113 to your computer and use it in GitHub Desktop.
import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
BigInteger a = new BigInteger(sc.next());
BigInteger b = new BigInteger(sc.next());
sc.close();
System.out.println(a.gcd(b));
System.out.print(a.multiply(b).divide(a.gcd(b)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment