#include <bits/stdc++.h>
using namespace std;
template <class T>
istream &operator>>(istream &in, pair<T, T> &p) {
  in >> p.first >> p.second;
  return in;
}
template <class T>
ostream &operator<<(ostream &out, pair<T, T> &p) {
  out << p.first << ' ' << p.second;
  return out;
}
template <class Tuple, std::size_t N>
struct TuplePrinter {
  static void print(ostream &out, const Tuple &t) {
    TuplePrinter<Tuple, N - 1>::print(out, t);
    out << ' ' << get<N - 1>(t);
  }
};
template <class Tuple>
struct TuplePrinter<Tuple, 1> {
  static void print(ostream &out, const Tuple &t) { out << get<0>(t); }
};
template <class... Args>
ostream &operator<<(ostream &out, const tuple<Args...> &p) {
  TuplePrinter<decltype(p), sizeof...(Args)>::print(out, p);
  return out;
}
long long F, T, t0;
long long a1, t1, p1;
long long a2, t2, p2;
long long ans = 1e18;
bool check(int pakai, long long sisa_T, long long sisa_F) {
  return (sisa_T < 0) ? 0 : (sisa_T / t2) >= sisa_F;
}
long long check2(int pakai, long long sisa_T, long long sisa_F) {
  if (sisa_T < 0) return 1e18;
  if (sisa_F <= 0) return 0;
  long long bisa = (sisa_T / t2);
  long long beli = (sisa_F + a2 - 1) / a2;
  if (bisa >= sisa_F) return beli * p2;
  return 1e18;
}
long long solve(long long sisa_T, long long sisa_F) {
  long long l = 0, r = sisa_F, res = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid, sisa_T - mid * t0, sisa_F - mid)) {
      l = mid + 1, res = mid;
    } else {
      r = mid - 1;
    }
  }
  return check2(res, sisa_T - res * t0, sisa_F - res);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> F >> T >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  if (t0 * F <= T) {
    cout << "0\n";
    return 0;
  }
  for (long long waktu = 0, price = 0; waktu <= T;
       waktu += a1 * t1, price += p1) {
    long long now = solve(T - waktu, F - waktu / t1) + price;
    ans = min(ans, now);
  }
  swap(a1, a2);
  swap(t1, t2);
  swap(p1, p2);
  for (long long waktu = 0, price = 0; waktu <= T;
       waktu += a1 * t1, price += p1) {
    long long now = solve(T - waktu, F - waktu / t1) + price;
    ans = min(ans, now);
  }
  if (ans >= 1e18)
    cout << "-1\n";
  else
    cout << ans << "\n";
}
