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