#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e18;
long long a1, t1, p1, a2, t2, p2;
long long f, T, t0;
inline void chkmin(long long& a, long long b) {
  if (a > b) a = b;
}
int main() {
  scanf("%lld%lld%lld", &f, &T, &t0);
  scanf("%lld%lld%lld", &a1, &t1, &p1);
  scanf("%lld%lld%lld", &a2, &t2, &p2);
  if (t0 * f <= T) {
    puts("0");
    return 0;
  }
  long long ans = oo;
  for (long long i = 0; i <= f / a1 + 1; i++) {
    long long leftT = T - i * a1 * t1;
    long long leftf = f - i * a1;
    if (leftT < 0) break;
    if (leftf <= 0) {
      chkmin(ans, p1 * i);
    } else {
      if (leftf * t0 <= leftT) {
        chkmin(ans, p1 * i);
        continue;
      }
      long long yyy = (t0 * leftf - leftT + t0 - t2 - 1) / (t0 - t2);
      long long i1 = (yyy + a2 - 1) / a2;
      if (leftf * t2 <= leftT) chkmin(ans, p1 * i + i1 * p2);
    }
  }
  swap(a1, a2);
  swap(t1, t2);
  swap(p1, p2);
  for (long long i = 0; i <= f / a1 + 1; i++) {
    long long leftT = T - i * a1 * t1;
    long long leftf = f - i * a1;
    if (leftT < 0) break;
    if (leftf <= 0) {
      chkmin(ans, p1 * i);
    } else {
      if (leftf * t0 <= leftT) {
        chkmin(ans, p1 * i);
        continue;
      }
      long long yyy = (t0 * leftf - leftT + t0 - t2 - 1) / (t0 - t2);
      long long i1 = (yyy + a2 - 1) / a2;
      if (leftf * t2 <= leftT) chkmin(ans, p1 * i + i1 * p2);
    }
  }
  if (ans == oo) ans = -1;
  printf("%lld\n", ans);
  return 0;
}
