#include <bits/stdc++.h>
using namespace std;
const long long Inf = 1ll << 60;
int main() {
  long long f, T, t0;
  long long a1, t1, p1;
  long long a2, t2, p2;
  cin >> f >> T >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  if (t1 > t2) {
    swap(t1, t2);
    swap(a1, a2);
    swap(p1, p2);
  }
  long long stepSave = t0 - t2;
  long long res = Inf;
  for (long long buy1 = 0; buy1 * a1 <= f + a1; buy1++) {
    long long restSize = f - buy1 * a1;
    if (restSize <= 0) {
      if (f * t1 <= T) res = min(res, buy1 * p1);
      continue;
    }
    long long restTime = T - buy1 * a1 * t1;
    long long fullTime = restSize * t0;
    if (fullTime <= restTime) {
      res = min(res, buy1 * p1);
      continue;
    }
    if (stepSave > 0) {
      long long needTimeSave = fullTime - restTime;
      long long needByteSave = (needTimeSave + stepSave - 1) / stepSave;
      if (needByteSave > restSize) continue;
      long long needPacketSave = (needByteSave + a2 - 1) / a2;
      res = min(res, buy1 * p1 + needPacketSave * p2);
    }
  }
  cout << ((res != Inf) ? res : -1) << endl;
  return 0;
}
