#include <bits/stdc++.h>
using namespace std;
int T, a, b, c, d, t;
int main() {
  cin >> T;
  while (T--) {
    cin >> a >> b >> c >> d >> t;
    a = (a + c - 1) / c;
    b = (b + d - 1) / d;
    if (a + b <= t)
      cout << a << " " << b << "\n";
    else
      cout << "-1\n";
  }
}
