#include <bits/stdc++.h>
using namespace std;
const long long linf = 2e18 + 5e2;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long f, T, t0;
  cin >> f >> T >> t0;
  long long a1, p1, t1;
  cin >> a1 >> t1 >> p1;
  long long a2, p2, t2;
  cin >> a2 >> t2 >> p2;
  __int128 best = linf;
  if (t1 > t2) {
    swap(p1, p2);
    swap(a1, a2);
    swap(t1, t2);
  }
  long long ot1 = t1;
  long long ot2 = t2;
  t1 = max(t0 - t1, 0ll);
  t2 = max(t0 - t2, 0ll);
  for (__int128 c1 = 0; c1 <= (f + a1 - 1) / a1; c1++) {
    __int128 c2;
    if (t2 == 0 || a2 == 0)
      c2 = 0;
    else
      c2 = -(T - f * t0 + c1 * a1 * t1) / (t2 * a2);
    auto stuff = [&](__int128 c2) {
      if (c2 < -1 || f * t0 - c1 * a1 * t1 - c2 * a2 * t2 > T) c2++;
      c2 = max((__int128)0, c2);
      __int128 lf = f;
      __int128 time_taken = 0;
      time_taken += min(lf, c1 * a1) * ot1;
      lf -= min(lf, c1 * a1);
      time_taken += min(lf, c2 * a2) * ot2;
      lf -= min(lf, c2 * a2);
      time_taken += lf * t0;
      if (c2 < 0 || time_taken > T) return;
      best = min(best, (c1 * p1 + c2 * p2));
    };
    stuff(c2 - 2);
    stuff(c2 - 1);
    stuff(c2);
    stuff(c2 + 1);
    stuff(c2 + 2);
  }
  if (best == linf)
    cout << -1;
  else
    cout << (long long)best;
}
