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