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