#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#define ll long long
using namespace std;
int	main(){
	double x1,x2,y1,y2;
	cin>>x1>>y1>>x2>>y2;
	double ans=(y1/(y1+y2))*(x2-x1)+x1;
	printf("%.8lf",ans);
}

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _lint = int;
#define REP(i, n) for (_lint i = 0; i < (_lint)(n); i++)
#define FOR(i, a, b) for (_lint i = (_lint)(a); i < (_lint)(b); i++)
#define FORR(i, a, b) for (_lint i = (_lint)(b)-1; i >= (_lint)(a); i--)

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))
#define ALL(v) (v).begin(), (v).end()

#define DEBUG(x) cerr << #x << ": " << (x) << endl
#define DEBUG_VEC(v)                                                           \
  {                                                                            \
    cerr << #v << ": ";                                                        \
    REP(__i, size(v)) cerr << ((v)[__i]) << ", ";                              \
    cerr << endl;                                                              \
  }

int n, m, q;
pair<int, pii> qs[252521];
int a[252521], b[252521];

template <typename T> struct DynBit {
  unordered_map<int, T> dat;
  int N;
  DynBit(int N) : N(N + 2) {}
  void add(int a, T w) {
    a++;
    for (int x = a; x <= N; x += x & -x)
      dat[x] += w;
  }
  T sum(int a) {
    a++;
    T ret = 0;
    for (int x = a; x > 0; x -= x & -x)
      ret += dat[x];
    return ret;
  }
};

int main() {
  scanf("%d%d%d", &n, &m, &q);
  REP(i, q) {
    scanf("%d%d%d", &qs[i].first, &qs[i].second.first, &qs[i].second.second);
  }
  // sum_i sum_j max(a_i, b_j)
  // a_i の寄与
  //   a_i * count_j (a_i > b_j)
  //   元の寄与が sum_j b_j (b_j < a_i)
  // b_j の寄与
  //   b_j * count_i (b_j >= a_i)
  const int mx = 100'000'025;
  DynBit<int> cnt1(mx), cnt2(mx);
  DynBit<ll> sum1(mx), sum2(mx);
  cnt1.add(0, n);
  cnt2.add(0, m);
  ll ans = 0;
  REP(qi, q) {
    int t = qs[qi].first;
    int x, y;
    tie(x, y) = qs[qi].second;
    if (t == 1) {
      // back
      if (a[x] > 0) {
        ll c = cnt2.sum(a[x] - 1);
        ll s = sum2.sum(a[x] - 1);
        ans -= c * a[x] - s;
      }
      cnt1.add(a[x], -1);
      sum1.add(a[x], -a[x]);
      // go
      a[x] = y;
      ll c = cnt2.sum(a[x] - 1);
      ll s = sum2.sum(a[x] - 1);
      ans += c * a[x] - s;
      cnt1.add(a[x], 1);
      sum1.add(a[x], a[x]);
    } else {
      // back
      if (b[x] > 0) {
        ll c = cnt1.sum(b[x]);
        ll s = sum1.sum(b[x]);
        ans -= c * b[x] - s;
      }
      cnt2.add(b[x], -1);
      sum2.add(b[x], -b[x]);
      // go
      b[x] = y;
      ll c = cnt1.sum(b[x]);
      ll s = sum1.sum(b[x]);
      ans += c * b[x] - s;
      cnt2.add(b[x], 1);
      sum2.add(b[x], b[x]);
    }
    printf("%lld\n", ans);
  }
  return 0;
}
