malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int t;     cin >> t;     while (t > 0) {       string s1, s2;       cin >> s1 >> s2;       long long int f = 0;       if (s1.length() > s2.length()) {         cout <<  NO  << endl;         f = -1;       } else {         long long int i = 0, j = 0;         while (i < s1.length() || j < s2.length()) {           if (s2[j] == s1[i] && s2[j + 1] == s1[i + 1]) {             j++;             i++;           } else if (s2[j] == s1[i])             j++;           else if (s2[j] == s1[i + 1] && j > 0)             i++;           else {             cout <<  NO  << endl;             f = -1;             break;           }         }         if (f != -1) cout <<  YES  << endl;       }       t--;     }   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   void read(T &x) {     x = 0;     bool f = 0;     char c = getchar();     for (; !isdigit(c); c = getchar())       if (c ==  - ) f = 1;     for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);     if (f) x = -x;   }   template <typename F>   inline void write(F x, char ed =   n ) {     static short st[30];     short tp = 0;     if (x < 0) putchar( - ), x = -x;     do st[++tp] = x % 10, x /= 10;     while (x);     while (tp) putchar( 0  | st[tp--]);     putchar(ed);   }   template <typename T>   inline void Mx(T &x, T y) {     x < y && (x = y);   }   template <typename T>   inline void Mn(T &x, T y) {     x > y && (x = y);   }   const int N = 105;   const int P = 1e9 + 7;   long long dp[N][N][2], f[N][2], siz[N];   int h[N], ne[N << 1], to[N << 1], tot;   inline void add(int x, int y) { ne[++tot] = h[x], to[h[x] = tot] = y; }   void dfs(int x, int fa) {     dp[x][0][0] = dp[x][0][1] = siz[x] = 1;     for (int i = h[x], y; i; i = ne[i]) {       if ((y = to[i]) == fa) continue;       dfs(y, x);       memcpy(f, dp[x], sizeof(f));       memset(dp[x], 0, sizeof(dp[x]));       for (int j = 0; j < siz[x] + siz[y]; j++) {         for (int k = 0; k <= min(siz[x] - 1, (long long)j); k++) {           dp[x][j][0] = (dp[x][j][0] + f[k][0] * dp[y][j - k][1]) % P;           dp[x][j][1] = (dp[x][j][1] + f[k][1] * dp[y][j - k][1]) % P;           if (j != k) {             dp[x][j][0] = (dp[x][j][0] + f[k][0] * dp[y][j - k - 1][0]) % P;             dp[x][j][1] = (dp[x][j][1] + f[k][1] * dp[y][j - k - 1][0] +                            f[k][0] * dp[y][j - k - 1][1]) %                           P;           }         }       }       siz[x] += siz[y];     }   }   long long fpw(long long x, long long mi) {     long long res = 1;     for (; mi; mi >>= 1, x = x * x % P)       if (mi & 1) res = res * x % P;     return res;   }   long long mi[N], C[N][N], n;   int main() {     read(n);     for (int i = 1, x, y; i < n; i++) read(x), read(y), add(x, y), add(y, x);     dfs(1, 0);     mi[0] = fpw(n, P - 2) % P;     for (int i = 1; i <= n; i++) mi[i] = mi[i - 1] * n % P;     C[0][0] = 1;     for (int i = 1; i <= n; i++) {       C[i][0] = 1;       for (int j = 1; j <= n; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % P;     }     for (int i = 0; i <= n - 1; i++)       dp[1][i][1] = dp[1][i][1] * mi[n - i - 1] % P;     for (int i = 0; i <= n - 1; i++) {       long long ans = 0;       for (int k = i; k <= n - 1; k++)         if ((k - i) & 1)           ans -= C[k][i] * dp[1][k][1] % P;         else           ans += C[k][i] * dp[1][k][1] % P;       write(((ans % P) + P) % P,    );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 100010, M = 1505, mod = 1e9 + 7;   inline int qpow(int x, int y = mod - 2) {     int res = 1;     for (; y; y >>= 1, x = 1ll * x * x % mod)       if (y & 1) res = 1ll * res * x % mod;     return res;   }   int fac[N], inv[N];   inline int C(int x, int y) {     if (y < 0 || y > x) return 0;     return 1ll * fac[x] * inv[y] % mod * inv[x - y] % mod;   }   void C_init(int n) {     fac[0] = 1;     for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mod;     inv[n] = qpow(fac[n]);     for (int i = n - 1; ~i; i--) inv[i] = inv[i + 1] * (i + 1ll) % mod;   }   int n, m, p, np, k, B[M];   int pre_b[M], pre_bl[M];   void init() {     int a, b;     cin >> n >> m >> a >> b >> k;     p = 1ll * a * qpow(b) % mod, np = (1 - p + mod) % mod;     C_init(k);     for (int i = 0; i <= min(m - 1, k); ++i)       B[i] = 1ll * C(k, i) * qpow(p, i) % mod * qpow(np, k - i) % mod;     for (int i = 1; i <= m; ++i) pre_b[i] = (pre_b[i - 1] + B[i - 1]) % mod;   }   inline void add(int &x, int y) {     x += y;     if (x >= mod) x -= mod;   }   inline void sub(int &x, int y) {     x -= y;     if (x < 0) x += mod;   }   int L[M], F = 1;   void trans() {     static int S[M];     for (int i = 1; i <= m; ++i)       pre_bl[i] = (pre_bl[i - 1] + 1ll * B[i - 1] * L[i]) % mod;     for (int x = 1; x <= m; ++x)       S[x] = 1ll * B[m - x] *              (1ll * (F - L[m - x + 1] + mod) * pre_b[x] % mod - pre_bl[x] + mod) %              mod;     F = 0;     for (int i = 1; i <= m; ++i)       L[i] = (L[i - 1] + S[i - 1]) % mod, F = (F + S[i]) % mod;   }   int main() {     init();     while (n--) trans();     cout << F << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 5e5 + 5;   const long long L = 1e18 + 18;   int Z;   struct edge {     int s;     int t;     long long W;     int ind;     edge(int a, int b, long long c, int I) {       s = a;       t = b;       W = c;       ind = I;     }   };   struct cmp {     bool operator()(edge a, edge b) { return a.W > b.W; }   };   long long odl[N];   vector<edge> G[N];   vector<pair<long long, long long> > D[N];   void dfs(int v, int oj, int k);   int main() {     Z = 0;     int n, m, k;     scanf( %d%d%d , &n, &m, &k);     for (long long i = 1; i <= n; i++) odl[i] = L;     for (long long i = 1; i <= m; i++) {       long long a, b, c;       scanf( %lld%lld%lld , &a, &b, &c);       G[a].push_back(edge(a, b, c, i));       G[b].push_back(edge(b, a, c, i));     }     priority_queue<edge, vector<edge>, cmp> kol;     odl[1] = 0;     for (auto z : G[1]) kol.push(z);     while (!kol.empty()) {       edge X = kol.top();       kol.pop();       if (odl[X.t] < L) continue;       odl[X.t] = X.W;       D[X.s].push_back(make_pair(X.t, X.ind));       for (auto z : G[X.t]) {         if (odl[z.t] > X.W + z.W) {           kol.push(edge(z.s, z.t, z.W + X.W, z.ind));         }       }     }     k = min(k, n - 1);     printf( %d n , k);     dfs(1, 1, k);     if (k > 0) printf(  n );   }   void dfs(int v, int oj, int k) {     for (auto z : D[v]) {       if (z.first == oj) continue;       if (Z >= k) break;       printf( %lld  , z.second);       Z++;       dfs(z.first, v, k);     }   }
#include <bits/stdc++.h>   using namespace std;   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   #pragma GCC optimization( unroll-loops )   template <typename T, size_t N>   int SIZE(const T (&t)[N]) {     return N;   }   template <typename T>   int SIZE(const T &t) {     return t.size();   }   string to_string(const string s, int x1 = 0, int x2 = 1e9) {     return     + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) :   ) +    ;   }   string to_string(const char *s) { return to_string((string)s); }   string to_string(const bool b) { return (b ?  true  :  false ); }   string to_string(const char c) { return string({c}); }   template <size_t N>   string to_string(const bitset<N> &b, int x1 = 0, int x2 = 1e9) {     string t =   ;     for (int __iii__ = min(x1, SIZE(b)), __jjj__ = min(x2, SIZE(b) - 1);          __iii__ <= __jjj__; ++__iii__) {       t += b[__iii__] +  0 ;     }     return     + t +    ;   }   template <typename A, typename... C>   string to_string(const A(&v), int x1 = 0, int x2 = 1e9, C... coords);   int l_v_l_v_l = 0, t_a_b_s = 0;   template <typename A, typename B>   string to_string(const pair<A, B> &p) {     l_v_l_v_l++;     string res =  (  + to_string(p.first) +  ,   + to_string(p.second) +  ) ;     l_v_l_v_l--;     return res;   }   template <typename A, typename... C>   string to_string(const A(&v), int x1, int x2, C... coords) {     int rnk = rank<A>::value;     string tab(t_a_b_s,    );     string res =   ;     bool first = true;     if (l_v_l_v_l == 0) res +=   n ;     res += tab +  [ ;     x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));     auto l = begin(v);     advance(l, x1);     auto r = l;     advance(r, (x2 - x1) + (x2 < SIZE(v)));     for (auto e = l; e != r; e = next(e)) {       if (!first) {         res +=  ,  ;       }       first = false;       l_v_l_v_l++;       if (e != l) {         if (rnk > 1) {           res +=   n ;           t_a_b_s = l_v_l_v_l;         };       } else {         t_a_b_s = 0;       }       res += to_string(*e, coords...);       l_v_l_v_l--;     }     res +=  ] ;     if (l_v_l_v_l == 0) res +=   n ;     return res;   }   void dbgm() { ; }   template <typename Heads, typename... Tails>   void dbgm(Heads H, Tails... T) {     cerr << to_string(H) <<   |  ;     dbgm(T...);   }   const long long mod = 1e9 + 7;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cerr <<  ...............Console is yours! :).................           <<   n ;     long long n;     int m;     cin >> n >> m;     string num = to_string(n);     int l = num.length();     long long dp[1 << l][m];     memset(dp, 0, sizeof(dp));     long long fac = 1;     int count[10];     memset(count, 0, sizeof(count));     for (int i = 0; i < l; i++) fac *= ++count[num[i] -=  0 ];     dp[0][0] = 1;     for (int i = 0; i < 1 << l; i++) {       for (int j = 0; j < l; j++) {         if (!(i & (1 << j)) && (i || num[j])) {           for (int k = 0; k < m; k++)             dp[i | (1 << j)][(k * 10 + num[j]) % m] += dp[i][k];         }       }     }     cout << dp[(1 << l) - 1][0] / fac <<   n ;     cerr <<  ......^_^.....           <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using Int = long long;   template <typename T1, typename T2>   inline void chmin(T1 &a, T2 b) {     if (a > b) a = b;   }   template <typename T1, typename T2>   inline void chmax(T1 &a, T2 b) {     if (a < b) a = b;   }   struct FastIO {     FastIO() {       cin.tie(0);       ios::sync_with_stdio(0);     }   } fastio_beet;   signed main() {     Int n;     cin >> n;     vector<Int> bs(n);     for (Int i = 0; i < n; i++) cin >> bs[i];     map<Int, Int> sum;     for (Int i = 0; i < n; i++) sum[bs[i] - i] += bs[i];     Int ans = 0;     for (auto p : sum) chmax(ans, p.second);     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int LOG = 22;   int32_t main() {     ios::sync_with_stdio(false);     int n;     cin >> n;     vector<int> tab(n);     vector<int> dp(1 << LOG);     vector<pair<int, int> > samples(1 << LOG, {-1, -1});     auto update = [&](int a, int i) {       if (i == -1) return;       if (samples[a].first != -1) samples[a].second = i;       samples[a].first = i;     };     for (int i = 0; i < n; i++) {       cin >> tab[i];       dp[tab[i]]++;       update(tab[i], i);     }     for (int i = 0; i < LOG; i++) {       for (int m = 0; m < (1 << LOG); m++) {         if (m & (1 << i)) {           dp[m] += dp[m ^ (1 << i)];           update(m, samples[m ^ (1 << i)].first);           update(m, samples[m ^ (1 << i)].second);         }       }     }     for (int i = 0; i < n; i++) {       int a = tab[i] ^ ((1 << LOG) - 1);       if (samples[a].first == i)         cout << (samples[a].second == -1 ? -1 : tab[samples[a].second]) <<    ;       else         cout << (samples[a].first == -1 ? -1 : tab[samples[a].first]) <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   int s, x1, x2, t1, t2, p, d;   int main() {     cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;     int t = 0, flag1 = 0, flag2 = 0;     while (flag1 == 0 || flag2 == 0) {       if (flag1) {         if (p == x2) break;       } else if (p == x1)         flag1 = 1;       if (p == 0 || p == s) d = -d;       p += d;       t++;     }     cout << min(t * t1, abs(x1 - x2) * t2) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 998244353;   void run(istream &cin, ostream &cout) {     int n, m;     cin >> n >> m;     string a, b;     cin >> a >> b;     int diff = n - m;     if (diff > 0) {       b = string(diff,  0 ) + b;     } else {       a = string(-diff,  0 ) + a;     }     n = max(n, m);     vector<long long> suff(n);     for (int i = 0; i < n; i++) {       suff[i] = (b[i] ==  1 );       if (i > 0) {         suff[i] += suff[i - 1];       }     }     long long pw = 1, ans = 0;     for (int i = n - 1; i >= 0; i--) {       if (a[i] ==  1 ) {         ans = (ans + pw * suff[i] % mod) % mod;       }       pw = pw * 2 % mod;     }     cout << ans;   }   int main() {     cin.tie(0);     ios::sync_with_stdio(0);     run(cin, cout);     return 0;   }
#include <bits/stdc++.h>   int n, m, k;   int kex[101][101] = {0};   int main() {     scanf( %d%d%d , &n, &m, &k);     int i;     int x, y;     int have = 0;     for (i = 0; i < k; i++) {       scanf( %d%d , &x, &y);       if (x <= 5 || x >= n - 4 || y <= 5 || y >= m - 4) have = 1;     }     if (have)       printf( YES );     else       printf( NO );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int testcases;     cin >> testcases;     while (testcases) {       int n, s, t;       cin >> n >> s >> t;       if (s > t)         cout << (s - (s + t - n) + 1) <<   n ;       else         cout << (t - (s + t - n) + 1) <<   n ;       testcases--;     }     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize(2)   #pragma G++ optimize(2)   using namespace std;   const int MAX_N = 1e5 + 5;   long long n, k;   long long a[MAX_N], b[MAX_N];   bool use[MAX_N];   long long cal(int i, long long x) { return a[i] - 3 * x * x + 3 * x - 1; }   long long check(long long delta) {     long long sum = 0;     for (register int i = 1; i <= n; ++i) {       if (cal(i, 1) < delta) {         b[i] = 0, use[i] = false;         continue;       }       long long l = 1, r = a[i], mid, ans;       while (l <= r) {         mid = (l + r) >> 1;         if (cal(i, mid) >= delta)           l = mid + 1, ans = mid;         else           r = mid - 1;       }       b[i] = ans;       use[i] = (cal(i, ans) == delta);       sum += ans;     }     return sum;   }   int main() {     scanf( %lld , &n), scanf( %lld , &k);     for (register int i = 1; i <= n; ++i) scanf( %lld , &a[i]);     long long l = -4e18, r = 1e9, mid, ans;     while (l <= r) {       mid = (l + r) >> 1;       if (check(mid) >= k)         l = mid + 1, ans = mid;       else         r = mid - 1;     }     k -= check(ans);     for (int i = 1; i <= n && k < 0; i++)       if (use[i] && b[i]) ++k, --b[i];     for (register int i = 1; i <= n; ++i)       printf( %lld%c , b[i], i == n ?   n  :    );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e6 + 10;   int n;   long long k;   int a[N];   int main() {     cin >> n >> k;     k -= n * 1LL * (n + 1) / 2;     if (k < 0) {       printf( -1 n );       return 0;     }     iota(a + 1, a + n + 1, 1);     reverse(a + 1, a + n + 1);     long long added = 0;     for (int i = 1; i <= n / 2; i++) added += a[i] - i;     long long diff = max(0LL, added - k);     printf( %lld n , n * 1LL * (n + 1) / 2 + added - diff);     for (int i = 1; i <= n / 2; i++) {       if (diff >= a[i] - i) {         diff -= (a[i] - i);         swap(a[i], a[n + 1 - i]);       }     }     if (diff == 1) {       if (n % 2 == 1) {         a[n / 2] = n / 2 + 1;         a[n / 2 + 1] = n / 2;         a[n / 2 + 2] = n / 2 + 2;       } else {         a[n / 2 - 1] = n / 2;         a[n / 2] = n / 2 - 1;         a[n / 2 + 1] = n / 2 + 2;         a[n / 2 + 2] = n / 2 + 1;       }     }     for (int i = 1; i <= n; i++) printf( %d  , i);     printf(  n );     for (int i = 1; i <= n; i++) printf( %d  , a[i]);     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     vector<pair<double, string> > p(6);     p[0].first = 6 % 6;     p[0].second =  1/1 ;     p[1].first = 5 % 6;     p[1].second =  5/6 ;     p[2].first = 4 % 6;     p[2].second =  2/3 ;     p[3].first = 3 % 6;     p[3].second =  1/2 ;     p[4].first = 2 % 6;     p[4].second =  1/3 ;     p[5].first = 1 % 6;     p[5].second =  1/6 ;     vector<int> x(2);     for (int i = 0; i < 2; i++) cin >> x[i];     sort(x.begin(), x.end());     double prob = (7 - x[1]) % 6;     for (int i = 0; i < 6; i++) {       if (p[i].first == prob && x[1] <= 6) {         cout << p[i].second << endl;         return 0;       }     }     cout <<  0/1  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, b;   string a, c;   int main() {     cin >> n;     int l = -2e9, r = 2e9;     for (; n--;) {       cin >> a >> b >> c;       if (a ==  >  && c ==  Y  || a ==  <=  && c ==  N )         l = max(l, b + 1);       else if (a ==  >=  && c ==  Y  || a ==  <  && c ==  N )         l = max(l, b);       else if (a ==  <  && c ==  Y  || a ==  >=  && c ==  N )         r = min(r, b - 1);       else         r = min(r, b);     }     if (l > r)       puts( Impossible );     else       printf( %d , l);   }
#include <bits/stdc++.h>   using namespace std;   long long int n;   set<long long int> nos;   long long powmod(long long x, long long y, long long m) {     long long res = 1LL;     while (y) {       if (y & 1) res = (res * x) % m;       x = (x * x) % m;       y /= 2;     }     return res;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> n;     long long int ans = 1;     long long int buyt = 0;     long long int selt = INT64_MAX;     for (long long int i = 1; i <= n; i++) {       string s;       long long int val;       cin >> s >> val;       if (s ==  ADD )         nos.insert(val);       else {         nos.erase(val);         if (buyt < val && selt > val)           ans = (ans * 2) % 1000000007;         else if (buyt == val || selt == val)           ans = (ans * 1) % 1000000007;         else           ans = 0;         auto it = nos.upper_bound(val);         auto it1 = nos.lower_bound(val);         if (it != nos.end())           selt = *it;         else           selt = INT64_MAX;         if (it1 != nos.begin()) {           it1--;           buyt = *it1;         } else {           buyt = 0;         }       }     }     long long int m = 0;     for (auto it = nos.begin(); it != nos.end(); it++) {       long long int temp = *it;       if (temp > buyt && temp < selt) m++;     }     ans = (ans * (m + 1)) % 1000000007;     cout << ans <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   vector<int> cri[100100], notcri[100100];   int totalnot = 0;   int crinum[100100] = {}, notcrinum[100100] = {};   bool cand[100100];   int candnum = 0;   int claim[100100];   int main() {     int N, M;     scanf( %d%d , &N, &M);     for (int i = 1; i <= N; i++) {       scanf( %d , claim + i);       int num = claim[i];       if (num > 0) {         cri[num].push_back(i);         crinum[num]++;       } else {         notcri[-num].push_back(i);         notcrinum[-num]++;         totalnot++;       }     }     for (int c = 1; c <= N; c++) {       int lie = crinum[c] + totalnot - notcrinum[c];       if (lie != M) {         cand[c] = false;         continue;       }       cand[c] = true;       candnum++;     }     if (candnum == 1) {       int criminal;       for (int i = 1; i <= N; i++)         if (cand[i] == true) criminal = i;       for (int i = 1; i <= N; i++) {         if (claim[i] > 0 && claim[i] == criminal)           printf( Truth n );         else if (claim[i] > 0)           printf( Lie n );         if (claim[i] < 0 && claim[i] == -criminal)           printf( Lie n );         else if (claim[i] < 0)           printf( Truth n );       }     } else {       for (int i = 1; i <= N; i++) {         if (claim[i] > 0) {           if (cand[claim[i]] == false)             printf( Lie n );           else             printf( Not defined n );         } else {           if (cand[-claim[i]] == false)             printf( Truth n );           else             printf( Not defined n );         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long M = 1000000007;   const double pi = 3.141592653589793238463;   bool vow(char ch) {     return ch ==  a  || ch ==  e  || ch ==  i  || ch ==  o  || ch ==  u ;   }   bool isPrime(long long n) {     for (long long i = 2; i * i <= n; i++)       if (n % i == 0) return false;     return true;   }   long long fast_exp(long long x, long long n) {     long long ans = 1;     while (n) {       if (n & 1) {         ans *= x;         ans %= M;       }       n = n >> 1;       x = (x * x) % M;     }     return ans;   }   long long inverse(long long x) { return fast_exp(x, M - 2); }   long long comb(long long n, long long r) {     if (r == 0)       return 1;     else {       long long ans = n % M;       ans *= comb(n - 1, r - 1) % M;       ans %= M;       ans *= inverse(r) % M;       ans %= M;       return ans;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);     ;     long long n, m, k;     cin >> n >> m >> k;     cout << (comb(n - 1, 2 * k) % M * comb(m - 1, 2 * k) % M) % M;   }
#include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   int l3, l4, l5;   double calc3(double r) {     double x = r / 2;     double y = r / 6 * sqrt(3);     double z = sqrt(r * r - x * x - y * y);     double ret = z * r * r / 12 * sqrt(3);     return ret;   }   double calc4(double r) {     double x = r / 2;     double y = r / 2;     double z = sqrt(r * r - x * x - y * y);     double ret = z * r * r / 3;     return ret;   }   double calc5(double r) {     double x = r / 2;     double y = r / 2 * (sqrt(5) + 1) / sqrt(10 - 2 * sqrt(5));     double z = sqrt(r * r - x * x - y * y);     double ret = z * r * r * 5 / 4 / sqrt(5 - sqrt(20)) / 3;     return ret;   }   void run() {     scanf( %d%d%d , &l3, &l4, &l5);     printf( %.12lf n , calc3(l3) + calc4(l4) + calc5(l5));   }   int main() {     run();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 1e5 + 4;   string s, des[3];   int n, q, next_occur[26][MAX], dp[255][255][255];   void makeNO() {     for (int j = 0; j < 26; j++) next_occur[j][n + 1] = next_occur[j][n] = n;     for (int i = n - 1; i >= 0; i--) {       for (int j = 0; j < 26; j++) {         next_occur[j][i] = (s[i] -  a  == j ? i : next_occur[j][i + 1]);       }     }   }   void makeDp(int a, int b, int c) {     int& val = dp[a][b][c];     val = n;     if (a) val = min(val, next_occur[des[0][a - 1] -  a ][dp[a - 1][b][c] + 1]);     if (b) val = min(val, next_occur[des[1][b - 1] -  a ][dp[a][b - 1][c] + 1]);     if (c) val = min(val, next_occur[des[2][c - 1] -  a ][dp[a][b][c - 1] + 1]);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     ;     cin >> n >> q >> s;     makeNO();     dp[0][0][0] = -1;     while (q--) {       char o, c;       int rel_id;       cin >> o >> rel_id;       rel_id--;       if (o ==  + ) {         cin >> c;         des[rel_id] += c;         int max0 = des[0].size(), max1 = des[1].size(), max2 = des[2].size();         int min0 = rel_id == 0 ? max0 : 0;         int min1 = rel_id == 1 ? max1 : 0;         int min2 = rel_id == 2 ? max2 : 0;         for (int b = min1; b <= max1; b++)           for (int a = min0; a <= max0; a++)             for (int c = min2; c <= max2; c++) makeDp(a, b, c);       } else {         des[rel_id].pop_back();       }       bool answer = dp[des[0].size()][des[1].size()][des[2].size()] < n;       cout << (answer ?  YES n  :  NO n );     }   }