typedeflonglong ll; constint N = 1e9 + 5, M = 60; int n; int P[M], vis[M], cnt; ll tot, ans;
voidinit(int n){ for (int i = 2; i <= n; i++) { if (!vis[i]) P[++cnt] = i; for (int j = 1; j <= cnt && P[j] * i <= n; j++) { vis[P[j] * i] = 1; if (i % P[j] == 0) break; } } } voiddfs(int x, int lst, ll num, ll v){ if (num > tot || (num == tot && v < ans)) ans = v, tot = num; int cnt = 0; while (v * P[x] <= n && cnt < lst) { v *= P[x]; cnt++; dfs(x + 1, cnt, num * (cnt + 1), v); } }