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