test
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
const int mod = 998244353;
const int N = 1e5 + 10;
long long a[N];
int main()
{
long long ans = 1;
int n;
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> a[i];
sort(a + 1, a + n + 1);
for (int i = 1; i <= n; ++i)
ans = (ans * __gcd(a[i], 1ll * i - 1)) % mod;
cout << ans << '\n';
return 0;
}

浙公网安备 33010602011771号