#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long cnt1 = 0, cnt2 = 0;
    cnt1 = a / c;
    if (a % c != 0) cnt1++;
    cnt2 = b / d;
    if (b % d != 0) cnt2++;
    if ((cnt1 + cnt2) <= k) {
      cout << cnt1 << " " << cnt2 << "\n";
    } else
      cout << "-1\n";
  }
  return 0;
}
