malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   string s;   int main() {     getline(cin, s);     int n, flag = 0;     n = s.length();     for (int i = n; i >= 0; i--) {       if ((s[i] >=  a  && s[i] <=  z ) || (s[i] >=  A  && s[i] <=  Z )) {         if (s[i] ==  a  || s[i] ==  e  || s[i] ==  i  || s[i] ==  o  ||             s[i] ==  u  || s[i] ==  y  || s[i] ==  A  || s[i] ==  E  ||             s[i] ==  I  || s[i] ==  O  || s[i] ==  U  || s[i] ==  Y ) {           flag = 1;         }         break;       }     }     if (flag) {       cout <<  YES n ;     } else {       cout <<  NO n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<long long> arr;   pair<int, long long> doit(long long n) {     if (n <= 7) return make_pair(n, n);     vector<long long>::iterator ite = upper_bound(arr.begin(), arr.end(), n);     int ind = (ite - arr.begin());     ind--;     pair<int, long long> te1 = doit(n - arr[ind]);     pair<int, long long> te2 = doit(arr[ind] - 1 - arr[ind - 1]);     if (te1.first > te2.first)       return make_pair(te1.first + 1, te1.second + arr[ind]);     if (te1.first < te2.first)       return make_pair(te2.first + 1, te2.second + arr[ind - 1]);     if (te1.second + arr[ind] > te2.second + arr[ind - 1])       return make_pair(te1.first + 1, te1.second + arr[ind]);     return make_pair(te2.first + 1, te2.second + arr[ind - 1]);   }   int main() {     for (long long i = 0; i <= 100001; i++) {       arr.push_back(i * i * i);     }     long long m;     cin >> m;     pair<int, long long> temp = doit(m);     cout << temp.first <<     << temp.second;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double xp, yp, vp;   double x, y, v, r;   const double pi = acos(-1);   double cal(double x0, double y0, double x1, double y1) {     double ji = x0 * x1 + y0 * y1;     double L0 = sqrt(x0 * x0 + y0 * y0);     double L1 = sqrt(x1 * x1 + y1 * y1);     double cosA = ji / L0 / L1;     double A = acos(cosA);     double s = L1 * L0 * sin(A) / (double)2;     double l = sqrt((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));     double dis = s * (double)2 / l;     if (dis >= r || (L0 * L0 + l * l - L1 * L1) < 0 ||         (L1 * L1 + l * l - L0 * L0) < 0)       return l;     double a0 = acos(r / L0);     double a1 = acos(r / L1);     double Lsum = r * (A - a0 - a1) + L0 * sin(a0) + L1 * sin(a1);     return Lsum;   }   bool s(double t) {     double R = sqrt(xp * xp + yp * yp);     double a = acos(xp / R);     if (yp < 0) a = -a + 2 * pi;     a = a + t * vp / R;     double x0 = R * cos(a);     double y0 = R * sin(a);     double t0 = cal(x0, y0, x, y) / v;     if (t0 <= t)       return true;     else       return false;   }   int main() {     cin >> xp >> yp >> vp;     cin >> x >> y >> v >> r;     double l = 0, r = 1e4, mid;     while (r - l > 1e-9) {       mid = (r + l) / (double)2;       if (s(mid))         r = mid;       else         l = mid;     }     printf( %.10lf , mid);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     std::ios::sync_with_stdio(false);     cin.tie(0);     int t, i, n, j, e;     char grid[8][8];     map<int, bool> black, white;     for (i = 0; i < 8; i++) {       cin >> grid[i];     }     int min = INT_MAX;     int flag = 0;     for (i = 0; i < 8; i++) {       for (j = 0; j < 8; j++) {         if (grid[i][j] ==  W ) {           int x = i;           int y = j;           int f = 1;           while (x >= 0) {             if (grid[x][j] ==  B ) {               f = 0;               break;             }             x--;           }           if (f == 1) {             if (min >= i) {               min = i;               flag = 0;             }           }         }         if (grid[i][j] ==  B ) {           int x = i;           int y = j;           int f = 1;           while (x < 8) {             if (grid[x][j] ==  W ) {               f = 0;               break;             }             x++;           }           if (f == 1) {             if (min > (7 - i)) {               min = 7 - i;               flag = 1;             }           }         }       }     }     if (flag == 0)       cout <<  A ;     else       cout <<  B ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   void coder_RB6() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);   }   bool comp(long long int a, long long int b) { return (a > b); }   int32_t main() {     coder_RB6();     long long int t;     cin >> t;     while (t--) {       long long int n;       cin >> n;       vector<long long int> a;       for (long long int i = 0; i < n; i++) {         long long int x;         cin >> x;         a.push_back(x);       }       long long int flag = 0;       long long int index;       for (long long int i = 1; i < n - 1; i++) {         if (a[i] > a[i - 1] && a[i] > a[i + 1]) {           flag = 1;           index = i;           break;         }       }       if (flag == 1) {         cout <<  YES  << endl;         cout << index <<     << index + 1 <<     << index + 2 << endl;       } else {         cout <<  NO  << endl;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int n, m, f, t;   const int N = 1e3 + 5;   vector<int> adj[N];   int col[N], vis[N], row[N];   int dj[N][N];   int mn = -1e9, id = 1;   void dfs(int u, int ret) {     if (u == n + 1) {       ret = 0;       for (int i = 1; i <= 6; i++) {         for (int j = i; j <= 6; j++) {           dj[i][j] = 0;         }       }       for (int i = 1; i <= n; i++) {         for (auto j : adj[i]) {           int c = col[i];           int k = col[j];           if (!dj[c][k] && c <= k) {             ret++;             dj[c][k] = 1;           }         }       }       mn = max(mn, ret);       return;     }     for (int i = 1; i <= 6; i++) {       if (!col[u]) {         col[u] = i;         dfs(u + 1, 0);         col[u] = 0;       }     }   }   int main() {     cin >> n >> m;     while (m--) {       cin >> f >> t;       adj[f].push_back(t);       adj[t].push_back(f);     }     dfs(1, 1);     cout << mn <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   int dot[510];   inline long double max(long double a, long double b) { return a > b ? a : b; }   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) {       scanf( %d , dot + i);     }     double ans = 0.0;     for (int i = 1; i <= m; i++) {       int x, y, z;       scanf( %d%d%d , &x, &y, &z);       if (z > 0) {         ans = max(ans, (long double)(dot[x] + dot[y]) / z);       }     }     cout << setiosflags(ios::fixed) << setprecision(10) << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   const long long int BOUND = 1.5e6;   const long long int SQ_BOUND = BOUND * BOUND;   vector<complex<long long int> > arr;   long long int s[N];   inline long long int norm_sq(const complex<long long int> &z) {     return (z * conj(z)).real();   }   long long int greedy(long long int sgn) {     complex<long long int> o{0, 0};     reverse((arr).begin(), (arr).end());     o = (s[0] = sgn) * arr[0];     for (int i = 1; i < (int)arr.size(); ++i) {       complex<long long int> po = o + arr[i];       complex<long long int> ne = o - arr[i];       if (norm_sq(po) <= norm_sq(ne)) {         s[i] = 1;         o = po;       } else {         s[i] = -1;         o = ne;       }     }     reverse((arr).begin(), (arr).end());     return norm_sq(o);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     srand(time(NULL));     int n;     cin >> n;     for (int i = 0; i < n; ++i) {       int x, y;       cin >> x >> y;       arr.emplace_back(x, y);     }     long long int cur, sgn = 1;     do {       cur = greedy(sgn);       if (!~sgn) random_shuffle((arr).begin(), (arr).end());       sgn = -sgn;     } while (cur > SQ_BOUND);     for (int i = n - 1; i >= 0; --i) cout << s[i] <<    n [i + 1 == n];     return 0;   }
//  Say:He is the Most Merciful,We have believed in him and upon him we have relied  [67:29]       //#pragma GCC optimize ( Ofast )   //#pragma GCC target ( avx2 )   //#pragma GCC optimize( unroll-loops )       #include<bits/stdc++.h>   using namespace std;                                                           /*   #include <ext/pb_ds/assoc_container.hpp>   #include <ext/pb_ds/tree_policy.hpp>   using namespace __gnu_pbds;   template<typename T>   using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;    */       typedef long long ll;   typedef long double ld;   typedef pair<ll,ll> pll;   typedef pair<int,int> pii;   typedef vector<ll> vll;   typedef vector<int> vii;   typedef map<int,int> mpi;   typedef map<ll,ll> mpl;   typedef unordered_map<int,int> umpi;   typedef unordered_map<ll,ll> umpl;       #define ump unordered_map   #define mod 1000000007   #define inf 1000000000000000006   #define infi 2000000009   #define ff first   #define ss second   #define pb push_back   #define all(v) v.begin(), v.end()   #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)   #define endl   n    #define pi acos(-1.0)   #define dec(n) fixed << setprecision(n)   #define N 300005   //#define int long long      inline void IO(string name) { // Usaco        freopen((name +  .in ).c_str(),  r , stdin);        freopen((name +  .out ).c_str(),  w , stdout);   }      ll n,a[N],t[N],k,d[N];   vector<pii> v;   void solve(){    cin >> n >> k;    for(int i=0;i<k;i++) cin >> a[i];    for(int i=0;i<k;i++) cin >> t[i];    priority_queue<pii> pq;    for(int i=1;i<=n;i++) d[i]=infi;    for(int i=0;i<k;i++){     pq.push({-t[i],a[i]});     d[a[i]]=t[i];    }    //int cc=0;    while(!pq.empty()){     //cc++;     int u=pq.top().ss,c=-pq.top().ff;     pq.pop();     if(u-1!=0 && d[u-1]>c+1){      d[u-1]=c+1;      pq.push({-d[u-1],u-1});     }     if(u+1!=n+1 && d[u+1]>c+1){      d[u+1]=c+1;      pq.push({-d[u+1],u+1});     }    }    for(int i=1;i<=n;i++) cout << d[i] <<    ;    cout << endl;    //cout << cc << endl;       }      signed main(){       fastio;       //srand(chrono::steady_clock::now().time_since_epoch().count());       int T=1,cs=0;       cin >> T;       while(T--){           //cout <<  Case   << ++cs <<  :  <<     ;         solve();       }    }
#include <bits/stdc++.h>   using namespace std;   int num[100 + 5][100 + 5], ans[100 + 5][100 + 5];   int row[100 + 5], col[100 + 5];   int main() {     int n, m;     while (scanf( %d%d , &m, &n) != EOF) {       int i, j, k;       int ii, jj, kk;       memset(row, 0, sizeof(row));       memset(col, 0, sizeof(col));       for (i = 0; i < m; i++) {         for (j = 0; j < n; j++) {           scanf( %d , &num[i][j]);           row[i] += num[i][j];           col[j] += num[i][j];         }       }       for (i = 0; i < m; i++) {         for (j = 0; j < n; j++) {           ans[i][j] = 1;         }       }       for (i = 0; i < m; i++) {         for (j = 0; j < n; j++) {           if (num[i][j] == 0) {             for (ii = 0; ii < m; ii++) ans[ii][j] = 0;             for (jj = 0; jj < n; jj++) ans[i][jj] = 0;           }         }       }       bool ok = true;       for (i = 0; i < m; i++) {         for (j = 0; j < n; j++) {           int tp = 0;           for (ii = 0; ii < m; ii++) tp |= ans[ii][j];           for (jj = 0; jj < n; jj++) tp |= ans[i][jj];           if (tp != num[i][j]) {             ok = false;             break;           }         }         if (!ok) break;       }       if (ok) {         printf( YES n );         for (i = 0; i < m; i++) {           for (j = 0; j < n; j++) {             if (j) printf(   );             printf( %d , ans[i][j]);           }           printf(  n );         }       } else         printf( NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 501;   int n, m, a[N];   bool dp[2][N][N];   vector<int> sol;   int main() {     scanf( %d%d , &n, &m);     for (int i = 0; i < n; ++i) scanf( %d , &a[i]);     dp[0][0][0] = dp[0][a[0]][0] = dp[0][a[0]][a[0]] = true;     int at = 0;     for (int i = 1; i < n; ++i) {       at ^= 1;       for (int j = 0; j <= m; ++j)         for (int k = 0; k <= m; ++k) {           dp[at][j][k] = dp[at ^ 1][j][k];           if (a[i] <= j) dp[at][j][k] |= dp[at ^ 1][j - a[i]][k];           if (a[i] <= j && a[i] <= k && k <= j)             dp[at][j][k] |= dp[at ^ 1][j - a[i]][k - a[i]];         }     }     for (int i = 0; i <= m; ++i)       if (dp[at][m][i]) sol.push_back(i);     printf( %d n , (int)sol.size());     for (int i = 0; i < (int)sol.size(); ++i)       printf( %s%d , i ?     :   , sol[i]);     puts(  );     return 0;   }
#include <bits/stdc++.h>   template <typename T>   inline void read(T& x) {     T res = 0, flag = 1;     char ch;     ch = getchar();     while (!isdigit(ch)) {       if (ch ==  - ) flag = -1;       ch = getchar();     }     while (isdigit(ch)) {       res = res * 10 + ch - 48;       ch = getchar();     }     x = res * flag;   }   const int N = 300000 + 1;   int n, m, a[N], f[N];   inline bool check(int x) {     for (int i = 1; i <= n; ++i) {       f[i] = a[i];       if (f[i] >= f[i - 1]) {         if (f[i] + x >= m)           if ((f[i] + x) % m >= f[i - 1]) f[i] = f[i - 1];       } else {         if (f[i] + x >= f[i - 1])           f[i] = f[i - 1];         else           return 0;       }     }     return 1;   }   int main() {     read(n), read(m);     for (int i = 1; i <= n; ++i) read(a[i]);     int l = 0, r = m;     while (l < r) {       int mid = l + r >> 1;       if (check(mid))         r = mid;       else         l = mid + 1;     }     printf( %d n , l);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int n, a;       vector<int> v;       cin >> n;       for (int i = 0; i < n; i++) {         cin >> a;         v.push_back(a);       }       reverse(v.begin(), v.end());       for (int i = 0; i < n; i++) {         cout << v[i] <<    ;       }       cout << endl;     }   }
#include <bits/stdc++.h>   #pragma gcc optimize(o3)   using namespace std;   long long qpow(long long x, long long y) {     return y ? (y & 1 ? x * qpow(x, y - 1) % 1000000007                       : qpow(x * x % 1000000007, y / 2))              : 1;   }   template <typename T>   inline void read(T& x) {     x = 0;     char c;     int sign = 1;     do {       c = getchar();       if (c ==  - ) sign = -1;     } while (!isdigit(c));     do {       x = x * 10 + c -  0 ;       c = getchar();     } while (isdigit(c));     x *= sign;   }   long long a, b, x, y, k;   long long gcd(long long p, long long q) {     if (q == 0) return p;     return gcd(q, p % q);   }   int main() {     read(a), read(b), read(x), read(y);     k = gcd(x, y);     x /= k, y /= k;     printf( %I64d n , min(a / x, b / y));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = (long long)(2e5 + 1);   bool bipartite = true;   vector<long long> colour;   vector<long long> adj[N];   vector<long long> visited;   void dfs(long long node, long long par, long long col) {     visited[node] = 1;     colour[node] = col;     for (auto it : adj[node]) {       if (!visited[it])         dfs(it, node, !col);       else if (it != par and colour[it] == colour[node])         bipartite = false;     }   }   signed main() {     long long n, m;     cin >> n >> m;     vector<pair<long long, long long>> edges;     colour = vector<long long>(n, -1);     visited = vector<long long>(n, 0);     for (long long i = 0; i < m; i++) {       long long u, v;       cin >> u >> v;       u--, v--;       adj[v].push_back(u);       adj[u].push_back(v);       edges.push_back({u, v});     }     dfs(0, -1, 0);     if (!bipartite) {       cout <<  NO n ;       return 0;     }     cout <<  YES n ;     for (long long i = 0; i < m; i++) {       long long ele1 = edges[i].first;       long long ele2 = edges[i].second;       cout << (colour[ele1] < colour[ele2]);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char buf[10000001], *ptr = buf - 1;   inline int read() {     int x = 0, c = *++ptr;     while (c < 48) c = *++ptr;     while (c > 47) x = x * 10 + c -  0 , c = *++ptr;     return x;   }   const int MAXN = 500005;   const int MOD = 1000000007;   int s[MAXN], a[MAXN], b[MAXN];   int c[MAXN], cnt[MAXN];   int n;   inline int add(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }   inline void modify(int i, int t) {     while (i <= n) s[i] = add(s[i], t), i += i & -i;   }   inline int query(int i) {     int res = 0;     while (i) res = add(res, s[i]), i -= i & -i;     return res;   }   int main(int argc, char const *argv[]) {     fread(buf, 1, sizeof(buf), stdin)[buf] = 0;     int x, ans = 0;     n = read();     for (int i = 1; i <= n; ++i) b[i] = c[i] = a[i] = read();     sort(b + 1, b + 1 + n);     for (int i = 1; i <= n; ++i) {       x = lower_bound(b + 1, b + 1 + n, a[i]) - b;       modify(x, i);       cnt[i] = (cnt[i] + (long long)query(x - 1) * (n - i + 1)) % MOD;     }     memset(s, 0, sizeof(s));     reverse(a + 1, a + 1 + n);     for (int i = 1; i <= n; ++i) {       x = lower_bound(b + 1, b + 1 + n, a[i]) - b;       modify(x, i);       cnt[n - i + 1] =           (cnt[n - i + 1] + (long long)query(x - 1) * (n - i + 1)) % MOD;     }     for (int i = 1; i <= n; ++i)       ans = (ans + (cnt[i] + (long long)i * (n - i + 1)) % MOD * c[i]) % MOD;     printf( %d , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MaxN = 1e5;   int m, n;   long long sum[MaxN + 5], a[MaxN + 5];   long long Gcd(long long x, long long y) {     if (y == 0)       return x;     else       return Gcd(y, x % y);   }   void pdo() {     long long ans = 0;     for (int i = 1; i <= n; i++) {       long long t1 = a[i] * (i - 1) - sum[i - 1];       long long t2 = sum[n] - sum[i] - a[i] * (n - i);       ans += a[i] + t1 + t2;     }     long long t = Gcd(ans, (long long)n);     printf( %I64d %I64d n , ans / t, n / t);   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %I64d , &a[i]);     sort(a + 1, a + n + 1);     for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];     pdo();   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( sse,sse2,sse3,ssse3,sse4 )   using namespace std;   using ll = long long;   using ld = long double;   using itn = int;   using dd = double;   mt19937 gen(41);   const dd eps = 1e-7;   const ll MAXN = 2097152;   const ll INF = 1e9;   const dd pi = acos(dd(-1));   ll gcd(ll a, ll b) {     a = abs(a);     b = abs(b);     while (b) {       a %= b;       swap(a, b);     }     return a;   }   ll binpow(ll a, ll n, ll binpow_mod = 1e9 + 7) {     ll res = 1;     while (n) {       if (n & 1) res *= a;       a *= a;       n >>= 1;       a %= binpow_mod;       res %= binpow_mod;     }     return res;   }   struct Point {     ll x, y;     bool z;     void scan() { cin >> x >> y; }     Point(ll X = 0, ll Y = 0, bool Z = 0) {       x = X;       y = Y;       z = Z;     }     ll operator*(Point &a) { return x * a.y - y * a.x; }     bool operator==(Point &a) { return x == a.x && y == a.y; }   };   ll n, m, k;   deque<ll> a;   ll solve() {     vector<ll> b((n + m - 1) / m, 0), c((n + m - 1) / m, -1e10);     ll now = 0;     for (int i = 0; i < n; i++) {       now += a[i];       c[i / m] = max(c[i / m], now);       if (i % m == m - 1) {         b[i / m] = now;         now = 0;       }     }     ll ans = c[0] - k, sum = 0, min_sum = 0;     for (int r = 0; r < b.size(); ++r) {       sum += c[r] - k;       ans = max(ans, sum - min_sum);       sum = sum - c[r] + b[r];       min_sum = min(min_sum, sum);     }     return ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout << fixed << setprecision(20);     cin >> n >> m >> k;     a.resize(n);     for (int i = 0; i < n; i++) {       cin >> a[i];     }     ll res = 0;     for (int k = 0; k < min(n, m); k++) {       res = max(res, solve());       a.pop_front();       n = a.size();     }     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   #define ll long long int   ll mod=1e9+7;   ll mul(ll a,ll b)   {       return ((a%mod)*(b%mod))%mod;   }   ll add(ll a,ll b)   {       return ((a%mod)+(b%mod))%mod;   }   ll sub(ll a,ll b)   {       return ((a%mod)-(b%mod)+mod)%mod;   }   ll po(ll a, ll b)   {       if(b==0)       {           return 1;       }       ll t=po(a,b/2);       if(b%2)       {           return mul(t,mul(t,a));       }       else       {           return mul(t,t);       }   }   ll  a[200005];   ll mseg[1000000];   ll maseg[1000000];   void mupd(ll s, ll e, ll i)   {    if(s==e)    {     mseg[i]=a[s];     return;    }    ll mi=s+(e-s)/2;    mupd(s,mi,2*i+1);    mupd(mi+1,e,2*i+2);    mseg[i]=min(mseg[2*i+1],mseg[2*i+2]);    return;   }   void maupd(ll s, ll e, ll i)   {    if(s==e)    {     maseg[i]=a[s];     return;    }    ll mi=s+(e-s)/2;    maupd(s,mi,2*i+1);    maupd(mi+1,e,2*i+2);    maseg[i]=max(maseg[2*i+1],maseg[2*i+2]);    return;   }   ll mir(ll s, ll e, ll i,ll chs, ll che)   {    if(s>che || e<chs)    {     return 1e18;    }    if(s<=chs && e>=che)    {     return mseg[i];    }    ll mi=chs+(che-chs)/2;    return min(mir(s,e,2*i+1,chs,mi),mir(s,e,2*i+2,mi+1,che));   }   ll mar(ll s, ll e, ll i,ll chs, ll che)   {    if(s>che || e<chs)    {     return -1e18;    }    if(s<=chs && e>=che)    {     return maseg[i];    }    ll mi=chs+(che-chs)/2;    return max(mar(s,e,2*i+1,chs,mi),mar(s,e,2*i+2,mi+1,che));   }   int main()   {       ios_base::sync_with_stdio(false);       cin.tie(NULL);       cout.tie(NULL);       ll t;       cin>>t;       while(t--)       {        ll n,q;        cin>>n>>q;        a[0]=0;        string s;        cin>>s;        for(ll i=0;i<n;i++)        {         if(s[i]== - )         {          a[i+1]=a[i]-1;         }         else         {          a[i+1]=a[i]+1;         }         //cout<<a[i+1]<<   ;        }        //cout<<  n ;        mupd(0,n,0);        maupd(0,n,0);        while(q--)        {         ll l,r;         cin>>l>>r;         ll u1=mir(0,l-1,0,0,n);         ll u2=mar(0,l-1,0,0,n);;         ll s1=0,s2=0;         //cout<<u1<<   <<u2<<  n ;         if(r+1<=n)         {          s1=mir(r+1,n,0,0,n);          s2=mar(r+1,n,0,0,n);;                    s1=s1-a[r];          s2=s2-a[r];         }         //cout<<u1<<   <<u2<<   <<s1<<   <<s2<<  n ;         ll mi=min((ll)0,u1);         ll ma=max((ll)0,u2);         mi=min(a[l-1]+s1,mi);         ma=max(a[l-1]+s2,ma);         cout<<ma-mi+1<<  n ;        }       }       return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int dp[50][50];   int m, n;   int main() {     for (int x = 0; x < 36; x++) {       dp[0][x] = 1;     }     for (int x = 1; x < 36; x++)       for (int y = 1; y < 36; y++)         for (int z = 0; z < x; z++) {           dp[x][y] += dp[z][y - 1] * dp[x - z - 1][y - 1];         }     cin >> m >> n;     cout << dp[m][35] - dp[m][n - 1] << endl;   }