#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 9;
const long long inf = 1e18 + 18;
const int max6 = 1e6 + 6;
const int modx = 1e9 + 123;
const int mody = 997;
const int base = 137;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int first = (a - 1) / c + 1;
    int second = (b - 1) / d + 1;
    if (first + second > k)
      cout << -1 << "\n";
    else
      cout << first << " " << second << "\n";
  }
}
