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