intgcd(int a, int b){ return b == 0?a:gcd(b, a%b); } intmain() { int m; int a[2000]; scanf("%d", &m); set<int> S; for (int i = 0; i < m; i++){ scanf("%d", a + i); S.insert(a[i]); } int g = a[0]; for (int i = 1; i < m; i++) g = gcd(g, a[i]); if (S.count(g)){ printf("%d\n%d", 2 * m - 1, a[0]); for (int i= 1; i < m; i++) printf(" %d %d", g, a[i]); printf("\n"); } elseprintf("-1\n"); }