#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int x1, x2;
    if (a % c) {
      x1 = a / c + 1;
    } else {
      x1 = a / c;
    }
    if (b % d) {
      x2 = b / d + 1;
    } else {
      x2 = b / d;
    }
    if (x1 + x2 > k) {
      cout << "-1\n";
    } else {
      cout << x1 << " " << k - x1 << endl;
    }
  }
  return 0;
}
