#include <bits/stdc++.h>
using namespace std;
__inline__ __attribute__((always_inline)) long long read() {
  long long x = 0, w = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * w;
}
int T;
int a, b, c, d, k;
int main() {
  T = read();
  while (T--) {
    a = read(), b = read(), c = read(), d = read(), k = read();
    int x = ceil((double)a / c), y = ceil((double)b / d);
    if (x + y > k)
      puts("-1");
    else
      printf("%d %d\n", x, y);
  }
}
