#include <bits/stdc++.h>
using namespace std;
int power(long long x, long long y) {
  if (y == 0) return 1;
  long long p = power(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
const long long N = (long long)(1e5 + 1);
const long long N2 = (long long)(1e6 + 1);
const long long MOD = (long long)(1e9 + 7);
const long long INF = (long long)(2e18);
void solve() {
  long long a, b, c, d, k;
  cin >> a >> b >> c >> d >> k;
  long long x = (a + c - 1) / c;
  long long y = (b + d - 1) / d;
  if (x + y <= k) {
    cout << x << " " << y << '\n';
  } else {
    cout << -1 << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
