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