#include <bits/stdc++.h>
using namespace std;
long long f, T, a[3], t[3], p[3], A, B, H, x, y;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> f >> T >> t[0];
  cin >> a[1] >> t[1] >> p[1];
  cin >> a[2] >> t[2] >> p[2];
  if (t[0] <= t[1] && t[0] <= t[2]) {
    if (f * t[0] > T) {
      cout << -1 << '\n';
    } else {
      cout << 0 << '\n';
    }
  } else if (t[0] <= t[1]) {
    if (f * t[2] > T) {
      cout << -1 << '\n';
    } else if (f * t[0] <= T) {
      cout << 0 << '\n';
    } else {
      cout << p[2] * ((f * t[0] - T - 1) / (a[2] * (t[0] - t[2])) + 1) << '\n';
    }
  } else if (t[0] <= t[2]) {
    if (f * t[1] > T) {
      cout << -1 << '\n';
    } else if (f * t[0] <= T) {
      cout << 0 << '\n';
    } else {
      cout << p[1] * ((f * t[0] - T - 1) / (a[1] * (t[0] - t[1])) + 1) << '\n';
    }
  } else {
    if (f * min(t[1], t[2]) > T) {
      cout << -1 << '\n';
    } else if (f * t[0] <= T) {
      cout << 0 << '\n';
    } else {
      H = 1000000000000000;
      for (x = 0; (x - 1) * a[1] < f && t[1] * min(f, x * a[1]) <= T; x++) {
        if ((f - x * a[1]) * t[0] <= T - x * a[1] * t[1]) {
          H = min(H, x * p[1]);
        } else if ((f - x * a[1]) * t[2] <= T - x * a[1] * t[1]) {
          y = ((f - x * a[1]) * t[0] - (T - x * a[1] * t[1]) - 1) /
                  (a[2] * (t[0] - t[2])) +
              1;
          H = min(H, x * p[1] + y * p[2]);
        }
      }
      for (x = 0; (x - 1) * a[2] < f && t[2] * min(f, x * a[2]) <= T; x++) {
        if ((f - x * a[2]) * t[0] <= T - x * a[2] * t[2]) {
          H = min(H, x * p[2]);
        } else if ((f - x * a[2]) * t[1] <= T - x * a[2] * t[2]) {
          y = ((f - x * a[2]) * t[0] - (T - x * a[2] * t[2]) - 1) /
                  (a[1] * (t[0] - t[1])) +
              1;
          H = min(H, x * p[2] + y * p[1]);
        }
      }
      cout << H << '\n';
    }
  }
}
