#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  int t;
  std::cin >> t;
  while (t--) {
    int a, b, c, d, k;
    std::cin >> a >> b >> c >> d >> k;
    int p, bp;
    p = a / c + (a % c != 0);
    bp = b / d + (b % d != 0);
    if (p + bp > k)
      std::cout << -1 << std::endl;
    else
      std::cout << p << " " << bp << std::endl;
  }
  return 0;
}
