#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t, a, b, c, d, k;
  cin >> t;
  while (t--) {
    int x, y;
    cin >> a >> b >> c >> d >> k;
    if (a % c == 0) {
      x = a / c;
    } else if (a % c != 0) {
      x = (a / c) + 1;
    }
    if (b % d == 0) {
      y = b / d;
    } else if (b % d != 0) {
      y = b / d + 1;
    }
    if (x + y <= k) {
      cout << x << " " << y << endl;
    } else if (x + y > k)
      cout << "-1" << endl;
  }
}
