#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  for (int test = 0; test < q; test++) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int pen = (a - 1) / c + 1, pencil = (b - 1) / d + 1;
    if (pen + pencil > k) {
      cout << -1 << '\n';
    } else {
      cout << pen << ' ' << pencil << '\n';
    }
  }
}
