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