#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    int a, b, c, d, k;
    int x = 0, y = 0;
    cin >> a >> b >> c >> d >> k;
    bool isPossible = true;
    while (a > 0 || b > 0) {
      if (a > 0) {
        a -= c;
        x++;
        k--;
        if (k <= 0 && (a > 0 || b > 0)) {
          isPossible = false;
          break;
        }
      }
      if (b > 0) {
        b -= d;
        y++;
        k--;
        if (k <= 0 && (a > 0 || b > 0)) {
          isPossible = false;
          break;
        }
      }
    }
    if (isPossible) {
      cout << x << " " << y << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
