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