#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long f, T, t0;
  cin >> f >> T >> t0;
  long long a1, t1, p1;
  cin >> a1 >> t1 >> p1;
  long long a2, t2, p2;
  cin >> a2 >> t2 >> p2;
  if (t1 > t2) {
    swap(a1, a2);
    swap(t1, t2);
    swap(p1, p2);
  }
  if (t0 * f <= T) {
    cout << "0";
    return 0;
  }
  long long ans = (long long)1e18;
  long long z = (f + a1 - 1) / a1;
  for (long long i = 0; i <= z; i++) {
    long long cost = p1 * i;
    if (a1 * i >= f) {
      if (f * t1 > T) continue;
      ans = min(ans, cost);
      continue;
    }
    if (i * a1 * t1 >= T) {
      continue;
    }
    long long rem_time = T - t1 * i * a1, rem_data = f - a1 * i;
    if (log2(rem_data) + log2(t0) > log2(1e15)) continue;
    long long normally_taken_time = rem_data * t0;
    if (normally_taken_time <= rem_time) {
      ans = min(ans, cost);
      continue;
    }
    long long extra = normally_taken_time - rem_time;
    long long diff = t0 - t2;
    if (diff <= 0) continue;
    long long n = (extra + (diff - 1)) / diff;
    if (n > rem_data) continue;
    long long needed = (n + a2 - 1) / a2;
    cost += needed * p2;
    ans = min(ans, cost);
  }
  if (ans >= (long long)1e16) ans = -1;
  cout << ans;
  return 0;
}
