#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    float a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    float x = ceil(a / c);
    float y = ceil(b / d);
    if (x + y <= k)
      cout << x << " " << y << "\n";
    else
      cout << -1 << "\n";
  }
  return 0;
}
