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