#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 i1 = 1, i2 = 0;
    while (i1 * c < a) i1++;
    while (i2 * d < b) i2++;
    if (i1 + i2 > k)
      cout << "-1" << endl;
    else
      cout << i1 << " " << i2 << endl;
  }
}
