#include <bits/stdc++.h>
using namespace std;
const long long infll = 0x7f7f7f7f7f7f7f7fll;
long long f, T, t0;
long long a[2], t[2], p[2];
template <class T>
inline T &minimize(T &a, const T &b) {
  if (a > b) a = b;
  return a;
}
template <class T>
inline T &maximize(T &a, const T &b) {
  if (a < b) a = b;
  return a;
}
long long answer() {
  long long ans = infll;
  for (int k = 0; k < 2; k++) {
    for (long long c0 = 0;; c0++) {
      long long f1 = max(0ll, f - a[0] * c0);
      long long p1 = p[0] * c0, t1 = T - t[0] * (f - f1), pls = t0 * f1 - t1;
      if (t1 < 0) break;
      if (f1 <= 0 || pls <= 0)
        minimize(ans, p1);
      else if (t0 > t[1]) {
        long long mns = (t0 - t[1]) * a[1], c1 = (pls + mns - 1) / mns;
        long long f2 = max(0ll, f1 - a[1] * c1), t2 = t1 - t[1] * (f1 - f2),
                  p2 = p[1] * c1;
        if (t2 >= 0 && (f2 <= 0 || t0 * f2 <= t2)) minimize(ans, p1 + p2);
      }
      if (a[0] * c0 >= f) break;
    }
    swap(a[0], a[1]);
    swap(t[0], t[1]);
    swap(p[0], p[1]);
  }
  return ans == infll ? -1 : ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> f >> T >> t0;
  for (int i = 0; i < 2; i++) cin >> a[i] >> t[i] >> p[i];
  cout << answer() << '\n';
  return 0;
}
