#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b, c, d, k, ans, res;
  long long cur, tur, t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> k;
    cur = ceil(a / c);
    tur = ceil(b / d);
    if (cur + tur <= k)
      cout << cur << " " << tur << endl;
    else
      cout << "-1" << endl;
  }
}
