#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    double a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    double pen = a / c;
    double pencil = b / d;
    pen = ceil(pen);
    pencil = ceil(pencil);
    if ((pen + pencil) <= k) {
      double diff = k - pen - pencil;
      cout << pen + diff << " " << pencil << "\n";
    } else
      cout << -1 << "\n";
  }
  return 0;
}
