#include <bits/stdc++.h>
using namespace std;
int n;
int a, b, c, d, k;
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> k;
    bool ok = 0;
    for (int i = 1; i <= k; i++) {
      int j = k - i;
      if (i * c >= a && j * d >= b) {
        ok = 1;
        cout << i << ' ' << j << endl;
        break;
      }
    }
    if (!ok) puts("-1");
  }
  return 0;
}
