import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main { public static void main(String[] args) { Main p = new Main(); } public Main() { Scanner sc = new Scanner(System.in); int[] a = new int[sc.nextInt()]; for(int i=0;i{ int lcm; int num; public LcmNumber(int lcm, int num){ this.lcm =lcm; this.num = num; } @Override public int compareTo(LcmNumber o) { if(this.lcm!=o.lcm) return this.lcm-o.lcm; else return this.num - o.num; } } private int gcm(int a, int b){ if(a%b==0) return b; else return gcm(b, a%b); } private int lcm(int a, int b){ return a*b/(gcm(a, b)); } }