#include <bits/stdc++.h>
using namespace std;
int t, a, b, c, d, k, c1, d1, v1[101], v2[101];
int main() {
  cin >> t;
  for (int i = 1; i <= t; i++) {
    c1 = 0, d1 = 0;
    cin >> a >> b >> c >> d >> k;
    while (b > 0) {
      d1++;
      b -= d;
    }
    while (a > 0) {
      c1++;
      a -= c;
    }
    if (d1 + c1 <= k) {
      v1[i] = c1;
      v2[i] = d1;
    } else
      v1[i] = -1;
  }
  for (int i = 1; i <= t; i++)
    if (v1[i] != -1)
      cout << v1[i] << " " << v2[i] << endl;
    else
      cout << -1 << endl;
  return 0;
}
