#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, k, x = 0, y = 0, t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> k;
    (a % c == 0 ? x = (a / c) : x = (a / c) + 1);
    (b % d == 0 ? y = (b / d) : y = (b / d) + 1);
    (x + y <= k ? cout << x << " " << y << endl : cout << -1 << endl);
  }
}
