description: A sequence of integers b_1, b_2, …, b_m is called good if max(b_1, b_2, …, b_m) ⋅ min(b_1, b_2, …, b_m) ≥ b_1 + b_2 + … + b_m.
  
  A sequence of integers a_1, a_2, …, a_n is called perfect if every non-empty subsequence of a is good.
  
  YouKn0wWho has two integers n and M, M is prime. Help him find the number, modulo M, of perfect sequences a_1, a_2, …, a_n such that 1 ≤ a_i ≤ n + 1 for each integer i from 1 to n.
  
  A sequence d is a subsequence of a sequence c if d can be obtained from c by deletion of several (possibly, zero or all) elements.
  
  Input
  
  The first and only line of the input contains two space-separated integers n and M (1 ≤ n ≤ 200; 10^8 ≤ M ≤ 10^9). It is guaranteed that M is prime.
  
  Output
  
  Print a single integer — the number of perfect sequences modulo M.
  
  Examples
  
  Input
  
  
  2 998244353
  
  
  Output
  
  
  4
  
  
  Input
  
  
  4 100000007
  
  
  Output
  
  
  32
  
  
  Input
  
  
  69 999999937
  
  
  Output
  
  
  456886663
  
  Note
  
  In the first test case, the perfect sequences are [2, 2], [2, 3], [3, 2] and [3, 3].
  
  In the second test case, some of the perfect sequences are [3, 4, 3, 5], [4, 5, 4, 4], [4, 5, 5, 5] etc. One example of a sequence which is not perfect is [2, 3, 3, 4], because, for example, the subsequence [2, 3, 4] is not an good as 2 ⋅ 4 < 2 + 3 + 4.
solution: #include <bits/stdc++.h>
  using namespace std;
  const int N = 1 << 8;
  int mod;
  int qpow(int x, int y = mod - 2) {
    int res = 1;
    for (; y; x = (long long)x * x % mod, y >>= 1)
      if (y & 1) res = (long long)res * x % mod;
    return res;
  }
  int fac[N], ifac[N], inv[N];
  void init(int x) {
    fac[0] = ifac[0] = inv[1] = 1;
    for (int i = (2); i <= (x); ++i)
      inv[i] = (long long)(mod - mod / i) * inv[mod % i] % mod;
    for (int i = (1); i <= (x); ++i)
      fac[i] = (long long)fac[i - 1] * i % mod,
      ifac[i] = (long long)ifac[i - 1] * inv[i] % mod;
  }
  int C(int x, int y) {
    return x < y || y < 0 ? 0
                          : (long long)fac[x] * ifac[y] % mod * ifac[x - y] % mod;
  }
  int n, dp[N][N], ns;
  int main() {
    ios ::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> mod;
    init(n + 1);
    for (int mn = (max(n - 20, 0)); mn <= (n + 1); ++mn) {
      memset(dp, 0, sizeof(dp));
      for (int i = (1); i <= (min(mn, n)); ++i) dp[i][0] = ifac[i];
      for (int i = (mn + 1); i <= (n + 1); ++i)
        for (int a = (i - 1); a >= (1); --a)
          for (int b = (0); b <= (mn); ++b)
            if (dp[a][b]) {
              int up =
                  min(min(i - a, (mn * (i - a) - b) / i), (mn - b) / (i - mn));
              for (int k = (1); k <= (up); ++k)
                (dp[a + k][b + (i - mn) * k] +=
                 (long long)ifac[k] * dp[a][b] % mod) %= mod;
            }
      for (int i = (0); i <= (mn); ++i) (ns += dp[n][i]) %= mod;
    }
    cout << (long long)ns * fac[n] % mod << '\n';
    return 0;
  }
  