#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e13;
const double PI = acos(-1);
const long long M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    if (k - (b + d - 1) / d - (a + c - 1) / c <= -1) {
      cout << -1 << endl;
      continue;
    }
    cout << (a + c - 1) / c << ' ' << (b + d - 1) / d << endl;
  }
}
