#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long pen = (long long)ceil((double)a / (double)c);
    long long p = (long long)ceil((double)b / (double)d);
    if (pen + p <= k) {
      cout << pen << " " << p << endl;
    } else
      cout << -1 << endl;
  }
  return 0;
}
