#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
int main() {
  int t;
  while (cin >> t) {
    while (t--) {
      int a, b, c, d, k;
      cin >> a >> b >> c >> d >> k;
      int ans = (a % c == 0) ? a / c : a / c + 1;
      int vans = (b % d == 0) ? b / d : b / d + 1;
      if (ans + vans > k) {
        cout << "-1" << endl;
      } else {
        cout << ans << " " << vans << endl;
      }
    }
  }
  return 0;
}
