#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  scanf("%lld", &t);
  while (t--) {
    long long a, b, c, d, k;
    scanf("%lld%lld%lld", &a, &b, &c);
    scanf("%lld %lld", &d, &k);
    long long x = (a - 1 + c) / c;
    long long y = (b + d - 1) / d;
    if (x + y <= k) {
      printf("%lld %lld\n", k - y, y);
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
