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