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