#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int m, n;
    if (a % c == 0)
      m = a / c;
    else
      m = a / c + 1;
    if (b % d == 0)
      n = b / d;
    else
      n = b / d + 1;
    if (k >= n + m)
      cout << m << ' ' << n << endl;
    else
      cout << "-1" << endl;
  }
  return 0;
}
