#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int ans_one = a / c;
    int ans_two = b / d;
    if (a % c != 0) ans_one++;
    if (b % d != 0) ans_two++;
    if ((ans_one + ans_two) > k)
      cout << "-1" << endl;
    else
      cout << ans_one << " " << ans_two << endl;
  }
  return 0;
}
