#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int q;
  cin >> q;
  while (q--) {
    long long int a, b, c, d, k, a1, b1;
    cin >> a >> b >> c >> d >> k;
    if (a % c == 0)
      a1 = a / c;
    else
      a1 = a / c + 1;
    if (b % d == 0)
      b1 = b / d;
    else
      b1 = b / d + 1;
    if (a1 + b1 <= k) {
      cout << a1 << " " << b1 << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
