#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const double dinf = 1e250;
const long long INF = (long long)(2e18);
const long long inf = (long long)(1e18 + 7);
const long long mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long ans1 = (a / c);
    if (a % c) ++ans1;
    long long ans2 = (b / d);
    if (b % d) ++ans2;
    if (ans1 + ans2 <= k)
      cout << ans1 << ' ' << ans2 << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
