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