#include <bits/stdc++.h>
using namespace std;
signed main() {
  std ::ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long res = 0, res1 = 0;
    res = (a + c - 1) / c;
    res1 = (b + d - 1) / d;
    if (res + res1 <= k)
      cout << res << " " << res1 << "\n";
    else
      cout << "-1\n";
  }
}
