#include <bits/stdc++.h>
using namespace std;
using namespace std;
int inf = 0x3f3f3f3f;
int mod = 1e9 + 7;
const int maxn = 1010;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int cnt1 = (a - 1) / c + 1;
    int cnt2 = (b - 1) / d + 1;
    if (cnt1 + cnt2 > k)
      puts("-1");
    else
      printf("%d %d\n", cnt1, cnt2);
  }
}
