#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long inf64 = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    a = (a + c - 1) / c;
    b = (b + d - 1) / d;
    if (a + b <= k) {
      cout << a << " " << b << "\n";
    } else {
      cout << "-1\n";
    }
  }
  return 0;
}
