#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    float a, b, c, d, k, x = 0, y = 0;
    cin >> a >> b >> c >> d >> k;
    x = ceil(a / c);
    y = ceil(b / d);
    if (x + y > k)
      cout << -1 << endl;
    else
      cout << x << " " << y << endl;
  }
  return 0;
}
