#include <bits/stdc++.h>
using namespace std;
long long ceil(long long b1, long long b2) {
  if (b1 % b2) {
    return b1 / b2 + 1;
  }
  return b1 / b2;
}
long long min(long long a, long long b) {
  if (b < a) {
    return b;
  }
  return a;
}
long long inf = 1e18;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long f, T, t0, a1, t1, p1, a2, t2, p2;
  cin >> f >> T >> t0 >> a1 >> t1 >> p1 >> a2 >> t2 >> p2;
  long long b0 = f * t0 - T;
  if (b0 <= 0) {
    cout << 0 << '\n';
    return 0;
  }
  if (t0 <= t1 && t0 <= t2) {
    cout << -1 << '\n';
    return 0;
  }
  if (t0 <= t1 || t0 <= t2) {
    if (t0 <= t1) {
      swap(t1, t2);
      swap(p1, p2);
      swap(a1, a2);
    }
    long long c1 = ceil(b0, t0 - t1);
    if (c1 > f) {
      cout << -1 << '\n';
    } else {
      cout << p1 * ceil(c1, a1) << '\n';
    }
    return 0;
  }
  long long b1 = t0 - t1;
  long long b2 = t0 - t2;
  long long ans = inf;
  for (long long c1 = 0; c1 <= f; c1++) {
    if (b1 * c1 + b2 * (f - c1) < b0) {
      continue;
    }
    long long s = 0;
    long long e = f - c1;
    while (s < e) {
      long long mid = (s + e) / 2;
      if (b1 * c1 + b2 * mid >= b0) {
        e = mid;
      } else {
        s = mid + 1;
      }
    }
    ans = min(ans, p1 * ceil(c1, a1) + p2 * ceil(s, a2));
  }
  if (ans == inf) {
    cout << -1 << '\n';
  } else {
    cout << ans << '\n';
  }
}
