#include <bits/stdc++.h>
using namespace std;
long long f, T, t0;
long long a1, t1, p1;
long long a2, t2, p2;
bool check(int n1, int n2) {
  long long F = f;
  long long M1 = min(n1 * a1, F);
  long long t = M1 * t1;
  if (t > T) return false;
  F -= M1;
  long long M2 = min(n2 * a2, F);
  t += M2 * t2;
  if (t > T) return false;
  F -= M2;
  t += F * t0;
  return t <= T;
}
int main(void) {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cin >> f >> T >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  if (t1 > t2) {
    swap(a1, a2);
    swap(t1, t2);
    swap(p1, p2);
  }
  if (f * t0 <= T) {
    cout << 0 << '\n';
    return 0;
  }
  if (f * t1 > T && f * t2 > T) {
    cout << -1 << '\n';
    return 0;
  }
  long long n1 = (f + a1 - 1) / a1;
  long long n2 = (f + a2 - 1) / a2;
  long long ans = 1e18;
  for (long long i1 = 0; i1 <= 2e7; i1++) {
    long long F = f;
    long long M1 = min(i1 * a1, F);
    F -= M1;
    long long t = T - M1 * t1;
    long long tt = F * t0;
    if (tt <= t) {
      long long res = i1 * p1;
      ans = min(ans, res);
      continue;
    }
    if (t2 >= t0) continue;
    long long dt = tt - t;
    long long dtt = t0 - t2;
    long long f2 = dt / dtt;
    long long n2 = f2 / a2;
    for (long long i2 = n2; i2 <= n2 + 10; i2++) {
      if (!check(i1, i2)) continue;
      long long res = i1 * p1 + i2 * p2;
      ans = min(ans, res);
    }
  }
  if (ans == 1e18) {
    cout << -1 << '\n';
    return 0;
  }
  cout << ans << '\n';
  return 0;
}
