#include <bits/stdc++.h>
using namespace std;
mt19937_64 mt_rnd_64(chrono::steady_clock::now().time_since_epoch().count());
long long rnd(long long l, long long r) {
  return (mt_rnd_64() % (r - l + 1)) + l;
}
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const double PI = acos(-1.0);
const ll mod = 1e9 + 9;
const ll INF = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll t;
  cin >> t;
  while (t--) {
    ll a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    ll ans = a / c + (a % c != 0 ? 1 : 0);
    if (ans * c < a || (k - ans) * d < b) {
      cout << -1 << "\n";
      continue;
    }
    cout << ans << " " << k - ans << "\n";
  }
  return 0;
}
