func_code_string: #include <bits/stdc++.h>   using namespace std;   long long a[5005];   long long dp[5005], mod = 998244353, bnd[5005], fac[5005], inv[5005];   long long qpow(long long a, long long b) {     long long ans = 1;     while (b) {       if (b & 1) ans = ans * a % mod;       b >>= 1;       a = a * a % mod;     }     return ans;   }   int main() {     int T = 1;     while (T--) {       int n;       cin >> n;       fac[0] = inv[0] = 1;       for (int i = 1; i <= n; i++)         scanf( %lld , &a[i]), fac[i] = fac[i - 1] * i % mod,                               inv[i] = qpow(fac[i], mod - 2);       sort(a + 1, a + n + 1);       if (a[n - 1] * 2LL > a[n]) {         puts( 0 );         continue;       }       for (int i = 1; i <= n; i++)         for (int j = 1; j < i; j++)           if (a[j] * 2 <= a[i]) bnd[i]++;       for (int i = 1; i <= n; i++)         for (int j = 0; j <= bnd[i]; j++) {           if (j == 0)             dp[i] += fac[n - 1] * inv[n - 1 - bnd[i]] % mod;           else             dp[i] += dp[j] * fac[n - bnd[j] - 2] % mod *                      inv[n - bnd[j] - 2 - (bnd[i] - bnd[j] - 1)] % mod,                 dp[i] %= mod;         }       printf( %lld n , dp[n]);     }     return 0;   }   