func_code_string: #include <bits/stdc++.h>   using namespace std;   double res;   long long n, m, k, i, j, x = 1, y, t, a[1000001], b[1000001];   int main() {     cin >> n;     for (i = 1; i <= n; i++) {       cin >> t;       if (t == 1) {         cin >> k >> m;         a[k] += m;         y += k * m;         printf( %.10f , (double)y / x);         cout << endl;       }       if (t == 2) {         cin >> k;         y += k;         x++;         b[x] = k;         printf( %.10f , (double)y / x);         cout << endl;       }       if (t == 3) {         a[x - 1] += a[x];         y -= a[x] + b[x];         a[x] = 0;         x--;         printf( %.10f , (double)y / x);         cout << endl;       }     }   }   