#include <bits/stdc++.h>
using namespace std;
long long int f, t, t0, a1, t1, p1, a2, t2, p2;
bool possible(long long int pc, long long int f, long long int t,
              long long int a, long long int tl) {
  if (a * pc >= f) {
    if (f * tl > t) return false;
    return true;
  }
  long long int mul = tl * a;
  long long int divi = t / mul;
  if (pc > divi) return false;
  if (pc * mul > t) return false;
  long long int remf = f - a * pc, remt = t - pc * mul;
  return t0 * remf <= remt;
}
long long int solvesingle(long long int f, long long int t, long long int a,
                          long long int tl, long long int pr) {
  if (t == 0) return -1;
  long long int lo = 0, hi = (f / a) + 1, mid, ret = -1;
  if (f % a == 0) hi--;
  if (possible(lo, f, t, a, tl)) return 0;
  if (hi == 1) {
    if (possible(hi, f, t, a, tl)) return pr;
    return -1;
  }
  if (!possible(hi - 1, f, t, a, tl)) {
    if (possible(hi, f, t, a, tl)) return pr * hi;
    return -1;
  }
  long long int den = a * (t0 - tl);
  long long int num = f * t0 - t;
  long long int mix = (num + den - 1) / den;
  return mix * pr;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> f >> t >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  if (t0 <= t1 && t0 <= t2) {
    if (t0 * f <= t)
      cout << "0\n";
    else
      cout << "-1\n";
    return 0;
  }
  if (t0 <= t1)
    cout << solvesingle(f, t, a2, t2, p2) << '\n';
  else if (t0 <= t2)
    cout << solvesingle(f, t, a1, t1, p1) << '\n';
  else {
    long long int ans = -1;
    for (long long int pc1 = 0; (pc1 - 1) * a1 < f; ++pc1) {
      if (min(a1 * pc1, f) * t1 > t) break;
      long long int cc = pc1 * p1;
      if (a1 * pc1 >= f) {
        if (ans == -1)
          ans = cc;
        else
          ans = min(ans, cc);
      } else {
        long long int ret =
            solvesingle(f - a1 * pc1, t - a1 * t1 * pc1, a2, t2, p2);
        if (ret != -1) {
          if (ans == -1)
            ans = cc + ret;
          else
            ans = min(ans, cc + ret);
        }
      }
    }
    for (long long int pc2 = 0; (pc2 - 1) * a2 < f; ++pc2) {
      if (min(a2 * pc2, f) * t2 > t) break;
      long long int cc = pc2 * p2;
      if (a2 * pc2 >= f) {
        if (ans == -1)
          ans = cc;
        else
          ans = min(ans, cc);
      } else {
        long long int ret =
            solvesingle(f - a2 * pc2, t - a2 * t2 * pc2, a1, t1, p1);
        if (ret != -1) {
          if (ans == -1)
            ans = cc + ret;
          else
            ans = min(ans, cc + ret);
        }
      }
    }
    cout << ans << '\n';
  }
}
