#include <bits/stdc++.h>
using namespace std;
int f, T, t0;
int a1, t1, p1;
int a2, t2, p2;
void solveStupid() {
  if (1LL * f * t0 <= T) {
    cout << 0;
  } else {
    cout << -1;
  }
  exit(0);
}
void solve(int a, int t, int p) {
  if (1LL * t * f > T) {
    cout << -1;
    exit(0);
  }
  long long ans = 1LL * (f + a - 1) / a * p;
  for (int i = 0; i < (f + a - 1) / a; i++) {
    int timeLeft = T - i * a * t;
    int bytesLeft = f - i * a;
    if (timeLeft >= 1LL * bytesLeft * t0) {
      ans = min(ans, 1LL * i * p);
    }
  }
  cout << ans;
  exit(0);
}
bool can(int i1, int i2) {
  long long bytesLeft = f - 1LL * i1 * a1;
  long long timeLeft = T - min(f, i1 * a1) * t1;
  if (timeLeft < 0) return 0;
  if (1LL * i1 * a1 >= f) return 1;
  timeLeft = timeLeft - min(bytesLeft, 1LL * i2 * a2) * t2;
  bytesLeft = bytesLeft - 1LL * a2 * i2;
  if (timeLeft < 0) return 0;
  if (bytesLeft <= 0) return 1;
  return 1LL * bytesLeft * t0 <= timeLeft;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> f >> T >> t0;
  cin >> a1 >> t1 >> p1 >> a2 >> t2 >> p2;
  if (t0 <= t1 && t0 <= t2) {
    solveStupid();
  } else if (t0 <= t1) {
    solve(a2, t2, p2);
  } else if (t0 <= t2) {
    solve(a1, t1, p1);
  }
  long long ans = 1LL << 60;
  if (t1 > t2) {
    swap(t1, t2);
    swap(a1, a2);
    swap(p1, p2);
  }
  long long currCost = -p1;
  int pt = (f + a2 - 1) / a2;
  for (int i = 0; i <= (f + a1 - 1) / a1; i++) {
    currCost += p1;
    int bytesLeft = f - i * a1;
    int timeLeft = T - min(f, i * a1) * t1;
    while (pt != 0 && can(i, pt - 1)) pt--;
    if (can(i, pt)) {
      ans = min(ans, currCost + 1LL * pt * p2);
    }
  }
  if (ans == 1LL << 60) {
    cout << -1;
  } else {
    cout << ans;
  }
  return 0;
}
