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