#include <bits/stdc++.h>   using namespace std;   struct Node {     int idx, sum;     int left, right;   } tree[3000000];   int cnt;   long long sumVal;   char ch[10];   void addNode(int cur, int def, int h, int val) {     if (tree[cur].idx == def) {       tree[cur].sum += val;       return;     }     tree[cur].sum += val;     if ((1 << (h)) & def) {       if (tree[cur].right == 0) {         tree[cur].right = ++cnt;         tree[cnt].idx = tree[cur].idx * 2 + 1;         tree[cnt].sum = 0;         tree[cnt].left = tree[cnt].right = 0;       }       addNode(tree[cur].right, def, h - 1, val);     } else {       if (tree[cur].left == 0) {         tree[cur].left = ++cnt;         tree[cnt].idx = tree[cur].idx * 2;         tree[cnt].sum = 0;         tree[cnt].left = tree[cnt].right = 0;       }       addNode(tree[cur].left, def, h - 1, val);     }   }   void decayNode(int cur, int h, int maxVal) {     if (h == 0) {       sumVal += max(maxVal, tree[cur].sum);       return;     }     int u = tree[cur].left, v = tree[cur].right;     if (tree[u].sum > tree[v].sum) {       long long t = max(maxVal, tree[cur].sum - tree[v].sum);       sumVal += (long long)(1 << (h - 1)) * t;       maxVal = max(maxVal, tree[cur].sum - tree[u].sum);       decayNode(u, h - 1, maxVal);     } else {       long long t = max(maxVal, tree[cur].sum - tree[u].sum);       sumVal += (long long)(1 << (h - 1)) * t;       maxVal = max(maxVal, tree[cur].sum - tree[v].sum);       decayNode(v, h - 1, maxVal);     }   }   int main(int argc, char** argv) {     int n, m, k, e;     scanf( %d%d , &n, &m);     cnt = 1;     tree[1].idx = 1;     tree[1].sum = 0;     tree[0].sum = 0;     tree[1].left = tree[1].right = 0;     for (int i = 1; i <= m; i++) {       scanf( %s , ch);       if (ch[0] ==  d ) {         sumVal = 0;         decayNode(1, n, 0);         double ans = (double)sumVal / (double)(1 << (n));         printf( %.8lf n , ans);       } else {         scanf( %d%d , &k, &e);         int h = 0, p = k / 2;         while (p) {           p /= 2;           h += 1;         }         addNode(1, k, h - 1, e);       }     }     return (EXIT_SUCCESS);   }   