#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3e5 + 47;
long long n;
void read() {
  long long a, b, c, d, k;
  cin >> a >> b >> c >> d >> k;
  long long q = (a - 1) / c + 1;
  long long r = (b - 1) / d + 1;
  if (q + r <= k)
    cout << q << " " << r << "\n";
  else
    cout << -1 << "\n";
}
void solve() {}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    read();
    solve();
  }
}
