#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAX_N = 1e5 + 10;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int a, b, c, d, k;
    scanf("%d %d %d %d %d", &a, &b, &c, &d, &k);
    int pen = a / c;
    if (a % c) ++pen;
    int pencil = b / d;
    if (b % d) ++pencil;
    if (pen + pencil <= k)
      printf("%d %d\n", pen, pencil);
    else
      printf("-1\n");
  }
  return 0;
}
