(Coursera) Data Structures and Algorithms Specialization/Nagendra/Algorithmic Toolbox/week2_algorithmic_warmup/4_least_common_multiple/LCM.java
<filename>(Coursera) Data Structures and Algorithms Specialization/Nagendra/Algorithmic Toolbox/week2_algorithmic_warmup/4_least_common_multiple/LCM.javaimport java.util.*;

public class LCM {
  private static long lcm_naive(int a, int b) {
    for (long l = 1; l <= (long) a * b; ++l)
      if (l % a == 0 && l % b == 0)
        return l;

    return (long) a * b;
  }

  public static void main(String args[]) {
    Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    System.out.println(lcm_naive(a, b));
  }
}
