Count Connected Components in LCM Graph
Join two numbers whenever their lcm is within the threshold, using union-find, and count the groups left.
Join two numbers whenever their lcm is within the threshold, using union-find, and count the groups left.