#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
inline int poww(int a, int b) {
  int base = a, ans = 1;
  while (b) {
    if (b & 1) ans = (ans * base) % inf;
    base = (base * base) % inf;
    b >>= 1;
  }
  return ans;
}
inline int read() {
  int p = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    p = p * 10 + c - '0';
    c = getchar();
  }
  return f * p;
}
int T, a, b, c, d, k, s1, s2;
int main() {
  T = read();
  while (T--) {
    a = read(), b = read(), c = read(), d = read(), k = read();
    s1 = a / c + ((a % c) ? 1 : 0);
    s2 = b / d + ((b % d) ? 1 : 0);
    if (s1 + s2 <= k)
      printf("%d %d\n", s1, s2);
    else
      printf("-1\n");
  }
  return 0;
}
