cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> a[i]; if (a[i] <= m) ++cnt[a[i]]; } for (int i = 1; i <= m; ++i) for (int j = i; j <= m; j += i) f[j] += cnt[i]; int p = max_element(f + 1, f + m + 1) - f; cout << p << " " << f[p] << "\n"; for (int i = 1; i <= n; ++i) if (p % a[i] == 0) cout << i << " "; cout << "\n"; return0; }