#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int pens = 0;
    int pensils = 0;
    pens = a / c + ((a % c) ? 1 : 0);
    k -= pens;
    if (k > 0) {
      pensils = b / d + ((b % d) ? 1 : 0);
      k -= pensils;
      if (k >= 0) {
        cout << pens << " " << pensils;
      } else {
        cout << -1;
      }
    } else {
      cout << -1;
    }
    cout << endl;
  }
}
