#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long int first = ceil((double)a / c);
    long long int second = ceil((double)b / d);
    if (first + second > k)
      cout << -1 << endl;
    else
      cout << first << " " << second << endl;
  }
  return 0;
}
