#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
int main() {
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long x = ceil(a / (1.0 * c));
    long long y = ceil(b / (1.0 * d));
    if (x + y <= k) {
      cout << x << " " << y << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
