#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 count = 0;
    while (a > 0) {
      count++;
      a = a - c;
    }
    int countb = 0;
    while (b > 0) {
      countb++;
      b = b - d;
    }
    if (count + countb > k)
      cout << "-1" << endl;
    else
      cout << count << " " << countb << endl;
  }
}
