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