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