#include <bits/stdc++.h>
int main() {
  int n, a, b, c, d, k;
  std::cin >> n;
  while (n--) {
    std::cin >> a >> b >> c >> d >> k;
    int r = a / c + (a % c == 0 ? 0 : 1);
    int s = b / d + (b % d == 0 ? 0 : 1);
    if (r + s > k) {
      std::cout << -1 << std::endl;
    } else {
      std::cout << r << " " << s << std::endl;
    }
  }
}
