#include <bits/stdc++.h>
int main() {
  int t, a, b, c, d, k, x, y;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    scanf("%d%d%d%d%d", &a, &b, &c, &d, &k);
    x = a / c;
    if (a % c != 0) x++;
    y = b / d;
    if (b % d != 0) y++;
    if ((x + y) <= k)
      printf("%d %d\n", x, y);
    else
      printf("%d\n", -1);
  }
  return 0;
}
