#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
constexpr int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
constexpr int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);
  }
} iosetup;

template <typename Abelian>
struct BIT {
  BIT(int n, const Abelian ID = 0) : n(n), ID(ID), dat(n, ID) {}

  void add(int idx, Abelian val) {
    while (idx < n) {
      dat[idx] += val;
      idx |= idx + 1;
    }
  }

  Abelian sum(int idx) const {
    Abelian res = ID;
    --idx;
    while (idx >= 0) {
      res += dat[idx];
      idx = (idx & (idx + 1)) - 1;
    }
    return res;
  }

  Abelian sum(int left, int right) const {
    return left < right ? sum(right) - sum(left) : ID;
  }

  Abelian operator[](const int idx) const { return sum(idx, idx + 1); }

  int lower_bound(Abelian val) const {
    if (val <= ID) return 0;
    int res = 0, exponent = 1;
    while (exponent <= n) exponent <<= 1;
    for (int mask = exponent >> 1; mask > 0; mask >>= 1) {
      if (res + mask - 1 < n && dat[res + mask - 1] < val) {
        val -= dat[res + mask - 1];
        res += mask;
      }
    }
    return res;
  }

private:
  int n;
  const Abelian ID;
  std::vector<Abelian> dat;
};

int main() {
  int n, m, q; cin >> n >> m >> q;
  vector<int> t(q), x(q), y(q); REP(i, q) cin >> t[i] >> x[i] >> y[i], --t[i], --x[i];
  vector<int> z = y;
  z.emplace_back(0);
  sort(ALL(z));
  z.erase(unique(ALL(z)), z.end());
  int l = z.size();
  vector<int> a[2]{vector<int>(n, 0), vector<int>(m, 0)};
  BIT<int> num[2]{BIT<int>(l), BIT<int>(l)};
  num[0].add(0, n);
  num[1].add(0, m);
  BIT<ll> sum[2]{BIT<ll>(l), BIT<ll>(l)};
  ll ans = 0;
  REP(i, q) {
    int c = t[i], d = t[i] ^ 1, idx = lower_bound(ALL(z), a[c][x[i]]) - z.begin();
    ans -= 1LL * num[d].sum(0, idx) * a[c][x[i]];
    ans -= sum[d].sum(idx, l);
    num[c].add(idx, -1);
    sum[c].add(idx, -a[c][x[i]]);
    idx = lower_bound(ALL(z), y[i]) - z.begin();
    ans += 1LL * num[d].sum(0, idx) * y[i];
    ans += sum[d].sum(idx, l);
    num[c].add(idx, 1);
    sum[c].add(idx, y[i]);
    a[c][x[i]] = y[i];
    cout << ans << '\n';
  }
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef unsigned long long ull;

#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define ep emplace_back
#define EL printf("\n")
#define sz(A) (int) A.size()
#define FOR(i,l,r) for (int i=l;i<=r;i++)
#define FOD(i,r,l) for (int i=r;i>=l;i--)
#define fillchar(a,x) memset(a, x, sizeof (a))
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL);

double MIN = 0;
int main()
{
    faster;
    int n;
    double D, H;
    cin >> n >> D >> H;
    FOR(i,1,n) {
        int d, h;
        cin >> d >> h;
        double d1 = D - d, h1 = H - h;
        double l = (h1 / d1) * D;
        MIN = max(MIN, H - l);
    }
    cout << MIN;
    return 0;
}
