#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long int p, q;
    if (a % c == 0) {
      if (b % d == 0) {
        p = a / c;
        q = b / d;
      } else {
        p = a / c;
        q = b / d + 1;
      }
    } else {
      if (b % d == 0) {
        p = a / c + 1;
        q = b / d;
      } else {
        p = a / c + 1;
        q = b / d + 1;
      }
    }
    if (p + q <= k && p >= 0 && q >= 0) {
      cout << p << " " << q << "\n";
    } else
      cout << -1 << "\n";
    ;
  }
}
