#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, y, c1 = 0, c2 = 0;
    x = c;
    y = d;
    c1 = 1;
    c2 = 1;
    while (x < a) {
      x += c;
      c1++;
    }
    while (y < b) {
      y += d;
      c2++;
    }
    if (c1 + c2 <= k) {
      cout << c1 << " " << c2 << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
