#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
int q, a, b, c, d, k;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> q;
  while (q--) {
    cin >> a >> b >> c >> d >> k;
    int x = (a + c - 1) / c, y = (b + d - 1) / d;
    if (x + y > k)
      cout << "-1\n";
    else
      cout << x << ' ' << k - x << '\n';
  }
}
