#include <bits/stdc++.h>
using namespace std;
int t, a, b, c, d, k, m, n;
int main() {
  scanf("%d", &t);
  for (int i = 1; i <= t; i++) {
    scanf("%d%d%d%d%d", &a, &b, &c, &d, &k);
    bool f = false;
    for (int y = 1; y < k; y++)
      if (y * c >= a && (k - y) * d >= b) {
        m = y;
        n = k - y;
        f = true;
        break;
      }
    if (!f) {
      cout << -1 << "\n";
    } else
      cout << m << " " << n << "\n";
  }
  return 0;
}
