#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int x = 0, y = 0;
    if (a <= c) {
      x++;
    } else {
      int temp = a / c;
      if (a % c == 0) {
        x = temp;
      } else {
        temp++;
        x = temp;
      }
    }
    if (b <= d) {
      y++;
    } else {
      int temp = b / d;
      if (b % d == 0) {
        y = temp;
      } else {
        temp++;
        y = temp;
      }
    }
    if (x + y <= k) {
      cout << x << " " << y << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
