#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
namespace qwq {
inline void read(int &o) {
  o = 0;
  int w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w *= -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    o = (o << 3) + (o << 1) + (c ^ 48);
    c = getchar();
  }
  o *= w;
}
void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
void Write(int x) {
  write(x);
  putchar('\n');
}
inline int max(int x, int y) { return x > y ? x : y; }
inline int min(int x, int y) { return x < y ? x : y; }
}  // namespace qwq
using namespace qwq;
int N, T, a, b, c, d, k;
signed main() {
  read(T);
  while (T--) {
    scanf("%d%d%d%d%d", &a, &b, &c, &d, &k);
    int A = 0, B = 0;
    if (a % c)
      A = a / c + 1;
    else
      A = a / c;
    if (b % d)
      B = b / d + 1;
    else
      B = b / d;
    if (A + B > k)
      puts("-1");
    else {
      printf("%d %d\n", A, B);
    }
  }
  return 0;
}
