#include <bits/stdc++.h>
using namespace std;
int main() {
  int times;
  cin >> times;
  for (int i = 0; i < times; i++) {
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    int n1, n2;
    if (a % c == 0)
      n1 = a / c;
    else
      n1 = a / c + 1;
    if (b % d == 0)
      n2 = b / d;
    else
      n2 = b / d + 1;
    if (n1 + n2 > e)
      cout << -1 << "\n";
    else {
      cout << e - n2 << " ";
      cout << n2 << "\n";
    }
  }
}
