#include <bits/stdc++.h>
using namespace std;
const int imax = 1e9 + 7;
const long long lmax = 1e18;
vector<int> v;
string s;
int calc() {
  int a, b, c, d, k, x, y;
  cin >> a >> b >> c >> d >> k;
  for (x = 0; x < k + 1; ++x) {
    y = k - x;
    if ((c * x) < a) continue;
    if ((d * y) < b) continue;
    cout << x << " " << y << endl;
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) calc();
  return 0;
}
