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