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;
  using ll = long long;
  const int N = 205;
  int M;
  void reduceR(int &x) { x += M & (x >> 31); }
  int reduceN(int x) { return x + (M & (x >> 31)); }
  int add(int x, int y) { return reduceN(x + y - M); }
  int sub(int x, int y) { return reduceN(x - y); }
  void inc(int &x, int y) { reduceR(x += y - M); }
  void dec(int &x, int y) { reduceR(x -= y); }
  int power(int x, int y) {
    int p = 1;
    for (; y; y >>= 1, x = (ll)x * x % M)
      if (y & 1) p = (ll)p * x % M;
    return p;
  }
  int inv(int x) { return power(x, M - 2); }
  int n;
  int dp[N][30][N];
  int fac[N], ifac[N];
  int lim[N];
  void prefac(int n) {
    fac[0] = 1;
    for (int i = 1; i <= n; ++i) fac[i] = (ll)fac[i - 1] * i % M;
    ifac[n] = inv(fac[n]);
    for (int i = n; i; --i) ifac[i - 1] = (ll)ifac[i] * i % M;
  }
  int solve(int st) {
    int min_sum = 0;
    for (int i = st + 1; i <= n; ++i) min_sum += i - st;
    if (min_sum > st) return 0;
    for (int i = 1; i <= st; ++i) lim[i] = 0;
    for (int i = st + 1; i <= n; ++i) lim[i] = i + 1 - st;
    int V = n + 1 - st;
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= st; ++i) dp[i][0][0] = ifac[i];
    for (int i = 1; i < n; ++i)
      for (int lst = 0; lst <= V; ++lst)
        for (int sum = 0; sum <= st; ++sum) {
          if (!dp[i][lst][sum] || (lst + 1) * (n - i - 1) + sum + V > st)
            continue;
          for (int val = lst + 1; val <= V; ++val)
            for (int j = i + 1, s = sum + val; j <= n && val >= lim[j] && s <= st;
                 ++j, s += val)
              dp[j][val][s] =
                  (dp[j][val][s] + (ll)dp[i][lst][sum] * ifac[j - i]) % M;
        }
    ll ans = 0;
    for (int s = 0; s <= st; ++s) ans += dp[n][V][s];
    return ans % M * fac[n] % M;
  }
  int main() {
    scanf("%d%d", &n, &M);
    prefac(n);
    ll ans = 1;
    for (int i = 1; i <= n + 1; ++i) ans += solve(i);
    printf("%lld\n", ans % M);
    return 0;
  }
  