#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int cnt = 0, N, K, P, C, p, c, x = 0, y = 0;
    cin >> P >> C >> p >> c >> K;
    x = P / p + (P % p ? 1 : 0);
    y = C / c + (C % c ? 1 : 0);
    if (x + y > K) {
      cout << -1 << endl;
    } else {
      cout << x << " " << y << endl;
    }
  }
}
