#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(time(nullptr));
const long long INF = 1e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  for (long long w = 0; w < t; w++) {
    long long a, b, c, d, k, fl = 1;
    cin >> a >> b >> c >> d >> k;
    for (long long i = 0; i <= k; i++) {
      if (a <= c * i && b <= (k - i) * d) {
        cout << i << ' ' << k - i << "\n";
        fl = 0;
        break;
      }
    }
    if (fl) {
      cout << -1 << "\n";
    }
  }
  return 0;
}
