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