#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, k, x, y;
  double a, b, c, d;
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%lf%lf%lf%lf%d", &a, &b, &c, &d, &k);
    x = ceil(a / c);
    y = ceil(b / d);
    if (x + y <= k) {
      printf("%d %d\n", x, y);
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
