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