#include <bits/stdc++.h>
using namespace std;
long long a, n, b, c, d, k, m, p;
long long ans, ans2, ann;
vector<int> g[200010];
string second, s1, s2;
char cc, cc2, cc3;
int inf = 1e9 + 7;
bool was[500][300];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a >> b >> c >> d >> k;
    m = (a + c - 1) / c;
    p = (b + d - 1) / d;
    if (m + p <= k) {
      cout << m << ' ' << k - m << '\n';
    } else
      cout << "-1\n";
  }
  return 0;
}
