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