#include <bits/stdc++.h>
using namespace std;
int t, a, b, c, d, k, i, e, f;
int main() {
  cin >> t;
  for (i = 1; i <= t; i++) {
    cin >> a >> b >> c >> d >> k;
    if (a % c == 0)
      e = a / c;
    else
      e = a / c + 1;
    if (b % d == 0)
      f = b / d;
    else
      f = b / d + 1;
    if (e + f > k)
      cout << -1 << endl;
    else
      cout << k - f << ' ' << f << endl;
  }
  return 0;
}
