#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long f, T, t0;
long long roll(long long a1, long long t1, long long p1, long long a2,
               long long t2, long long p2) {
  long long best = INF;
  for (long long x1 = 0; x1 <= (long long)1e7; x1++) {
    long long bytes = min(f, x1 * a1);
    if (bytes * t1 > T) {
      break;
    }
    long long cur_T = T - bytes * t1;
    long long cur_f = f - bytes;
    long long wasted = x1 * p1;
    long long time_with_zero = cur_f * t0;
    if (time_with_zero <= cur_T) {
      best = min(best, wasted);
      continue;
    }
    long long may_upgrade = t0 - t2;
    if (may_upgrade == 0) {
      continue;
    }
    long long to_recover = time_with_zero - cur_T;
    long long bytes2 = (to_recover + may_upgrade - 1) / may_upgrade;
    if (bytes2 <= cur_f) {
      long long x2 = (bytes2 + a2 - 1) / a2;
      wasted += x2 * p2;
      best = min(best, wasted);
    }
  }
  return best;
}
int main() {
  long long a1, t1, p1;
  long long a2, t2, p2;
  cin >> f >> T >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  t1 = min(t1, t0);
  t2 = min(t2, t0);
  long long ans =
      min(roll(a1, t1, p1, a2, t2, p2), roll(a2, t2, p2, a1, t1, p1));
  if (ans < INF) {
    cout << ans << '\n';
  } else {
    cout << -1 << '\n';
  }
  return 0;
}
