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