#include <bits/stdc++.h>
using namespace std;
long long INF = 1e18;
long long ans = INF;
long long f, T, t0, t1, t2, a1, a2, p1, p2;
int main() {
  cin >> f >> T >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  if (t1 > t2) {
    swap(a1, a2);
    swap(t1, t2);
    swap(p1, p2);
  }
  for (long long i = 0;; ++i) {
    long long cost = i * p1;
    long long download = i * a1;
    long long time1 = i * t1 * a1;
    if (time1 > T) break;
    if (download >= f) {
      ans = min(ans, cost);
      break;
    }
    long long rest_file = f - download;
    long long rest_time = T - time1;
    if (rest_file * t0 <= rest_time) {
      ans = min(ans, cost);
      break;
    }
    if (t2 >= t0) continue;
    {
      long long k2 = (rest_time + t2 - 1) / t2;
      if (t2 * rest_file <= rest_time) {
        ans = min(ans, cost + k2 * p2);
        k2 = (rest_file * t0 - rest_time + a2 * (t0 - t2) - 1) /
             (a2 * (t0 - t2));
        ans = min(ans, cost + k2 * p2);
      }
    }
  }
  for (long long i = 0;; ++i) {
    long long cost = i * p2;
    long long download = i * a2;
    long long time1 = i * t2 * a2;
    if (time1 > T) break;
    if (download >= f) {
      ans = min(ans, cost);
      break;
    }
    long long rest_file = f - download;
    long long rest_time = T - time1;
    if (rest_file * t0 <= rest_time) {
      ans = min(ans, cost);
      break;
    }
    if (t1 >= t0) continue;
    {
      long long k1 = (rest_time + t1 - 1) / t1;
      if (t1 * rest_file <= rest_time) {
        ans = min(ans, cost + k1 * p1);
        k1 = (rest_file * t0 - rest_time + a1 * (t0 - t1) - 1) /
             (a1 * (t0 - t1));
        ans = min(ans, cost + k1 * p1);
      }
    }
  }
  if (ans != INF)
    cout << ans << endl;
  else
    cout << -1 << endl;
  return 0;
}
