#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
bool check(long long ss) {
  string s = to_string(ss);
  set<char> st;
  for (long long i = 0; i < s.size(); ++i) {
    st.insert(s[i]);
  }
  return st.size() == s.size();
}
struct pr {
  pair<long long, long long> cr1;
  pair<long long, long long> cr2;
};
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    double a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long x = ceil(a / c);
    long long y = ceil(b / d);
    if (x + y > k) {
      cout << -1;
    } else {
      cout << x << " " << y;
    }
    cout << "\n";
  }
}
