#include <bits/stdc++.h>
using namespace std;
template <class InputIt, class Distance>
void advance(InputIt& it, Distance n);
const int mod = 1e9 + 7;
const int N = 2e4 + 4;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int x = (a + c - 1) / c;
    int y = (b + d - 1) / d;
    if (x + y <= k) {
      cout << x << " " << y << "\n";
    } else {
      cout << "-1\n";
    }
  }
}
