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