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