#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a < b) swap(a, b);
  if (b == 0)
    return a;
  else
    gcd(b, a % b);
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long int g = a / c, h = b / d;
    if (a % c) g++;
    if (b % d) h++;
    (g + h <= k) ? cout << g << " " << k - g << endl : cout << "-1\n";
  }
}
