func_code_string: #include <bits/stdc++.h>   using namespace std;   void solve() {     long long n, t, a, x, cur = 0, sum = 0, sz = 1;     cin >> n;     vector<long long> arr(n + 20), ch(n + 20);     for (int i = 0; i < n; i++) {       cin >> t;       if (t == 1) {         cin >> a >> x;         ch[a - 1] += x;         sum += a * x;       } else if (t == 2) {         cin >> x;         sum += x;         arr[++cur] = x;       } else {         sum -= (arr[cur] + ch[cur]);         ch[cur - 1] += ch[cur];         ch[cur] = 0;         arr[cur] = 0;         cur--;       }       cout << (sum * 1.0) / (1.0 * (cur + 1)) <<   n ;     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cout << fixed << setprecision(12);     solve();     return 0;   }   