#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0 || a == 0) return a + b;
  return gcd(b, a % b);
}
const int inf = int(1e9);
const int mod = inf + 7;
void solve() {
  int a, b, c, d, k;
  cin >> a >> b >> c >> d >> k;
  int x = a / c + (a % c != 0);
  int y = b / d + (b % d != 0);
  if (x + y > k)
    cout << -1 << endl;
  else
    cout << x << " " << y << endl;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) solve();
}
