#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v[111];
  int a, b, c, d, k;
  int t;
  cin >> t;
  int x, y;
  for (int i = 0; i < t; i++) {
    x = 0;
    y = 0;
    cin >> a >> b >> c >> d >> k;
    x += a / c;
    if (a % c != 0) x++;
    y += b / d;
    if (b % d != 0) y++;
    if (x + y <= k) {
      v[i].push_back(x);
      v[i].push_back(y);
    } else
      v[i].push_back(-1);
  }
  for (int i = 0; i < t; i++) {
    if (v[i][0] == -1)
      cout << -1 << endl;
    else
      cout << v[i][0] << " " << v[i][1] << endl;
  }
  return 0;
}
