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