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