#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 p = a % c == 0 ? a / c : a / c + 1;
    int q = b % d == 0 ? b / d : b / d + 1;
    if (p + q > k)
      cout << -1 << endl;
    else
      cout << p << " " << q << endl;
  }
  return 0;
}
