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