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