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