#include <bits/stdc++.h>
using namespace std;
int t, a, b, c, d, k;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> k;
    int x = (a + c - 1) / c;
    int y = (b + d - 1) / d;
    if (x + y > k) {
      cout << -1;
    } else {
      cout << x << " " << y;
    }
    cout << "\n";
  }
  return 0;
}
