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