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;
  constexpr int MaxN = 200 + 5, MaxSqrt = 20 + 5;
  constexpr long long Infinity = (1LL << 62);
  inline int QuickPow(const int val, const int lev, const int Mod) {
    if (!lev) return 1;
    if (lev & 1) return ((long long)QuickPow(val, lev ^ 1, Mod) * val) % Mod;
    const int Half = QuickPow(val, lev >> 1, Mod);
    return ((long long)Half * Half) % Mod;
  }
  inline int Inverse(const int val, const int Mod) {
    return QuickPow(val, Mod - 2, Mod);
  }
  int Fac[MaxN], Inv[MaxN], dp[MaxN][MaxSqrt][MaxN];
  bitset<MaxN> Bitset[MaxN][MaxSqrt];
  inline int Dynamic_Programming(const int n, const int a, const int i,
                                 const int x, const int Sum, const int Mod) {
    if (Bitset[i][x][Sum]) return dp[i][x][Sum];
    Bitset[i][x][Sum] = true;
    long long Record = 0;
    if (!x)
      Record = (((i <= a) && (!Sum)) ? ((long long)Fac[n] * Inv[i]) : 0);
    else {
      const int Lef = ((i <= a) ? 0 : ((i + 1) - a)), Rig = ((n + 1) - a);
      if ((Lef <= x) && (x <= Rig))
        for (register int j = (i); j >= (1); --j) {
          if (Sum < ((i - j) * x)) break;
          if ((Record +=
               ((long long)Inv[i - j] *
                Dynamic_Programming(n, a, j, x - 1, Sum - ((i - j) * x), Mod))) &
              Infinity)
            Record %= Mod;
        }
    }
    return (dp[i][x][Sum] = (Record % Mod));
  }
  int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int n, Mod;
    cin >> n >> Mod, Fac[0] = 1;
    for (register int i = (1); i <= (n); ++i)
      Fac[i] = ((long long)Fac[i - 1] * i) % Mod;
    Inv[n] = Inverse(Fac[n], Mod);
    for (register int i = (n); i >= (1); --i)
      Inv[i - 1] = ((long long)Inv[i] * i) % Mod;
    const int Limit = max(1, (int)((n - sqrt(n << 1)) - 2));
    long long Answer = 0;
    for (register int a = (Limit); a <= (n + 1); ++a) {
      memset(dp, 0, sizeof(dp));
      memset(Bitset, 0, sizeof(Bitset));
      for (register int i = (0); i <= (a); ++i)
        Answer += Dynamic_Programming(n, a, n, ((n + 1) - a), i, Mod);
    }
    cout << (Answer %= Mod) << endl;
    return 0;
  }
  