#include <bits/stdc++.h>
using namespace std;
int a[101], b[101], c[101], d[101], k[101];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i] >> k[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] % c[i] == 0 && b[i] % d[i] == 0) {
      if (a[i] / c[i] + b[i] / d[i] <= k[i]) {
        cout << a[i] / c[i] << " " << b[i] / d[i] << endl;
      } else {
        cout << -1 << endl;
      }
    }
    if (a[i] % c[i] > 0 && b[i] % d[i] == 0) {
      if ((a[i] / c[i] + 1) + (b[i] / d[i]) <= k[i]) {
        cout << a[i] / c[i] + 1 << " " << b[i] / d[i] << endl;
      } else {
        cout << -1 << endl;
      }
    }
    if (a[i] % c[i] == 0 && b[i] % d[i] > 0) {
      if ((a[i] / c[i]) + (b[i] / d[i] + 1) <= k[i]) {
        cout << a[i] / c[i] << " " << b[i] / d[i] + 1 << endl;
      } else {
        cout << -1 << endl;
      }
    }
    if (a[i] % c[i] > 0 && b[i] % d[i] > 0) {
      if ((a[i] / c[i] + 1) + (b[i] / d[i] + 1) <= k[i]) {
        cout << a[i] / c[i] + 1 << " " << b[i] / d[i] + 1 << endl;
      } else {
        cout << -1 << endl;
      }
    }
  }
}
