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