#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const long long M = 10000007;
long long f, T, t0;
long long a1, t1, p1;
long long a2, t2, p2;
void solv() {
  scanf("%lld%lld%lld", &f, &T, &t0);
  scanf("%lld%lld%lld", &a1, &t1, &p1);
  scanf("%lld%lld%lld", &a2, &t2, &p2);
  if (!(min(min(t1, t2), t0) * f <= T)) {
    printf("-1\n");
    return;
  }
  if (t1 > t2) {
    swap(t1, t2);
    swap(a1, a2);
    swap(p1, p2);
  }
  long long ans = M * M;
  if (f * t1 <= T) ans = min(ans, (f / a1 + !!(f % a1)) * p1);
  for (long long q1 = 0;; ++q1) {
    long long TT = T - q1 * a1 * t1;
    long long ff = f - q1 * a1;
    if (ff <= 0 || T < 0) {
      break;
    }
    if (!(min(t0, t2) * ff <= TT)) continue;
    if (ff * t0 <= TT) {
      ans = min(ans, q1 * p1);
      continue;
    }
    assert(t2 < t0);
    ans = min(ans, q1 * p1 + (ff / a2 + !!(ff % a2)) * p2);
    long long q2 = (TT - (ff * t0)) / (a2 * t2 - a2 * t0);
    if (((TT - (ff * t0)) % (a2 * t2 - a2 * t0))) ++q2;
    assert(q2 >= 1);
    ans = min(ans, q1 * p1 + q2 * p2);
  }
  assert(ans != M * M);
  printf("%lld\n", ans);
}
int main() {
  solv();
  return 0;
}
