#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int a, b, c, d, k, x = 0, y = 0;
    cin >> a >> b >> c >> d >> k;
    x = (a % c == 0) ? a / c : (int)(a / c) + 1;
    y = (b % d == 0) ? b / d : (int)(b / d) + 1;
    (x + y <= k) ? cout << x << " " << y << '\n' : cout << "-1\n";
  }
  return 0;
}
