#include <bits/stdc++.h>
using namespace std;
int K;
int M[100][5];
int main() {
  cin >> K;
  for (int i = 0; i < K; i++) {
    cin >> M[i][0] >> M[i][1] >> M[i][2] >> M[i][3] >> M[i][4];
  }
  for (int i = 0; i < K; i++) {
    int x, y;
    if (M[i][0] % M[i][2] == 0) {
      x = M[i][0] / M[i][2];
    } else {
      x = M[i][0] / M[i][2] + 1;
    }
    if (M[i][1] % M[i][3] == 0) {
      y = M[i][1] / M[i][3];
    } else {
      y = M[i][1] / M[i][3] + 1;
    }
    if (x + y <= M[i][4]) {
      cout << x << ' ' << y << endl;
    } else {
      cout << "-1" << endl;
    }
  }
}
