func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 8;   const int M = 100010;   const int INF = 1 << 30;   int n, q;   map<int, int> sum, val;   void init() {     sum.clear();     val.clear();   }   void add(int p, int v) {     if (val.find(p) == val.end()) val[p] = 0;     val[p] += v;     while (p) {       if (sum.find(p) == sum.end()) sum[p] = 0;       sum[p] += v;       p /= 2;     }   }   double dfs(int h, int u, double Max) {     if (h == n) {       if (val.find(u) == val.end())         return 0.0;       else         return max(Max, (double)val[u]);     }     int l = u * 2, r = u * 2 + 1;     double L = (sum[u] - sum[r]);     double R = (sum[u] - sum[l]);     double ans1 = max(Max, R);     double ans2 = max(Max, L);     if ((double)sum[l] > Max) ans1 = max(ans1, dfs(h + 1, l, ans1));     if ((double)sum[r] > Max) ans2 = max(ans2, dfs(h + 1, r, ans2));     return (ans1 + ans2) * 0.5;   }   void solve() {     char qry[3];     while (q--) {       scanf( %s , &qry);       if (qry[0] ==  a ) {         int p, v;         scanf( %d %d , &p, &v);         add(p, v);       } else {         double res = dfs(0, 1, 0.0);         printf( %.10lf n , res);       }     }   }   int main() {     while (cin >> n >> q) {       init();       solve();     }   }   