#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e+9 + 7;
const long long MAXN = 1e+5 + 7;
const long long INF = 1e+18;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  double t, a, b, c, d, k;
  int x, y;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> k;
    x = ceil(a / c);
    y = ceil(b / d);
    if (x + y <= k) {
      cout << x << " " << y;
    } else {
      cout << -1;
    }
    cout << "\n";
  }
}
