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