Tomorrow is a difficult day for Polycarp: he has to attend $a$ lectures and $b$ practical classes at the university! Since Polycarp is a diligent student, he is going to attend all of them.

While preparing for the university, Polycarp wonders whether he can take enough writing implements to write all of the lectures and draw everything he has to during all of the practical classes. Polycarp writes lectures using a pen (he can't use a pencil to write lectures!); he can write down $c$ lectures using one pen, and after that it runs out of ink. During practical classes Polycarp draws blueprints with a pencil (he can't use a pen to draw blueprints!); one pencil is enough to draw all blueprints during $d$ practical classes, after which it is unusable.

Polycarp's pencilcase can hold no more than $k$ writing implements, so if Polycarp wants to take $x$ pens and $y$ pencils, they will fit in the pencilcase if and only if $x + y \le k$.

Now Polycarp wants to know how many pens and pencils should he take. Help him to determine it, or tell that his pencilcase doesn't have enough room for all the implements he needs tomorrow!

Note that you don't have to minimize the number of writing implements (though their total number must not exceed $k$).


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 100$) — the number of test cases in the input. Then the test cases follow.

Each test case is described by one line containing five integers $a$, $b$, $c$, $d$ and $k$, separated by spaces ($1 \le a, b, c, d, k \le 100$) — the number of lectures Polycarp has to attend, the number of practical classes Polycarp has to attend, the number of lectures which can be written down using one pen, the number of practical classes for which one pencil is enough, and the number of writing implements that can fit into Polycarp's pencilcase, respectively.

In hacks it is allowed to use only one test case in the input, so $t = 1$ should be satisfied.


-----Output-----

For each test case, print the answer as follows:

If the pencilcase can't hold enough writing implements to use them during all lectures and practical classes, print one integer $-1$. Otherwise, print two non-negative integers $x$ and $y$ — the number of pens and pencils Polycarp should put in his pencilcase. If there are multiple answers, print any of them. Note that you don't have to minimize the number of writing implements (though their total number must not exceed $k$).


-----Example-----
Input
3
7 5 4 5 8
7 5 4 5 2
20 53 45 26 4

Output
7 1
-1
1 3



-----Note-----

There are many different answers for the first test case; $x = 7$, $y = 1$ is only one of them. For example, $x = 3$, $y = 1$ is also correct.

$x = 1$, $y = 3$ is the only correct answer for the third test case.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
from math import ceil
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(na, nb) = (ceil(a / c), ceil(b / d))
	if na + nb > k:
		print(-1)
	else:
		print(na, nb)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = a // c if a % c == 0 else a // c + 1
	y = b // d if b % d == 0 else b // d + 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
t = int(input())
while t > 0:
	(a, b, c, d, k) = list(map(float, input().split()))
	ans = 0
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	ans += x + y
	if ans <= k:
		print(x, y)
	else:
		print(-1)
	t -= 1


import math
import time
n = int(input())
for i in range(n):
	data = list(map(int, input().split()))
	pen = 1
	kar = 1
	while data[0] - pen * data[2] > 0:
		pen += 1
	while data[1] - kar * data[3] > 0:
		kar += 1
	if kar + pen <= data[4]:
		print(pen, ' ', kar)
	else:
		print(-1)


from math import ceil

def testCase():
	(a, b, c, d, k) = tuple(map(int, input().split()))
	x = ceil(a / c)
	y = ceil(b / d)
	if x + y > k:
		return '-1'
	return '{} {}'.format(x, k - x)
t = int(input())
ans = map(lambda x: testCase(), range(t))
print('\n'.join(ans))


import math
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	p = pen + pencil
	if p < k:
		print(pen + k - p, pencil)
	elif p == k:
		print(pen, pencil)
	else:
		print('-1')


import math
for _ in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	count_pens = 0
	count_pencils = 0
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, e) = map(int, input().split())
	if a % c == 0:
		z = a // c
	else:
		z = a // c + 1
	if b % d == 0:
		x = b // d
	else:
		x = b // d + 1
	if z + x <= e:
		print(z, x)
	else:
		print(-1)


def test(line):
	if len(line) < 5:
		print(-1)
	a = int(line[0])
	b = int(line[1])
	c = int(line[2])
	d = int(line[3])
	k = int(line[4])
	black = (a - 1) // c + 1
	red = (b - 1) // d + 1
	if black + red <= k:
		print(black, red)
	else:
		print(-1)
for i in range(int(input())):
	test(input().split(' '))


import math
n = int(input())
aux1 = 0
while aux1 < n:
	entrada = input()
	vet = entrada.split(' ')
	lec = int(vet[0])
	prac = int(vet[1])
	lecs_per_pen = int(vet[2])
	prac_per_pencil = int(vet[3])
	pens_and_pencil = int(vet[4])
	pen = math.ceil(lec / lecs_per_pen)
	pencil = math.ceil(prac / prac_per_pencil)
	if pen + pencil > pens_and_pencil:
		print('-1')
	else:
		print(str(pen) + ' ' + str(pencil))
	aux1 += 1


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	r = (a + c - 1) // c
	e = (b + d - 1) // d
	if r + e <= k:
		print(r, e)
	else:
		print(-1)


import math
t = int(input())
i = 0
while i < t:
	l = list(map(int, input().split(' ')))
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	k = l[4]
	pens = math.ceil(a / c)
	pencils = math.ceil(b / d)
	if pens + pencils > k:
		print(-1)
	else:
		print(pens, pencils)
	i += 1


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import math

def solve(t):
	(a, b, c, d, k) = map(int, input().strip().split())
	(aa, bb) = (math.ceil(a / c), math.ceil(b / d))
	if aa + bb <= k:
		return str(aa) + ' ' + str(bb)
	else:
		return -1

def main():
	tc = int(input().strip())
	for t in range(1, tc + 1):
		print(solve(t))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	n_pen = math.ceil(a / c)
	n_pencil = math.ceil(b / d)
	if n_pen + n_pencil <= k:
		print(n_pen, n_pencil)
	else:
		print(-1)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	if math.ceil(a / c) + math.ceil(b / d) > k:
		print(-1)
		continue
	else:
		print(math.ceil(a / c), math.ceil(b / d))


def check(a, b, c, d, k):
	if a % c == 0:
		cnt1 = a // c
	else:
		cnt1 = a // c + 1
	if b % d == 0:
		cnt2 = b // d
	else:
		cnt2 = b // d + 1
	if cnt1 + cnt2 > k:
		print(-1)
	else:
		print(cnt1, cnt2)
num = int(input())
for i in range(num):
	s = input()
	arr = list(map(int, s.strip().split(' ')))
	check(*arr)


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pens = math.ceil(a / c)
	pencils = math.ceil(b / d)
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print(-1)


import sys
import math
import bisect
sys.setrecursionlimit(1000000000)

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def finput():
	return float(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def modst(a, s):
	res = 1
	while s:
		if s % 2:
			res *= a
		a *= a
		s //= 2
	return res

def size(x1, y1, x2, y2):
	return ((x1 + x2) ** 2 + (y1 + y2) ** 2) ** 0.5

def find(x, f):
	if x == f[x]:
		return x
	else:
		return find(f[x], f)

def main():
	(a, s, d, f, g) = rinput()
	r = math.ceil(a / d)
	f = math.ceil(s / f)
	if f + r <= g:
		print(r, f)
	else:
		print(-1)
for i in range(iinput()):
	main()


import math
a = int(input())
z = 0
x = 0
for i in range(a):
	l = list(map(int, input().split()))
	z = l[0] / l[2]
	x = l[1] / l[3]
	if z != l[0] // l[2]:
		z = math.floor(z) + 1
	if x != l[1] // l[3]:
		x = math.floor(x) + 1
	if z + x > l[4]:
		print(-1)
	else:
		print(int(z), int(x))


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		m = a // c
	else:
		m = a // c + 1
	if b % d == 0:
		n = b // d
	else:
		n = b // d + 1
	if m + n <= k:
		print(m, n)
	else:
		print(-1)


from math import *
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = ceil(a / c)
	y = ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


from math import ceil
n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	pens = ceil(a / c)
	pencils = ceil(b / d)
	if pens + pencils <= k:
		print(str(pens) + ' ' + str(pencils))
	else:
		print('-1')


from math import ceil
for m in range(int(input())):
	(i, j, k, l, n) = map(int, input().split())
	if ceil(i / k) + ceil(j / l) <= n:
		print(ceil(i / k), ceil(j / l))
	else:
		print(-1)


t = int(input())
for case in range(t):
	(a, b, c, d, k) = map(int, input().split())
	total = a // c + b // d
	x = a // c
	if a % c != 0:
		x += 1
		total += 1
	if b % d != 0:
		total += 1
	if total <= k:
		print(x, k - x)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	pen = 0
	pencil = 0
	if a % c == 0:
		pen = a // c
	else:
		pen = a // c + 1
	if b % d == 0:
		pencil = b // d
	else:
		pencil = b // d + 1
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


a = int(input())
r = 0
e = list()
while r < a:
	b = [int(b) for b in input().split()]
	if b[0] % b[2] == 0:
		c = b[0] // b[2]
	else:
		c = b[0] // b[2] + 1
	if b[1] % b[3] == 0:
		d = b[1] // b[3]
	else:
		d = b[1] // b[3] + 1
	z = b[4] - d
	if c + d > b[4]:
		e.append(-1)
	else:
		d = str(d)
		z = str(z)
		e.append(z + ' ' + d)
	r = r + 1
r = 0
while r < len(e):
	print(e[r])
	r = r + 1


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	w = a // c + bool(a % c)
	q = b // d + bool(b % d)
	if q + w <= k:
		print(w, q)
	else:
		print(-1)


t = int(input())
i = 0
M = []
j = ''
Kk = []
for i in range(0, t):
	(a, b, c, d, k) = map(int, input().split())
	o = bool(a % c != 0)
	p = bool(b % d != 0)
	x = a // c + o
	y = b // d + p
	M.append(str(x) + ' ' + str(y))
	Kk.append(k)
for j in range(0, len(M)):
	(x, y) = map(int, M[j].split())
	if x + y > Kk[j]:
		print('-1')
	else:
		print(M[j])


import math
t = int(input())
for tt in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	xx = pen + pencil
	if xx > k:
		print(-1)
	else:
		print(pen, pencil)


t = int(input())
while t > 0:
	w = input().split()
	a = []
	for i in w:
		a.append(int(i))

	def goo(a):
		b = a[0] / a[2]
		f = int(b)
		if b != f:
			f += 1
		c = a[1] / a[3]
		h = int(c)
		if h != c:
			h += 1
		if h + f > a[4]:
			print('-1')
		else:
			print(f, h)
	goo(a)
	t -= 1


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	(s, res) = divmod(a, c)
	x = s + min(1, res)
	(q, res) = divmod(b, d)
	y = q + min(1, res)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


import math
z = int(input())
for k in range(z):
	lkt = [int(i) for i in input().split()]
	blg = math.ceil(lkt[0] / lkt[2])
	lpc = math.ceil(lkt[1] / lkt[3])
	if blg + lpc > lkt[4]:
		print('-1')
	else:
		print(blg, lpc)


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, e) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	e = int(e)
	x = ceil(a / c)
	y = ceil(b / d)
	if x + y <= e:
		print(e - y, y)
	else:
		print(-1)


import math
for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	m1 = math.ceil(a / c)
	m2 = math.ceil(b / d)
	m = m1 + m2
	if m <= k:
		print(m1, m2)
	else:
		print('-1')


import math
t = int(input())
while t != 0:
	t -= 1
	(a, b, c, d, k) = [int(x) for x in input().split()]
	pens = math.ceil(a / c)
	pencils = math.ceil(b / d)
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print(-1)


import math
t = int(input())
while t > 0:
	t = t - 1
	(a, b, c, d, k) = map(int, input().split())
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


def abc(a, b, c, d):
	x = (a - 1) // c + 1
	y = (b - 1) // d + 1
	return (x, y)
for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(x, y) = abc(a, b, c, d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(x, y) = (0, 0)
	if a <= c:
		x = 1
	elif a % c == 0:
		x += a // c
	else:
		x += a // c + 1
	if b <= d:
		y = 1
	elif b % d == 0:
		y += b // d
	else:
		y += b // d + 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	arr = [int(char) for char in input().split()]
	a = arr[0]
	b = arr[1]
	c = arr[2]
	d = arr[3]
	k = arr[4]
	c1 = 0
	c2 = 0
	while a > 0:
		a = a - c
		c1 += 1
	while b > 0:
		b = b - d
		c2 += 1
	if c1 + c2 <= k:
		print(f'{c1} {c2}')
	else:
		print(-1)


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	pens = ceil(a / c)
	pencil = ceil(b / d)
	if pens + pencil <= k:
		print(pens, pencil)
	else:
		print(-1)


q = int(input())
import math
for i in range(q):
	l = list(map(int, input().split()))
	if math.ceil(l[0] / l[2]) + math.ceil(l[1] / l[3]) <= l[4]:
		print(math.ceil(l[0] / l[2]), math.ceil(l[1] / l[3]))
	else:
		print(-1)


for t in range(int(input())):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	l1 = a // c
	if a % c != 0:
		l1 += 1
	l2 = b // d
	if b % d != 0:
		l2 += 1
	if l1 + l2 <= k:
		print(l1, l2)
	else:
		print('-1')


import math

def number_of_pen(a, c):
	return math.ceil(a / c)

def number_of_pencils(b, d):
	return math.ceil(b / d)
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = number_of_pen(a, c)
	y = number_of_pencils(b, d)
	if x + y <= k:
		if x > y:
			print(k - y, y)
		else:
			print(x, k - x)
	else:
		print(-1)


import sys
(t,) = map(int, sys.stdin.readline().split())
for _ in range(t):
	(a, b, c, d, k) = map(int, sys.stdin.readline().split())
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
intin = lambda : int(input())
for _ in range(intin()):
	(a, b, c, d, k) = mapin()
	npen = math.ceil(a / c)
	npencil = math.ceil(b / d)
	if npen + npencil <= k:
		print(npen, npencil)
	else:
		print(-1)


t = int(input())
while t > 0:
	(a, b, c, d, k) = map(int, input().split())
	f = int(a / c)
	s = int(b / d)
	if a % c != 0:
		f += 1
	if b % d != 0:
		s += 1
	if f + s > k:
		print(-1)
	else:
		print(f, ' ', s)
	t -= 1


t = int(input())
while t != 0:
	(a, b, c, d, k) = [int(x) for x in input().split()]
	if a % c == 0:
		x = int(a / c)
	else:
		x = int(a / c) + 1
	if b % d == 0:
		y = int(b / d)
	else:
		y = int(b / d) + 1
	if x + y > k:
		print(-1)
	else:
		print(x, end=' ')
		print(y)
	t -= 1


def process(params):
	params = map(int, params)
	(a, b, c, d, k) = params
	black_count = a // c if a % c == 0 else a // c + 1
	red_count = b // d if b % d == 0 else b // d + 1
	if black_count + red_count > k:
		return (-1, -1)
	elif black_count + red_count == k:
		return (black_count, red_count)
	else:
		less = min(black_count, red_count)
		if less == black_count:
			red_count = k - black_count
		else:
			black_count = k - red_count
		return (black_count, red_count)
cases_count = int(input().strip())
cases = []
for i in range(cases_count):
	cases.append(input().strip().split())
for item in cases:
	(r1, r2) = process(item)
	if r1 == -1:
		print(-1)
	else:
		print(r1, r2)


from math import ceil
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	k -= ceil(a / c) + ceil(b / d)
	if k < 0:
		print(-1)
	else:
		print(ceil(a / c), ceil(b / d))


import math
t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	k = l[4]
	val1 = math.ceil(a / c)
	val2 = math.ceil(b / d)
	if val1 + val2 > k:
		print(-1)
	else:
		print(val1, val2)


import math

def sol():
	(a, b, c, d, k) = map(int, input().split())
	p = math.ceil(a / c)
	q = math.ceil(b / d)
	if p + q > k:
		print(-1)
	else:
		print(p, q)
n = int(input())
for i in range(n):
	sol()


import math
t = int(input())
while t > 0:
	(a, b, c, d, k) = map(int, input().split(' '))
	if a != c:
		x = math.ceil(a / c)
	else:
		x = 1
	if b != d:
		y = math.ceil(b / d)
	else:
		y = 1
	if x + y <= k:
		print(f'{x} {y}')
	else:
		print(-1)
	t -= 1


n = int(input())
for i in range(n):
	p = 0
	pe = 0
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		p = a // c
	else:
		p = a // c + 1
	if b % d == 0:
		pe = b // d
	else:
		pe = b // d + 1
	if p + pe <= k:
		print(p, pe)
	else:
		print(-1)


import math
for i in range(int(input())):
	(a, b, c, d, e) = [int(x) for x in input().split()]
	res1 = math.ceil(a / c)
	res2 = math.ceil(b / d)
	res = res1 + res2
	if res > e:
		print(-1)
	else:
		print(res1, res2)


t = int(input())
for g in range(t):
	(a, b, c, d, k) = map(int, input().split())
	lec = a // c
	if a % c != 0:
		lec += 1
	prac = b // d
	if b % d != 0:
		prac += 1
	tot = lec + prac
	if tot > k:
		print(-1)
	else:
		print(lec, prac)


import math
t = int(input())
a = []
b = []
c = []
d = []
k = []
for i in range(t):
	A = input().split()
	a.append(int(A[0]))
	b.append(int(A[1]))
	c.append(int(A[2]))
	d.append(int(A[3]))
	k.append(int(A[4]))
for i in range(t):
	l = math.ceil(a[i] / c[i])
	f = math.ceil(b[i] / d[i])
	if l + f > k[i]:
		print(-1)
	else:
		print(l, f)


t = int(input())
while t:
	(a, b, c, d, k) = map(int, input().split(' '))
	pens = 0
	pencils = 0
	while a > 0:
		pens += 1
		a -= c
	while b > 0:
		pencils += 1
		b -= d
	if k < pens + pencils:
		print('-1')
	else:
		pens += k - pens - pencils
		print('{} {}'.format(pens, pencils))
	t -= 1


import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

def ceil(a):
	return int(-(-a // 1))
N = int(input())
for _ in range(N):
	(a, b, c, d, e) = map(int, input().split())
	pen = ceil(a / c)
	pencil = ceil(b / d)
	if pen + pencil > e:
		print(-1)
	else:
		print(pen, pencil)


def main():
	import sys
	input = sys.stdin.readline

	def solve():
		(a, b, c, d, k) = map(int, input().split())
		x = (a + c - 1) // c
		y = (b + d - 1) // d
		if x + y > k:
			print(-1)
		else:
			print(x, y)
	for _ in range(int(input())):
		solve()
	return 0
main()


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	from math import ceil
	t = ceil(a / x) + ceil(b / y)
	if t <= n:
		print(ceil(a / x), ceil(b / y))
	else:
		print(-1)


for i in range(int(input())):
	(lections, practic, pen_lections, pencil_practic, penanl) = input().split()
	lections = int(lections)
	practic = int(practic)
	pen_lections = int(pen_lections)
	pencil_practic = int(pencil_practic)
	penanl = int(penanl)
	if lections / pen_lections != lections // pen_lections:
		pencils = int(lections / pen_lections) + 1
	else:
		pencils = lections / pen_lections
	if practic / pencil_practic != practic // pencil_practic:
		pens = int(practic / pencil_practic) + 1
	else:
		pens = practic / pencil_practic
	if pencils + pens <= penanl:
		print(int(pencils), int(pens))
	else:
		print(-1)


t = int(input())
for w in range(t):
	(a, b, c, d, k) = (int(i) for i in input().split())
	if b % d == 0:
		p2 = b // d
	else:
		p2 = b // d + 1
	if (k - p2) * c >= a:
		print(k - p2, p2)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	(n, m) = ((a + c - 1) // c, (b + d - 1) // d)
	if n + m <= k:
		print(n, m)
	else:
		print(-1)


import math
for x in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	num1 = math.ceil(a / c)
	num2 = math.ceil(b / d)
	if num1 + num2 <= k:
		print(num1, num2)
	else:
		print(-1)


import math
for _ in range(int(input())):
	(c, p, pen, pencil, ma) = map(int, input().split())
	mipen = math.ceil(c / pen)
	mipencil = math.ceil(p / pencil)
	if mipen + mipencil > ma:
		print(-1)
	else:
		print(mipen, mipencil)


from math import ceil
t = int(input())
reult = ''
for i in range(t):
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	c = int(line[2])
	d = int(line[3])
	k = int(line[4])
	pen = ceil(a / c)
	pencils = ceil(b / d)
	if pen + pencils <= k:
		result = '{} {}'.format(pen, pencils)
	else:
		result = '-1'
	print(result)


n = int(input())
for i in range(n):
	(x, x1) = (0, 0)
	(a, b, c, d, k) = map(int, input().split())
	if a > c:
		x += a // c
		if a % c > 0:
			x += 1
	else:
		x = 1
	if b > d:
		x1 += b // d
		if b % d > 0:
			x1 += 1
	else:
		x1 = 1
	if x + x1 <= k:
		print(x, x1)
	else:
		print(-1)


t = int(input())

def enough(a, b, c, d, k):
	x = 0
	if a % c == 0:
		x += a // c
	else:
		x += a // c + 1
	if (k - x) * d >= b:
		print(x, k - x)
	else:
		print(-1)
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	enough(a, b, c, d, k)


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 7)

def iin():
	return int(stdin.readline())

def lin():
	return list(map(int, stdin.readline().split()))

def main():
	for _ in range(iin()):
		(a, b, c, d, k) = lin()
		(x, y) = ((a + c - 1) // c, (b + d - 1) // d)
		if x + y > k:
			print(-1)
		else:
			print(x, y)
try:
	main()
except Exception as e:
	print(e)


from math import ceil
test_case = int(input())
result = [[] for i in range(test_case)]
for _ in range(test_case):
	array = list(map(int, input().split()))
	a = array[0]
	b = array[1]
	c = array[2]
	d = array[3]
	k = array[4]
	no_of_pens = ceil(a / c)
	no_of_pencil = ceil(b / d)
	if no_of_pencil + no_of_pens <= k:
		result[_].append(no_of_pens)
		result[_].append(no_of_pencil)
	else:
		result[_].append(-1)
for i in range(test_case):
	print(*result[i])


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	f = math.ceil(a / c)
	h = math.ceil(b / d)
	if f + h <= k:
		print(f, h)
	else:
		print(-1)


t_case = int(input())
while t_case:
	t_case -= 1
	xxx = input().split(' ')
	a = int(xxx[0])
	b = int(xxx[1])
	c = int(xxx[2])
	d = int(xxx[3])
	k = int(xxx[4])
	ans1 = int(a / c)
	if a % c != 0:
		ans1 += 1
	ans2 = int(b / d)
	if b % d != 0:
		ans2 += 1
	if ans1 + ans2 <= k:
		print(ans1, ans2)
	else:
		print('-1')


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(a, b, c, d, k) = MAP()
	pen = ceil(a, c)
	pencil = ceil(b, d)
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


import math as m
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	x = m.ceil(a / c)
	y = m.ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print('{} {}'.format(x, y))


import math
t = int(input())
abcdk = [list(map(int, input().split())) for _ in range(t)]
for abcdki in abcdk:
	x = math.ceil(abcdki[0] / abcdki[2])
	y = math.ceil(abcdki[1] / abcdki[3])
	if x + y <= abcdki[4]:
		print(str(x) + ' ' + str(y))
	else:
		print(-1)


from math import ceil
n = int(input())
salida = [0] * n
for i in range(0, n):
	cad = input()
	cad = cad.split(' ')
	a = int(cad[0])
	b = int(cad[1])
	c = int(cad[2])
	d = int(cad[3])
	k = int(cad[4])
	x = ceil(a / c)
	y = ceil(b / d)
	if x + y <= k:
		salida[i] = str(x) + ' ' + str(y)
	else:
		salida[i] = -1
for i in range(0, n):
	print(salida[i])


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(pens, pencs) = (a // c, b // d)
	if a % c:
		pens = a // c + 1
	if b % d:
		pencs = b // d + 1
	if pens + pencs > k:
		print(-1)
	else:
		print(pens, pencs)


import math
n = int(input())
a = []
for i in range(n):
	b = list(map(int, input().split()))
	a.append(b)
for i in range(len(a)):
	r = math.ceil(a[i][0] / a[i][2])
	k = math.ceil(a[i][1] / a[i][3])
	p = a[i][-1]
	if r + k > p:
		print(-1)
	else:
		print(r, p - r)


import math
try:
	t = int(input())
	for each in range(0, t):
		default = -1
		(a, b, c, d, k) = map(int, input().split())
		no_of_pen = math.ceil(a / c)
		no_of_pencil = math.ceil(b / d)
		if no_of_pencil + no_of_pen <= k:
			print(no_of_pen, no_of_pencil)
		else:
			print(default)
except:
	pass


import math

def k():
	inp = list(map(int, input().split()))
	lects = inp[0]
	practs = inp[1]
	pen_c = inp[2]
	penc_c = inp[3]
	c = inp[4]
	need_p = math.ceil(lects / pen_c)
	need_pc = math.ceil(practs / penc_c)
	if need_p + need_pc <= c:
		print(*(need_p, need_pc))
	else:
		print(-1)
n = int(input())
for i in range(n):
	k()


for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	j = (a + c - 1) // c
	i = (b + d - 1) // d
	if i + j > k:
		print(-1)
	else:
		print(j, i)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	x = 0
	while k > 0 and x * c < a:
		x += 1
	if x * c >= a and (k - x) * d >= b:
		print(f'{x} {k - x}')
	else:
		print(-1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	(a, b, c, d, k) = map(int, input().split())
	(x, y) = (ceil(a / c), ceil(b / d))
	if x + y > k:
		print(-1)
	else:
		print(x, y)


t = int(input())
s = 0
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0 and a >= c:
		s = s + a // c
		l = a // c
	else:
		s = s + (a // c + 1)
		l = a // c + 1
	if b % d == 0 and b >= d:
		s = s + b // d
		h = b // d
	else:
		s = s + (b // d + 1)
		h = b // d + 1
	if s <= k:
		print(l, h)
	else:
		print(-1)
	s = 0


for i in range(int(input())):
	(a, b, c, d, k) = list(map(lambda y: int(y), input().split()))
	np = (a + c - 1) // c
	npn = (b + d - 1) // d
	if np + npn > k:
		print(-1)
	else:
		print(np, npn)


t = int(input())
for i in range(t):
	q = input().split()
	a = int(q[0])
	b = int(q[1])
	c = int(q[2])
	d = int(q[3])
	k = int(q[4])
	x = 0
	y = 0
	if a % c != 0:
		x = a // c + 1
	else:
		x = a // c
	if b % d != 0:
		y = b // d + 1
	else:
		y = b // d
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import os, sys, atexit
from io import BytesIO, StringIO
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
q = int(input().strip())
for _ in range(q):
	(a, b, c, d, k) = map(int, input().strip().split())
	if c >= a:
		x = 1
	else:
		x = a // c
		if a % c > 0:
			x += 1
	if d >= b:
		y = 1
	else:
		y = b // d
		if b % d > 0:
			y += 1
	if x + y <= k:
		print(x, ' ', y)
	else:
		print(-1)


import math

def main():
	(a, b, c, d, k) = map(int, input().split())
	a = math.ceil(a / c)
	b = math.ceil(b / d)
	if a + b > k:
		print('-1')
	else:
		print('%d %d' % (a, b))
kase = int(input())
for _ in range(kase):
	main()


import math as m

def cabe(a, b, c, d, k):
	t = m.ceil(a / c)
	p = m.ceil(b / d)
	if p + t <= k:
		return (t, p)
	else:
		return -1
tests = int(input())
for i in range(tests):
	nums = list(map(int, input().split()))
	if cabe(nums[0], nums[1], nums[2], nums[3], nums[4]) == -1:
		print(-1)
	else:
		(x, y) = cabe(nums[0], nums[1], nums[2], nums[3], nums[4])
		print(x, ' ', y)


from math import ceil
n = int(input())
for i in range(n):
	(a, b, c, d, e) = map(int, input().split())
	k1 = ceil(a / c)
	if k1 == 0:
		k1 = 1
	k2 = ceil(b / d)
	if k2 == 0:
		k2 = 1
	if k1 + k2 <= e:
		print(*[k1, k2])
	else:
		print(-1)


for q in range(int(input())):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	pens = (a + c - 1) // c
	pcls = (b + d - 1) // d
	if pens + pcls > k:
		print(-1)
	else:
		print(pens, pcls)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
testcases = int(input())
for j in range(testcases):
	(a, b, c, d, k) = map(int, input().split())
	a1 = math.ceil(a / c)
	a2 = math.ceil(b / d)
	if a1 + a2 <= k:
		print(a1, a2)
	else:
		print(-1)


import math
for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


n = int(input())
import math
for i in range(n):
	list1 = [int(x) for x in input().split(' ')]
	n1 = math.ceil(list1[0] / list1[2])
	n2 = math.ceil(list1[1] / list1[3])
	if n1 + n2 <= list1[4]:
		print(n1, n2, sep=' ')
	else:
		print('-1')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		(a, b, c, d, k) = LI()
		t = (a + c - 1) // c
		u = (b + d - 1) // d
		if t + u <= k:
			rr.append(JA([t, u], ' '))
		else:
			rr.append(-1)
	return JA(rr, '\n')
print(main())


def main():
	t = int(input())
	out = list()
	for i in range(t):
		inp = input().split(' ')
		a = int(inp[0])
		b = int(inp[1])
		c = int(inp[2])
		d = int(inp[3])
		k = int(inp[4])
		req_pen_rem = a % c
		if req_pen_rem > 0:
			req_pen = a // c + 1
		else:
			req_pen = a // c
		req_penc_rem = b % d
		if req_penc_rem > 0:
			req_penc = b // d + 1
		else:
			req_penc = b // d
		if req_pen + req_penc > k:
			out.append('-1')
		else:
			res = str(req_pen) + ' ' + str(req_penc)
			out.append(res)
	for elem in out:
		print(elem)
main()


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
from math import ceil
for _ in range(int(f_input())):
	(lec, prac, lec_pens, prac_pencils, capacity) = map(int, f_input().split())
	(pens, pencils) = (ceil(lec / lec_pens), ceil(prac / prac_pencils))
	if pens + pencils > capacity:
		f_print('-1\n')
	else:
		f_print(str(pens) + ' ' + str(pencils) + '\n')


t = int(input())
for _ in range(t):
	numbers = input().split(' ')
	contPens = 0
	contPencils = 0
	contPens += int(int(numbers[0]) / int(numbers[2]))
	if int(numbers[0]) / int(numbers[2]) > contPens:
		contPens += 1
	contPencils += int(int(numbers[1]) / int(numbers[3]))
	if int(numbers[1]) / int(numbers[3]) > contPencils:
		contPencils += 1
	if contPens + contPencils <= int(numbers[4]):
		print(contPens)
		print(contPencils)
	else:
		print('-1')


t = int(input())
for t_ in range(t):
	(a, b, c, d, k) = [int(inp) for inp in input().split()]
	pens_needed = a // c + (1 if a % c else 0)
	kar_needed = b // d + (1 if b % d else 0)
	if pens_needed + kar_needed > k:
		print(-1)
	else:
		print(pens_needed, k - pens_needed)


import math
n = int(input())
for i in range(n):
	num = list(map(int, input().split()))
	count_of_lekcii = num[0]
	count_of_practic = num[1]
	count_of_pen = num[2]
	count_of_pencil = num[3]
	count = num[4]
	res_pen = math.ceil(count_of_lekcii / count_of_pen)
	res_pencil = math.ceil(count_of_practic / count_of_pencil)
	if res_pencil + res_pen <= count:
		print(res_pen, res_pencil)
	else:
		print(-1)


t = int(input())
l = []
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	p = a / c
	q = b / d
	if int(p) < p:
		p = int(p) + 1
	else:
		p = int(p)
	if int(q) < q:
		q = int(q) + 1
	else:
		q = int(q)
	if p + q <= k:
		m = str(p) + ' ' + str(q)
		l.append(m)
	else:
		l.append(-1)
for x in l:
	print(x)


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pens = 0
	pencils = 0
	if a < c:
		pens = 1
	elif a % c == 0:
		pens = a // c
	else:
		pens = a // c + 1
	if b < d:
		pencils = 1
	elif b % d == 0:
		pencils = b // d
	else:
		pencils = b // d + 1
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print(-1)


for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	x1 = a // c
	x2 = a % c
	x = x1
	if x2 > 0:
		x = x + 1
	y1 = b // d
	y2 = b % d
	y = y1
	if y2 > 0:
		y = y + 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import array
import math
import os
import sys

def main():
	T = read_int()
	for _ in range(T):
		(A, B, C, D, K) = read_ints()
		ans = solve(A, B, C, D, K)
		if not ans:
			print('-1')
		else:
			print(*ans)

def solve(A, B, C, D, K):
	x = (A + C - 1) // C
	y = (B + D - 1) // D
	if x + y > K:
		return None
	return [x, y]
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
main()


def solve(a, b, c, d, k):
	lct = 1 if c >= a else a // c + min(1, a % c)
	prc = 1 if d >= b else b // d + min(1, b % d)
	return -1 if lct + prc > k else ' '.join(map(str, [lct, k - lct]))
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	print(solve(a, b, c, d, k))


import math
n = int(input())
for i in range(n):
	s = list(map(int, input().split()))
	a = math.ceil(s[0] / float(s[2]))
	b = math.ceil(s[1] / float(s[3]))
	if a + b <= s[4]:
		print(a, b)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(l_nr, s_nr, pencap, pensilcap, policap) = (int(x) for x in input().split())
	pennr = (l_nr + pencap - 1) // pencap
	pensil_nr = (s_nr + pensilcap - 1) // pensilcap
	if pennr + pensil_nr > policap:
		print(-1)
	else:
		print(pennr, pensil_nr)


from math import ceil
t = int(input())
for c in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	pen = ceil(a / c)
	pencil = ceil(b / d)
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


t = int(input())
for i in range(t):
	(a, b, c, d, e) = input().strip().split(' ')
	(a, b, c, d, e) = [int(a), int(b), int(c), int(d), int(e)]
	p = a // c
	if a % c:
		p += 1
	q = b // d
	if b % d:
		q += 1
	if p + q > e:
		print(-1)
	else:
		print(p, q)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	ans = ((a + c - 1) // c, (b + d - 1) // d)
	if sum(ans) > k:
		print(-1)
	else:
		print(*ans)


import math
t = int(input())
while t:
	m = list(map(int, input().split()))
	a = math.ceil(m[0] / m[2])
	b = math.ceil(m[1] / m[3])
	c = a + b
	if c <= m[4]:
		print(a, b)
	else:
		print(-1)
	t -= 1


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		n_pen = a // c
	else:
		n_pen = a // c + 1
	if b % d == 0:
		n_pencil = b // d
	else:
		n_pencil = b // d + 1
	if n_pencil + n_pen <= k:
		print(n_pen, n_pencil)
	else:
		print(-1)


from math import ceil
for i in range(int(input())):
	X = list(map(int, input().split()))
	(pen, pencile) = (0, 0)
	pen = ceil(X[0] / X[2])
	pencile = ceil(X[1] / X[3])
	if pen + pencile > X[-1]:
		print(-1)
	else:
		print(pen, pencile)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	e = 1
	f = 1
	c2 = c
	d2 = d
	while c < a:
		e += 1
		c += c2
	while d < b:
		f += 1
		d += d2
	if f + e > k:
		print('-1')
	else:
		print(e, f)


from math import ceil

def main():
	t = int(input().strip())
	for _ in range(t):
		(a, b, c, d, k) = map(int, input().strip().split())
		pens = ceil(a / c)
		pencils = ceil(b / d)
		if pens + pencils <= k:
			print(pens, pencils)
		else:
			print(-1)
main()


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	m = 0
	x = 0
	if (a / c).is_integer() == False:
		m = m + 1 + a // c
	else:
		m = m + a // c
	if (b / d).is_integer() == False:
		x = x + 1 + b // d
	else:
		x = x + b // d
	if m + x > k:
		print('-1')
	else:
		print(m, x)


import sys
import math
input = sys.stdin.readline
T = int(input())
for i in range(0, T):
	(a, b, c, d, k) = map(int, input().split())
	ans1 = math.ceil(a / c)
	ans2 = math.ceil(b / d)
	if ans1 + ans2 > k:
		print('-1')
	else:
		print(ans1, end=' ')
		print(ans2)


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	ac = math.ceil(a / c)
	bd = math.ceil(b / d)
	if ac + bd > k:
		print(-1)
	else:
		print(k - bd, ' ', bd)


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	p = a // c + (a % c != 0)
	q = b // d + (b % d != 0)
	if p + q > k:
		print(-1)
	else:
		print(p, k - p)


T_ON = 1
DEBUG_ON = 0
MOD = 998244353

def solve():
	(a, b, c, d, k) = read_ints()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : [int(i) for i in inp().split()]
li0 = lambda x: [0 for i in range(x)]
stent = lambda : [i for i in inp()]
t = iinp()
for _ in range(t):
	(lectures, practicas, pluma, lapiz, case) = ent()
	x = (lectures + pluma - 1) // pluma
	y = (practicas + lapiz - 1) // lapiz
	if x + y > case:
		print(-1)
	else:
		print('%i %i' % (x, y))


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	first = math.ceil(a / c)
	second = math.ceil(b / d)
	if first + second <= k:
		print(first, second)
	else:
		print(-1)


t = int(input())
for i in range(t):
	p = list(map(int, input().split()))
	a = p[0]
	b = p[1]
	c = p[2]
	d = p[3]
	k = p[4]
	x = 0
	y = 0
	if a % c == 0:
		x += a // c
	else:
		x += a // c + 1
	if b % d == 0:
		y += b // d
	else:
		y += b // d + 1
	if x + y <= k:
		print(x, end=' ')
		print(y)
	else:
		print(-1)


import math
t = int(input())
i = 0
while i < t:
	mass = list(input().split())
	a = int(mass[0])
	b = int(mass[1])
	c = int(mass[2])
	d = int(mass[3])
	k = int(mass[4])
	valid = math.ceil(a / c) + math.ceil(b / d)
	pen = str(math.ceil(a / c))
	pensil = str(math.ceil(b / d))
	if valid > k:
		print(-1)
	else:
		print(pen + ' ' + pensil)
	i += 1


from sys import stdin
from math import ceil
input = stdin.readline
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	if ceil(a / c) + ceil(b / d) <= k:
		print(ceil(a / c), ceil(b / d))
	else:
		print(-1)


import math
t = int(input())
while t > 0:
	(a, b, c, d, k) = map(int, input().split())
	l = int(math.ceil(a / c))
	r = int(math.ceil(b / d))
	if k < l + r:
		print('-1')
	else:
		print(l, r)
	t -= 1


import sys
import math
input = sys.stdin.readline
from collections import defaultdict as dc
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


t = int(input())
tc = list()
for i in range(t):
	tc.append([int(a) for a in input().split()])
for i in range(t):
	(a, b, c, d, k) = (tc[i][0], tc[i][1], tc[i][2], tc[i][3], tc[i][4])
	if int(b / d) == b / d:
		pc = b / d
	else:
		pc = int(b / d) + 1
	if int(a / c) == a / c:
		p = a / c
	else:
		p = int(a / c) + 1
	if p + pc <= k:
		print(int(k - pc), int(pc))
	else:
		print(-1)


j = int(input())
returnList = []
while j > 0:
	e = input()
	(q, w, l, r, t) = e.split()
	counterX = 0
	counterY = 0
	z = int(q) // int(l)
	counterX += z
	p = int(w) // int(r)
	counterY += p
	if int(q[-1]) != 0 and int(q) % int(l) != 0 or (len(q) >= 1 and int(q) % int(l) != 0):
		counterX += 1
	if int(w[-1]) != 0 and int(w) % int(r) != 0 or (len(w) >= 1 and int(w) % int(r) != 0):
		counterY += 1
	if counterX == 0:
		counterX += 1
	if counterY == 0:
		counterY += 1
	if counterX + counterY > int(t):
		returnList.append(str(-1))
		j -= 1
		continue
	returnList.append([str(counterX), str(counterY)])
	j -= 1
for x in returnList:
	if x == '-1':
		print('-1')
	else:
		print(' '.join(x))


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	j = l = 1
	while j * c < a:
		j += 1
	x = j
	while l * d < b:
		l += 1
	y = l
	if x + y <= k:
		print(str(x) + ' ' + str(y))
	else:
		print(str(-1))


from math import ceil
R = lambda : list(map(int, input().split()))
n = int(input())
for _ in range(n):
	(a, b, c, d, k) = R()
	tmp1 = ceil(a / c)
	tmp2 = ceil(b / d)
	if tmp1 + tmp2 <= k:
		print(tmp1, tmp2)
	else:
		print(-1)


def num(a, b, c, d, k):
	x = a // c + (1 if a % c != 0 else 0)
	y = b // d + (1 if b % d != 0 else 0)
	if x + y > k:
		return -1
	return [x, y]
t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(j) for j in input().split()]
	ans = num(a, b, c, d, k)
	if ans == -1:
		print(-1)
	else:
		print(str(ans[0]) + ' ' + str(ans[1]))


import math
testCase = int(input())
for i in range(testCase):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	item1 = math.ceil(a / c)
	item2 = math.ceil(b / d)
	if item1 + item2 <= k:
		print(item1, item2)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	if a % c != 0 or a < c:
		pen = a // c + 1
	else:
		pen = a // c
	if b % d != 0 or b < d:
		pencil = b // d + 1
	else:
		pencil = b // d
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().strip().split())
	from math import ceil
	n = ceil(a / c)
	m = ceil(b / d)
	if n + m <= k:
		print(n, m)
	else:
		print(-1)


inp = lambda cast=int: [cast(x) for x in input().split()]
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
(t,) = inp()
for _ in range(t):
	(a, b, c, d, k) = inp()
	na = a // c + (1 if a % c else 0)
	nb = b // d + (1 if b % d else 0)
	n = na + nb
	if n <= k:
		print(na, nb)
	else:
		print(-1)


import math
case = int(input())
for caseNum in range(0, case):
	(a, b, c, d, e) = [int(x) for x in input().split()]
	if math.ceil(a / c) + math.ceil(b / d) <= e:
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)


import math
tests = int(input())
for i in range(tests):
	array = [int(i) for i in input().split()]
	pens = math.ceil(array[0] / array[2])
	pencil = math.ceil(array[1] / array[3])
	if pens + pencil <= array[4]:
		print(pens, pencil)
	else:
		print('-1')


n = int(input())
for i in range(n):
	k = list(map(int, input().split()))
	if k[0] % k[2] == 0:
		x = k[0] // k[2]
	else:
		x = k[0] // k[2] + 1
	if k[1] % k[3] == 0:
		y = k[1] // k[3]
	else:
		y = k[1] // k[3] + 1
	if x + y <= k[-1]:
		print(x, y)
	else:
		print('-1')


q = int(input())
for _ in range(q):
	(a, b, c, d, k) = map(int, input().split())
	num_c = -(-a // c)
	num_d = -(-b // d)
	if num_c + num_d > k:
		print(-1)
	else:
		print(num_c, k - num_c)


from sys import stdin, stdout
import math
t = stdin.readline()
t = int(t)
for _ in range(t):
	(a, b, c, d, k) = stdin.readline().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	k = int(k)
	pens = int(math.ceil(a / c))
	pencils = int(math.ceil(b / d))
	print(str(pens) + ' ' + str(pencils) if pens + pencils <= k else -1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	res = a // c
	if a % c > 0:
		res += 1
	res2 = b // d
	if b % d > 0:
		res2 += 1
	if res + res2 <= k:
		print(res, res2)
	else:
		print(-1)


import sys
readline = sys.stdin.readline
t = [int(x) for x in input().split()]
for _ in range(t[0]):
	(a, b, c, d, k) = map(int, readline().split())
	tmp1 = int(a / c)
	tmp2 = int(b / d)
	if a % c != 0:
		tmp1 += 1
	if b % d != 0:
		tmp2 += 1
	if tmp1 + tmp2 > k:
		print(-1)
	else:
		print(tmp1, end=' ')
		print(tmp2)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	ans = False
	pen = True
	cil = True
	if c >= a:
		x = 1
		pen = False
		ans = True
	if d >= b:
		y = 1
		cil = False
		ans = True
	if pen:
		ans = True
		if a % c == 0:
			x = a // c
		else:
			x = a // c + 1
	if cil:
		ans = True
		if b % d == 0:
			y = b // d
		else:
			y = b // d + 1
	if ans and x + y <= k:
		print(x, y)
	else:
		print(-1)


def main():
	(a, b, c, d, k) = map(int, input().split())
	pen = (a + c - 1) // c
	pencil = (b + d - 1) // d
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)
	return

def test():
	t = int(input())
	while t:
		main()
		t -= 1
test()


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	s = 0
	if a == c:
		j = 0
	else:
		for j in range(k):
			if c * j < a <= c * (j + 1):
				break
	if b == d:
		e = 0
	else:
		for e in range(k):
			if d * e < b <= d * (e + 1):
				break
	if j + e + 2 > k:
		print('-1')
	else:
		print(j + 1, e + 1)


n = int(input())
for i in range(0, n):
	(a, b, c, d, k) = map(int, input().split())
	ta = a // c + 1 if a % c > 0 else a // c
	tb = b // d + 1 if b % d > 0 else b // d
	if ta + tb > k:
		print(-1)
	else:
		print(ta, tb)


def solve(test):
	(a, b, c, d, k) = map(int, input().split())
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y <= k:
		print(x, y)
	else:
		print(-1)
t = int(input())
for _ in range(t):
	solve(_ + 1)


for x in range(int(input())):
	(a, b, c, d, k) = map(int, input().strip().split()[:5])
	if a % c == 0:
		p = int(a / c)
	else:
		p = int(a / c) + 1
	if b % d == 0:
		q = int(b / d)
	else:
		q = int(b / d) + 1
	if p + q <= k:
		print(p, q)
	else:
		print(-1)


from math import ceil
t = int(input())
while t > 0:
	(a, b, c, d, k) = map(int, input().split())
	sol1 = int(ceil(a / c))
	sol2 = int(ceil(b / d))
	if sol1 + sol2 <= k:
		print(sol1, sol2)
	else:
		print('-1')
	t -= 1


import math
n = int(input())
for i in range(0, n):
	(a, b, c, d, k) = list(map(int, input().split()))
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


t = int(input())
ans = []
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if a % c != 0:
		a = a // c + 1
	else:
		a = a // c
	if b % d != 0:
		b = b // d + 1
	else:
		b = b // d
	if a + b <= k:
		ans.append(' '.join([str(a), str(b)]))
	else:
		ans.append('-1')
[print(i) for i in ans]


k = int(input())
for i in range(k):
	y = list(map(int, input().split()))
	pens = y[0] / y[2]
	pencils = y[1] / y[3]
	if pens > int(pens):
		pens += 1
		pens = int(pens)
	if pencils > int(pencils):
		pencils += 1
		pencils = int(pencils)
	sum = pens + pencils
	if sum > y[4]:
		print(-1)
	else:
		print(int(pens), int(pencils))


import array
import math as m

def buffer():
	req = int(input())
	for i in range(req):
		input()
		prices = array_to_int(input().split(' '))
		first = len(prices) * [0]
		intermidiate = array_to_int(input().split(' '))
		for ii in range(0, len(first), intermidiate[1]):
			if ii == 0:
				continue
			first[ii] += intermidiate[0]
		intermidiate = array_to_int(input().split(' '))
		for ii in range(0, len(first), intermidiate[1]):
			if ii == 0:
				continue
			first[ii] += intermidiate[0]
		ii = 1
		while ii < len(first):
			if prices[ii - 1] < prices[ii] and first[ii - 1] > first[ii] or (prices[ii - 1] > prices[ii] and first[ii - 1] < first[ii]):
				(prices[ii - 1], prices[ii]) = (prices[ii], prices[ii - 1])
				ii = 1
			else:
				ii += 1
		print(prices)
		print([first[i] * prices[i] // 100 for i in range(len(first))])
		must_sum = int(input())
		for j in range(len(first)):
			must_sum -= first[j] * prices[j]
			if must_sum <= 0:
				print(j + 1)
				break
		else:
			print(-1)

def deleted_segments(array):
	result = 0
	last_palindrome = False
	for i in range(len(array)):
		for spl in range(2, len(array), 2):
			if i + spl > len(array):
				break
			if stack_deleted(array[i:i + spl]):
				result += 1
	return result

def stack_deleted(sub_array):
	new_stack = array.array('u', [])
	last = 0
	for i in sub_array:
		if len(new_stack) == 0:
			new_stack.append(i)
		elif new_stack[-1] == i:
			new_stack.pop(len(new_stack) - 1)
		else:
			new_stack.append(i)
	return len(new_stack) == 0

def solution():
	req = int(input())
	for i in range(req):
		(lections, practise, pen_for_lect, pencils_for_pract, size) = array_to_int(input().split(' '))
		result_for_first = lections // pen_for_lect
		if lections % pen_for_lect:
			result_for_first += 1
		result_for_second = practise // pencils_for_pract
		if practise % pencils_for_pract:
			result_for_second += 1
		if result_for_first + result_for_second > size:
			print(-1)
		else:
			print(f'{result_for_first} {result_for_second}')

def count_of_one(number):
	result = 0
	while number:
		result += number % 2
		number /= 2
	return result

def rindex(seq, thing):
	for i in range(len(seq) - 1, -1, -1):
		if seq[i] == thing:
			return i

def to_mixed_frac(first, second):
	while True:
		for i in range(2, first + 1):
			if first % i == 0 and second % i == 0:
				first //= i
				second //= i
				break
		else:
			break
	return str(first) + '/' + str(second)

def array_to_int(array):
	for i in range(len(array)):
		array[i] = int(array[i])
	return array

def join0(array):
	result = ''
	for i in array:
		result += str(i)
	return result

def replace(string, new_ch, index):
	new_str = ''
	for i in range(len(string)):
		if i == index:
			new_str += new_ch
		else:
			new_str += string[i]
	return new_str
solution()


test_cases = int(input())

def pensPencils(x, y):
	p = x // y
	if x % y == 0:
		return p
	return p + 1
for i in range(test_cases):
	(a, b, c, d, k) = map(int, input().split(' '))
	if pensPencils(a, c) + pensPencils(b, d) <= k:
		print(pensPencils(a, c), ' ', pensPencils(b, d))
	else:
		print(-1)


import math
t = int(input())
res = []
for _ in range(t):
	L = list(map(int, input().split()))
	a = L[0]
	b = L[1]
	c = L[2]
	d = L[3]
	k = L[4]
	pen1 = math.ceil(a / c)
	pen2 = math.ceil(b / d)
	if pen1 + pen2 <= k:
		res.append([pen1, pen2])
	else:
		res.append([-1])
for i in res:
	print(*i)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = (int(x) for x in input().split())
	x = a / c
	if x != int(x):
		x = int(x) + 1
	y = b / d
	if y != int(y):
		y = int(y) + 1
	if x + y <= k:
		print(int(x), int(y))
	else:
		print(-1)


import math
number_of_test_cases = int(input())
test_cases = []
for i in range(0, number_of_test_cases):
	test_cases.append([int(i) for i in input().split()])
for case in test_cases:
	(a, b, c, d, e) = [int(i) for i in case]
	max_pen = math.ceil(a / c)
	max_pencil = math.ceil(b / d)
	total_items = max_pen + max_pencil
	if total_items <= e:
		print('%d %d' % (max_pen, max_pencil))
	else:
		print(-1)


import math
test = input()
test = int(test)
for i in range(test):
	s = input()
	t = s.split(' ')
	pen = math.ceil(int(t[0]) / int(t[2]))
	pencil = math.ceil(int(t[1]) / int(t[3]))
	if pen + pencil > int(t[4]):
		print('-1')
	else:
		print('%d %d' % (pen, pencil))


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	l = ceil(a / c)
	l1 = ceil(b / d)
	if l1 + l > k:
		print(-1)
	else:
		print(l, end=' ')
		print(l1)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	p1 = a // c
	if a % c != 0:
		p1 += 1
	p2 = b // d
	if b % d != 0:
		p2 += 1
	if p1 + p2 > k:
		print(-1)
	else:
		print(p1, p2)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	lec = a // c
	if a % c:
		lec += 1
	pract = b // d
	if b % d:
		pract += 1
	if lec + pract <= k:
		print(lec, pract)
	else:
		print(-1)


from math import ceil
t = input()
line = {}
lessons = {}
practice = {}
pen = {}
pencil = {}
sum = {}
pen_need = {}
pencil_need = {}
for i in range(0, int(t)):
	line[i] = input()
	lessons[i] = line[i].split(' ')[0]
	practice[i] = line[i].split(' ')[1]
	pen[i] = line[i].split(' ')[2]
	pencil[i] = line[i].split(' ')[3]
	sum[i] = line[i].split(' ')[4]
	pen_need[i] = ceil(int(lessons[i]) / int(pen[i]))
	pencil_need[i] = ceil(int(practice[i]) / int(pencil[i]))
for i in range(0, int(t)):
	if pen_need[i] + pencil_need[i] <= int(sum[i]):
		print(str(pen_need[i]) + ' ' + str(pencil_need[i]))
	else:
		print('-1')


t = int(input())

def f(a, b, c, d, k):
	if a // c == a / c:
		x = a // c
	else:
		x = a // c + 1
	if b // d == b / d:
		y = b // d
	else:
		y = b // d + 1
	if x + y <= k:
		return (x, y)
	else:
		return -1
for i in range(0, t):
	(a, b, c, d, k) = map(int, input().split())
	s = f(a, b, c, d, k)
	if s == -1:
		print(s)
	else:
		print('{0} {1}'.format(s[0], s[1]))


from math import *
for z in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	u = ceil(a / c)
	v = ceil(b / d)
	if u + v <= k:
		print(u, v)
	else:
		print(-1)


import sys
import math
input = sys.stdin.readline
big_number = 10000000
n = int(input())
for i in range(0, n):
	(a, b, c, d, k) = map(int, input().split())
	x = math.ceil(a * 1.0 / c)
	y = math.ceil(b * 1.0 / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
n = int(input())
for _ in range(n):
	(a, b, c, d, k) = list(map(int, input().split()))
	aa = math.ceil(a / c)
	bb = math.ceil(b / d)
	pen = aa
	pencil = k - aa
	if pencil < bb:
		print(-1)
	else:
		print(pen, pencil)


from math import ceil
x = 0
y = 0
t = int(input())
for i in range(t):
	s = [int(i) for i in input().split()]
	a = s[0]
	b = s[1]
	c = s[2]
	d = s[3]
	k = s[4]
	x = ceil(a / c)
	y = ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


def solve(a, b, c, d, k):
	x = a // c + (a % c != 0)
	y = b // d + (b % d != 0)
	if x + y > k:
		print(-1)
	else:
		print(x, y)

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c, d, k) = [int(i) for i in input().split()]
		solve(a, b, c, d, k)
main()


import math
t = int(input())
results = []
for _ in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		results.append((x, y))
	else:
		results.append(-1)
for r in results:
	if r == -1:
		print(-1)
	else:
		print(r[0], r[1])


q = int(input())
for i in range(q):
	(a, b, c, d, e) = map(int, input().split())
	w = (a - 1) // c + 1
	r = (b - 1) // d + 1
	if w + r > e:
		print(-1)
	else:
		print(w, r)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	e = math.ceil(a / c)
	f = math.ceil(b / d)
	if e + f > k:
		print(-1)
	else:
		print(e, f)


import math
dic = {}
i = 1
t = int(input())
while i <= t:
	(a, b, c, d, e) = map(int, input().split())
	kol_vo_ru = math.ceil(a / c)
	kol_vo_ka = math.ceil(b / d)
	if kol_vo_ka + kol_vo_ru <= e:
		dic[i] = [kol_vo_ru, kol_vo_ka]
	else:
		dic[i] = [-1]
	i += 1
for i in dic:
	a = dic[i]
	for j in a:
		print(j, end=' ')
	print()


def main():
	t = int(input())
	for index in range(0, t):
		(a, b, c, d, k) = (int(x) for x in input().split())
		pen = int(a / c)
		pencil = int(b / d)
		if a % c != 0:
			pen += 1
		if b % d != 0:
			pencil += 1
		if pen + pencil > k:
			print(-1)
		else:
			print(f'{pen} {pencil}')
main()


case = int(input())
for i in range(case):
	(a, b, c, d, k) = list(map(int, input().split()))
	countPens = a // c + (1 if a % c != 0 else 0)
	countPencils = b // d + (1 if b % d != 0 else 0)
	if countPens + countPencils > k:
		print(-1)
	else:
		print(str(countPens) + ' ' + str(countPencils))


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	ruc = math.ceil(a / c)
	kar = math.ceil(b / d)
	if ruc + kar > k:
		print(-1)
	else:
		print(k - kar, kar)


import math
vezes = int(input())
for __ in range(vezes):
	(lectures, pratical, lecPen, praPencil, pencilcase) = [int(i) for i in input().split()]
	pens = math.ceil(lectures / lecPen)
	pencils = math.ceil(pratical / praPencil)
	if pencilcase >= pens + pencils:
		print(pens, pencils)
	else:
		print(-1)


import math
q = int(input())
while q:
	(a, b, c, d, k) = list(map(int, input().split()))
	e = math.ceil(a / c)
	f = math.ceil(b / d)
	if e + f <= k:
		print(e, end=' ')
		print(f)
	else:
		print('-1')
	q = q - 1


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = 0
	y = 0
	x = a / c
	if x != int(x):
		x = int(x) + 1
	y = b / d
	if y != int(y):
		y = int(y) + 1
	if x + y <= k:
		print(int(x), int(y))
	else:
		print('-1')


t = int(input())
for test in range(t):
	(l, p, cL, cp, est) = map(int, input().split())
	x = l // cL
	if x * cL < l:
		x += 1
	y = p // cp
	if y * cp < p:
		y += 1
	if x + y > est:
		print(-1)
	else:
		print(x, y)


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, x) = map(int, input().split())
	p = a / c
	p = math.ceil(p)
	q = b / d
	q = math.ceil(q)
	if p + q > x:
		print('-1')
	else:
		print(p, x - p)


def main(a, b, c, d, k):
	if a < c:
		ac = 1
	else:
		ac = int(a / c)
		if a % c != 0:
			ac = ac + 1
	if b < d:
		bd = 1
	else:
		bd = int(b / d)
		if b % d != 0:
			bd = bd + 1
	if bd + ac > k:
		return -1
	else:
		return [ac, bd]
t = int(input())
for t_itr in range(t):
	z = list(map(int, input().rstrip().split()))
	a = z[0]
	b = z[1]
	c = z[2]
	d = z[3]
	k = z[4]
	res = main(a, b, c, d, k)
	if isinstance(res, list):
		print(*res)
	else:
		print(res)


t = int(input())
for test in range(t):
	(a, b, c, d, k) = map(int, input().split(' '))
	res1 = 0
	res2 = 0
	if a % c == 0:
		res1 = a // c
	else:
		res1 = a // c + 1
	if b % d == 0:
		res2 = b // d
	else:
		res2 = b // d + 1
	if res1 + res2 > k:
		print(-1)
	elif res1 + res2 == k:
		print(res1, res2)
	else:
		print(res1, k - res1)


import math
for _ in range(int(input())):
	l = list(map(int, input().split()))
	x = math.ceil(l[0] / l[2])
	y = math.ceil(l[1] / l[3])
	if x + y > l[-1]:
		print(-1)
	else:
		print(x, y)


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	pen = (a + c - 1) // c
	pcl = (b + d - 1) // d
	r = [pen, pcl] if pen + pcl <= k else [-1]
	print(*r)


import sys
for i in range(int(input())):
	line = sys.stdin.readline()
	(A, B, C, D, K) = line.split()
	(a, b, c, d, k) = (int(A), int(B), int(C), int(D), int(K))
	black = (a - 1) // c + 1
	red = (b - 1) // d + 1
	if black + red > k:
		print(-1)
	else:
		print(black, red)


import sys
import math

def get_result():
	a = int(sys.stdin.readline().strip())
	for i in range(a):
		(num_biji, num_tuhua, bi, tu, k) = map(int, sys.stdin.readline().strip().split())
		need_b = math.ceil(num_biji / bi)
		need_t = math.ceil(num_tuhua / tu)
		if need_b + need_t > k:
			print(-1)
		else:
			print(f'{need_b} {need_t}')

def main():
	get_result()
main()


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = a // c
	if a % c != 0:
		x = x + 1
	y = b // d
	if b % d != 0:
		y = y + 1
	if x + y != k and x + y < k:
		h = k - x - y
		x = x + h
		print(x, y)
	elif x + y == k:
		print(x, y)
	elif x + y > k:
		print('-1')


t = int(input())
for q in range(t):
	inp = input()
	l = list((int(i) for i in inp.split()))
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	k = l[4]
	while a % c != 0:
		a = a + 1
	while b % d != 0:
		b = b + 1
	if a // c + b // d > k:
		print('-1')
	else:
		print(a // c, b // d)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(item) for item in input().split()]
	p = (a + c - 1) // c
	q = (b + d - 1) // d
	if p + q <= k:
		print(p, q)
	else:
		print(-1)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(a, b, c, d, k) = invr()
	pen = 1 + (a - 1) // c
	pencil = 1 + (b - 1) // d
	if pen + pencil <= k:
		print(str(pen) + ' ' + str(pencil))
	else:
		print(-1)


from math import ceil
for n in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	p = ceil(a / c)
	if p >= k:
		print(-1)
	else:
		k -= p
		if k * d >= b:
			print(p, k)
		else:
			print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if a % c != 0:
		u = a // c + 1
	else:
		u = a // c
	if b % d != 0:
		v = b // d + 1
	else:
		v = b // d
	t = u + v
	if t <= k:
		print(u, v)
	else:
		print(-1)


T = int(input())
for i in range(T):
	(a, b, c, d, k) = map(int, input().strip().split())
	r = a // c + b // d
	if a % c != 0:
		r = r + 1
	if b % d != 0:
		r = r + 1
	if r <= k:
		if a % c == 0:
			x = a // c
		else:
			x = a // c + 1
		print(' '.join([str(x), str(k - x)]))
	else:
		print(-1)


import math
n = int(input())
arr = []
for i in range(n):
	(a, b, c, d, k) = input().split()
	ar = []
	t = 0
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	k = int(k)
	if c > a or c == a:
		ar.append(1)
		t += 1
	else:
		ar.append(math.ceil(a / c))
		t += math.ceil(a / c)
	if d > b or d == b:
		ar.append(1)
		t += 1
	else:
		ar.append(math.ceil(b / d))
		t += math.ceil(b / d)
	if t > k:
		arr.append(-1)
	else:
		arr.append(ar)
for array in arr:
	if array == -1:
		print(-1)
	else:
		print(' '.join([str(v) for v in array]))


from math import ceil
t = int(input())
for i in range(t):
	(nLectures, nPractical, nLecturesCap, nPracticalCap, pencilcaseSize) = map(int, input().split())
	necessaryPens = ceil(nLectures / nLecturesCap)
	necessaryPencils = ceil(nPractical / nPracticalCap)
	if necessaryPens + necessaryPencils > pencilcaseSize:
		print(-1)
	else:
		print(necessaryPens, necessaryPencils)


import math
t = int(input())
for i in range(0, t):
	line = input()
	line = line.split()
	x = math.ceil(float(line[0]) / float(line[2]))
	y = math.ceil(float(line[1]) / float(line[3]))
	if x + y <= int(line[4]):
		print(str(x) + ' ' + str(y))
	else:
		print(-1)


import sys
from math import ceil

def solve(a, b, c, d, k):
	theory = ceil(a / float(c))
	practice = ceil(b / float(d))
	total = theory + practice
	if total <= k:
		return '{} {}'.format(theory, practice)
	else:
		return '-1'

def main():
	T = int(input())
	while T:
		(a, b, c, d, k) = (int(n) for n in sys.stdin.readline().split())
		print(solve(a, b, c, d, k))
		T -= 1
main()


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


x = int(input())
arr = []
for i in range(x):
	arr.append(list(map(int, input().split())))
for l in range(x):
	s = 0
	if arr[l][0] % arr[l][2] != 0:
		s = s + arr[l][0] // arr[l][2] + 1
	else:
		s = s + arr[l][0] // arr[l][2]
	k = 0
	if arr[l][1] % arr[l][3] != 0:
		k = k + arr[l][1] // arr[l][3] + 1
	else:
		k = k + arr[l][1] // arr[l][3]
	if s + k <= arr[l][4]:
		d = arr[l][4] - s - k
		print(s + d, k)
	else:
		print(-1)


test = int(input())
pen = 0
pencil = 0
while test:
	(a, b, c, d, k) = input().split(' ')
	(a, b, c, d, k) = (int(a), int(b), int(c), int(d), int(k))
	if a % c != 0:
		pen = int(a // c + 1)
	else:
		pen = int(a / c)
	if b % d != 0:
		pencil = int(b // d + 1)
	else:
		pencil = int(b / d)
	if pen + pencil <= k:
		print(pen, end=' ')
		print(pencil)
	else:
		print('-1')
	test -= 1


test = int(input())
for temp in range(test):
	(a, b, c, d, k) = map(int, input().split())
	pen = 1
	pencil = 1
	if a > c:
		pen = a // c
		if a % c != 0:
			pen += 1
	if b > d:
		pencil = b // d
		if b % d != 0:
			pencil += 1
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


n = int(input())
l = []
for i in range(n):
	l.append(list(map(int, input().split(' '))))
for i in range(n):
	if l[i][0] % l[i][2] == 0:
		lect = l[i][0] // l[i][2]
	else:
		lect = l[i][0] // l[i][2] + 1
	if l[i][1] % l[i][3] == 0:
		pra = l[i][1] // l[i][3]
	else:
		pra = l[i][1] // l[i][3] + 1
	if lect + pra > l[i][4]:
		print(-1)
	else:
		print(lect, pra)


n = int(input())
for i in range(0, n):
	ln = [int(j) for j in input().split(' ')]
	a = ln[0]
	b = ln[1]
	c = ln[2]
	d = ln[3]
	k = ln[4]
	n1 = a // c
	if a % c != 0:
		n1 += 1
	n2 = b // d
	if b % d != 0:
		n2 += 1
	if n1 + n2 <= k:
		print(n1, n2)
	else:
		print(-1)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 1000000007
EPS = 1e-06

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(a, b, c, d, k) = value()
	pen = ceil(a / c)
	pencil = ceil(b / d)
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


t = int(input())
arr = []
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		pens = a // c
	else:
		pens = a // c + 1
	if b % d == 0:
		pencil = b // d
	else:
		pencil = b // d + 1
	if pens + pencil <= k:
		print(pens, pencil)
	else:
		print(-1)


import math
t = int(input())
i = 0
while i < t:
	(a, b, c, d, k) = input().split()
	(a, b, c, d, k) = (int(a), int(b), int(c), int(d), int(k))
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	while x + y > k:
		print('-1')
		break
	while x + y <= k:
		a1 = x + (k - (x + y))
		b1 = y
		print(a1, end=' ')
		print(b1)
		break
	i = i + 1


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	(a1, b1) = map(math.ceil, [a / c, b / d])
	if a1 + b1 <= k:
		print(a1, b1)
	else:
		print(-1)


t = int(input())
import math
while t > 0:
	t -= 1
	(a, b, c, d, k) = map(int, input().split(' '))
	ans = 0
	ans1 = int(math.ceil(a / c))
	ans2 = int(math.ceil(b / d))
	if ans1 + ans2 <= k:
		print(ans1, ans2)
	else:
		print(-1)


for _ in [0] * int(input()):
	(a, b, c, d, k) = map(int, input().split())
	r = (0 - -a // c, 0 - -b // d)
	print(*(r, [-1])[sum(r) > k])


t = int(input())
s = []
for nfk in range(0, t):
	x = input()
	xx = x.split()
	a = int(xx[0])
	b = int(xx[1])
	c = int(xx[2])
	d = int(xx[3])
	k = int(xx[4])
	i = int(a // c)
	j = int(b // d)
	if a % c != 0:
		i += 1
	if b % d != 0:
		j += 1
	w = i + j
	if w > k:
		s.append([-1])
	else:
		s.append([i, j])
for i in s:
	for j in i:
		print(j, end=' ')
	print()


import math
t = int(input())
for i in range(t):
	(lectures, practicals, pen_dur, pencil_dur, k) = [int(x) for x in input().split()]
	n_pens = math.ceil(lectures / pen_dur)
	n_pencil = math.ceil(practicals / pencil_dur)
	if n_pens + n_pencil <= k:
		print('{} {}'.format(n_pens, n_pencil))
	else:
		print('-1')


t = int(input())
while t > 0:
	t -= 1
	(a, b, c, d, k) = map(int, input().split())
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y > k:
		print('-1')
	else:
		print(x, y)


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	(a, b, c, d, k) = (arr[0], arr[1], arr[2], arr[3], arr[4])
	e = (a + c - 1) // c
	f = (b + d - 1) // d
	if e + f > k:
		print(-1)
	else:
		print(e, f)


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
import math
for _ in range(ii()):
	(a, b, c, d, k) = f()
	m = math.ceil(a / c)
	n = math.ceil(b / d)
	if m + n <= k:
		print(m, n)
	else:
		print('-1')


from math import ceil as g
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(x, y) = (g(a / c), g(b / d))
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


from math import *
q = int(input())
for i in range(q):
	(a, b, c, d, k) = map(int, input().split())
	t1 = ceil(a / c)
	t2 = ceil(b / d)
	t = t1 + t2
	if k < t:
		print(-1)
	else:
		print(k - t + t1, t2)


n = int(input())
testcase = []
for _ in range(n):
	testcase.append(list(map(int, input().strip().split())))
for i in range(n):
	a = testcase[i][0]
	b = testcase[i][1]
	c = testcase[i][2]
	d = testcase[i][3]
	k = testcase[i][4]
	x = a // c + [0, 1][bool(a % c)]
	y = b // d + [0, 1][bool(b % d)]
	if x + y <= testcase[i][4]:
		print(str(x) + ' ' + str(y), end='\n')
	else:
		print(-1, end='\n')


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split(' '))
	j = 0
	x = 0
	y = 0
	p = 0
	while j <= k:
		x = j
		y = k - x
		if x * c >= a and y * d >= b:
			p = 1
			break
		j += 1
	if p == 0:
		print('-1')
	else:
		z = str(x) + ' ' + str(y)
		print(z)


for i in range(int(input())):
	data = [int(i) for i in input().split()]
	a = data[0]
	b = data[1]
	c = data[2]
	d = data[3]
	k = data[4]
	(x, y) = (0, 0)
	while c * x < a:
		x += 1
	while d * y < b:
		y += 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
t = eval(input())
while t > 0:
	(a, b, c, d, k) = map(int, input().split())
	x = math.ceil(a / c)
	y = k - x
	flag = 0
	if y * d < b or y < 0:
		flag = 1
	if flag == 1:
		print(-1)
	else:
		print(x, y)
	t -= 1


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c, d, k) = [int(x) for x in input().split()]
		ans = []
		ans.append(-(-a // c))
		ans.append(-(-b // d))
		if sum(ans) > k:
			print(-1)
		else:
			print(*ans)
main()


import math
t = int(input())
while t:
	t = t - 1
	(a, b, c, d, k) = [int(x) for x in input().split()]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		print('-1')
	else:
		print(x, y)


from math import ceil
q = int(input())
for i in range(q):
	(a, b, c, d, k) = map(int, input().split())
	p = ceil(a / c)
	pp = ceil(b / d)
	if p + pp > k:
		print(-1)
	else:
		print(p, pp)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	p = (a - 1) // c
	q = (b - 1) // d
	if p + q + 2 > k:
		print(-1)
	else:
		print(p + 1, q + 1)


import math
t = int(input())
for w in range(t):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	if k - (math.ceil(a / c) + math.ceil(b / d)) > -1:
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)


import math
t = int(input())
while t != 0:
	(a, b, c, d, k) = map(int, input().split())
	p = math.ceil(a / c)
	q = math.ceil(b / d)
	if p + q <= k:
		print(p, q)
	else:
		print(-1)
	t -= 1


test = int(input())
import math
res = []
for i in range(test):
	(a, b, c, d, k) = map(int, input().split())
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	if pen + pencil <= k:
		res.append((pen, pencil))
	else:
		res.append(-1)
for i in res:
	if i == -1:
		print(i)
	else:
		print(i[0], i[1], sep=' ')


x = int(input())
for _ in range(x):
	count1 = 0
	count2 = 0
	no_of_pen = 0
	no_of_pencil = 0
	(a, b, c, d, k) = map(int, input().split())
	if a - c <= 0:
		no_of_pen = 1
	else:
		count1 = a // c
		if a % c != 0:
			count1 = count1 + 1
		no_of_pen = count1
	if b - d <= 0:
		no_of_pencil = 1
	else:
		count2 = b // d
		if b % d != 0:
			count2 = count2 + 1
		no_of_pencil = count2
	total = no_of_pen + no_of_pencil
	if total > k:
		print('-1')
	else:
		print(k - no_of_pencil, ' ', no_of_pencil)


import os

def f(a, b, c, d, k):
	c1 = a // c
	if a % c:
		c1 += 1
	c2 = b // d
	if b % d:
		c2 += 1
	if c1 + c2 > k:
		return -1
	else:
		return f'{c1} {c2}'
if os.environ.get('DEBUG', False):
	print(f'{f(7, 5, 4, 5, 8)} = 7 1')
	print(f'{f(7, 5, 4, 5, 2)} = -1')
	print(f'{f(20, 53, 45, 26, 4)} = 1 3')
else:
	t = int(input())
	for _ in range(t):
		(a, b, c, d, k) = list(map(int, input().split()))
		print(f(a, b, c, d, k))


def check(a, b, c, d, k):
	x = a // c
	if a % c:
		x += 1
	y = b // d
	if b % d:
		y += 1
	if x + y <= k:
		return (1, x, y)
	else:
		return (0, 0, 0)
n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	(ans, x, y) = check(a, b, c, d, k)
	if ans:
		print(x, y)
	else:
		print(-1)


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
t = oint()
for _ in range(t):
	(a, b, c, d, k) = rint()
	a1 = a // c
	if a % c:
		a1 += 1
	a2 = b // d
	if b % d:
		a2 += 1
	if a1 + a2 > k:
		print(-1)
	else:
		print(a1, a2)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	k = int(k)
	x = 0
	y = 0
	cntx = 0
	cnty = 0
	while cntx < a:
		cntx += c
		x += 1
	while cnty < b:
		cnty += d
		y += 1
	if x + y <= k:
		print(x, y)
	else:
		print('-1')


import math
number_of_test_case = int(input())
for n in range(number_of_test_case):
	list_of_input = [int(x) for x in input().split()]
	try:
		(a, b, c, d, k) = list_of_input
	except Exception:
		print('Please enter exact 5 numbers of input.')
	if math.ceil(a / c) + math.ceil(b / d) > k:
		print(-1)
	else:
		print(math.ceil(a / c), math.ceil(b / d))


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
t = rint()
for _ in range(t):
	(a, b, c, d, k) = rints()
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y > k:
		print(-1)
	else:
		print(x, y)


t = int(input())
for i in range(t):
	a = [int(i) for i in input().split()]
	l = a[0] // a[2]
	if a[0] % a[2] > 0:
		l += 1
	l1 = a[1] // a[3]
	if a[1] % a[3] > 0:
		l1 += 1
	if l1 + l <= a[4]:
		print(l, l1)
	else:
		print(-1)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	p = math.ceil(a / c)
	pe = math.ceil(b / d)
	print('-1' if p + pe > k else '{} {}'.format(p, pe))


import math
n = int(input())
while n > 0:
	data = input().split(' ')
	x = 0 if int(data[2]) == 0 else int(math.ceil(int(data[0]) / int(data[2])))
	y = 0 if int(data[3]) == 0 else int(math.ceil(int(data[1]) / int(data[3])))
	if int(data[4]) - x - y > -1:
		print(f'{x} {y}')
	else:
		print('-1')
	n -= 1


from math import ceil
ct = int(input())
for c in range(ct):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	r1 = ceil(a / c)
	r2 = ceil(b / d)
	if r1 + r2 <= k:
		print(r1, r2)
	else:
		print(-1)


import sys
from math import ceil
from collections import deque
for _ in range(int(input())):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	x = ceil(a / c)
	y = ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


import math
for i in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	u = math.ceil(a / c)
	w = math.ceil(b / d)
	if u + w <= k:
		print(u, end=' ')
		print(w)
	else:
		print(-1)


import math
t = int(input(''))
while t > 0:
	l = list(map(int, input('').split()))
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	k = l[4]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)
	t = t - 1


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	t = inin()
	for _ in range(t):
		(a, b, c, d, k) = cin()
		x = y = 1
		if a % c == 0:
			x = 0
		if b % d == 0:
			y = 0
		xx = a // c + x
		yy = b // d + y
		if xx + yy > k:
			print(-1)
		else:
			print(xx, yy)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	p = int(math.ceil(float(a) / c))
	pc = int(math.ceil(float(b) / d))
	temp = p + pc - k
	if temp > 0:
		print(-1)
	else:
		print(p - temp, pc)


from math import ceil
n = int(input())
pens = []
pencils = []
spaces = []
for i in range(n):
	numbersString = input().split(' ')
	lectures = int(numbersString[0])
	classes = int(numbersString[1])
	pen = int(numbersString[2])
	pencil = int(numbersString[3])
	space = int(numbersString[4])
	pens.append(ceil(lectures / pen))
	pencils.append(ceil(classes / pencil))
	spaces.append(space)
for j in range(n):
	if pens[j] + pencils[j] > spaces[j]:
		print(-1)
	else:
		print(pens[j], pencils[j])


n = int(input())
import math as m
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	e = m.ceil(a / c)
	f = m.ceil(b / d)
	if e + f <= k:
		print(e, f)
	else:
		print(-1)


import math
t = int(input())
for x in range(t):
	(a, b, c, d, e) = map(int, input().split())
	k = math.ceil(a / c)
	l = math.ceil(b / d)
	if k + l <= e:
		print(k, l)
	else:
		print(-1)


t = [int(k) for k in input().split(' ')][0]
for nt in range(t):
	(a, b, c, d, k) = [int(k) for k in input().split(' ')]
	cp = (a - 1) // c + 1
	dp = (b - 1) // d + 1
	if cp + dp <= k:
		print(cp, dp)
	else:
		print('-1')


t = int(input())
import math
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split(' '))
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(' '.join([str(x), str(y)]))
	else:
		print(-1)


def main():
	n = int(input())
	for i in range(n):
		(a, b, c, d, k) = [int(v) for v in input().split()]
		ca = a // c + (1 if a % c != 0 else 0)
		cb = b // d + (1 if b % d != 0 else 0)
		if ca + cb > k:
			print(-1)
		else:
			print(ca, cb)
main()


import math
t = int(input())
for i in range(t):
	b = list(map(int, input().split()))
	p = math.ceil(b[0] / b[2])
	q = math.ceil(b[1] / b[3])
	if p + q <= b[4]:
		print(p, q)
	else:
		print(-1)


n = int(input())
for i in range(n):
	foo = [int(i) for i in input().split()]
	a = foo[0]
	b = foo[1]
	c = foo[2]
	d = foo[3]
	k = foo[4]
	if (a + c - 1) // c + (b + d - 1) // d > k:
		print(-1)
	else:
		print((a + c - 1) // c, (b + d - 1) // d)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		h1 = a // c
	else:
		h1 = a // c + 1
	if b % d == 0:
		h2 = b // d
	else:
		h2 = b // d + 1
	if h2 + h1 <= k:
		print(h1, h2)
	else:
		print(-1)


def fun():
	import math
	t = input().strip()
	t = int(t)
	for i in range(t):
		temp = input().strip().split(' ')
		(a, b, c, d, k) = list(map(lambda x: int(x), temp))
		(hei, hong) = (math.ceil(a / c), math.ceil(b / d))
		x = hei + hong
		if x <= k:
			print(hei, hong)
		else:
			print(-1)
fun()


def ab():
	(a, b, c, d, k) = list(map(int, input().split()))
	x = int(a / c)
	o = a % c
	if o > 0 and o < c:
		x = x + 1
	y = int(b / d)
	o = b % d
	if o > 0 and o < d:
		y = y + 1
	if x + y <= k:
		print(str(k - y) + ' ' + str(y))
	else:
		print(-1)
n = input()
for i in range(0, int(n)):
	ab()


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split(' '))
	A = math.ceil(a / c)
	B = math.ceil(b / d)
	if A + B <= k:
		print(A, B)
	else:
		print(-1)


import math as m
for tc in [0] * int(input()):
	(*a, k) = map(int, input().split())
	(x, y) = (m.ceil(a[0] / a[2]), m.ceil(a[1] / a[3]))
	print(-1) if x + y > k else print(x, y)


T = int(input())
for tc in range(T):
	(a, b, c, d, k) = map(int, input().split())
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y > k:
		print(-1)
	else:
		print(x, y)


for i in range(int(input())):
	t = list(map(int, input().split()))
	a = t[0]
	b = t[1]
	c = t[2]
	d = t[3]
	k = t[4]
	pens = 0
	pencils = 0
	if a % c == 0:
		pens = a // c
	else:
		pens = a // c + 1
	if b % d == 0:
		pencils = b // d
	else:
		pencils = b // d + 1
	if pens + pencils <= k:
		h = []
		h.append(pens)
		h.append(pencils)
		print(*h)
	else:
		print(-1)


import math
for _ in range(int(input())):
	(m, n, a, b, c) = map(int, input().split())
	a = math.ceil(m / a)
	b = math.ceil(n / b)
	print(*([a, b], [-1])[a + b > c])


n = int(input())
e = []
count = 0
count1 = 0
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		count = a // c
	if a % c != 0:
		count = abs(a // c + 1)
	if b % d == 0:
		count1 = b // d
	if b % d != 0:
		count1 = abs(b // d + 1)
	if count + count1 > k:
		print(-1)
	if count + count1 <= k:
		count += k - count - count1
		print(count, count1)


T = int(input())
for _ in range(T):
	inp = input().split()
	(a, b, c, d, k) = (int(inp[0]), int(inp[1]), int(inp[2]), int(inp[3]), int(inp[4]))
	x = a // c
	if a % c != 0:
		x += 1
	y = b // d
	if b % d != 0:
		y += 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import sys
import os
from io import IOBase, BytesIO

def main():
	from math import ceil
	for tc in range(int(input())):
		(a, b, c, d, k) = get_ints()
		pen = ceil(a / c)
		pencil = ceil(b / d)
		if pen + pencil > k:
			print(-1)
		else:
			print(pen, pencil)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip()
main()


import math
ts = int(input())
while ts:
	(a, b, c, d, k) = map(int, input().split())
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y, sep=' ')
	else:
		print('-1')
	ts -= 1


Q = int(input())
for q in range(Q):
	(a, b, c, d, k) = tuple(map(int, input().split()))
	pens = a // c
	if a % c != 0:
		pens += 1
	pencils = b // d
	if b % d != 0:
		pencils += 1
	if pens + pencils > k:
		print(-1)
	else:
		print(pens, pencils)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	remains_pens = a % c
	remains_pencils = b % d
	if remains_pens > 0:
		num_pens = a // c + 1
	else:
		num_pens = a // c
	if remains_pencils > 0:
		num_pencils = b // d + 1
	else:
		num_pencils = b // d
	if num_pens + num_pencils <= k:
		print(num_pens, num_pencils)
	else:
		print(-1)


import math
n = int(input())
for _ in range(n):
	row = input().split()
	a = int(row[0])
	b = int(row[1])
	c = int(row[2])
	d = int(row[3])
	k = int(row[4])
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(str(x) + ' ' + str(y))
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = 0
	if a % c == 0 and b % d == 0:
		if a // c + b // d > k:
			print('-1')
		else:
			print(a // c, b // d)
	elif a % c == 0 and b % d != 0:
		if a // c + b // d + 1 > k:
			print('-1')
		else:
			print(a // c, b // d + 1)
	elif a % c != 0 and b % d == 0:
		if a // c + 1 + b // d > k:
			print('-1')
		else:
			print(a // c + 1, b // d)
	elif a // c + b // d + 2 > k:
		print('-1')
	else:
		print(a // c + 1, b // d + 1)


from math import ceil
for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(vala, valb, flag) = (0, 0, 0)
	if ceil(a / c) + ceil(b / d) > k:
		print(-1)
	else:
		print(k - ceil(b / d), ' ', ceil(b / d))


import math
for _ in range(int(input())):
	inp = list(map(int, input().split()))
	(a, b, c, d, k) = (inp[0], inp[1], inp[2], inp[3], inp[4])
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


q = int(input())
for run in range(q):
	(a, b, c, d, k) = map(int, input().split())
	x = 1 if a < c else a // c if a % c == 0 else a // c + 1
	y = 1 if b < d else b // d if b % d == 0 else b // d + 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(pens, pencils) = (0, 0)
	if a % c == 0:
		pens = a // c
	else:
		pens = a // c + 1
	if b % d == 0:
		pencils = b // d
	else:
		pencils = b // d + 1
	if pens + pencils > k:
		print(-1)
	else:
		total = pens + pencils
		print(pens + k - total, end=' ')
		print(pencils)


import math

def init():
	t = int(input())
	for i in range(t):
		(a, b, c, d, k) = map(lambda x: int(x), input().split(' '))
		x = math.ceil(a / c)
		y = math.ceil(b / d)
		if x + y > k:
			print('-1')
		else:
			print(str(x) + ' ' + str(y))
init()


def check(a, b, c, d, k):
	aa = a // c + (a % c != 0)
	bb = b // d + (b % d != 0)
	if aa + bb <= k:
		return (aa, bb)
	return [-1]
for _ in range(int(input())):
	(A, B, C, D, K) = [int(i) for i in input().split()]
	print(*check(A, B, C, D, K))


from math import ceil
t = int(input())
for i in range(t):
	(lectures, classes, lectures_per_pen, classes_per_pencil, pencilcase_max) = map(int, input().split())
	pens = ceil(lectures / lectures_per_pen)
	pencils = ceil(classes / classes_per_pencil)
	if pens + pencils <= pencilcase_max:
		print(pens, pencils)
	else:
		print(-1)


import math
for i in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= e:
		print(x, y)
	else:
		print('-1')


import math
for i in range(int(input())):
	x = 0
	y = 0
	arr = [int(x) for x in input().split()]
	x = math.ceil(arr[0] / arr[2])
	y = math.ceil(arr[1] / arr[3])
	if x + y > arr[4]:
		print(-1)
	else:
		print(x, y)


import math

def answer():
	(a, b, c, d, k) = map(int, input().split(' '))
	n1 = math.ceil(a / c)
	n2 = math.ceil(b / d)
	if n1 + n2 <= k:
		return (n1, n2)
	else:
		return None
n = int(input())
for i in range(n):
	out = answer()
	if out is None:
		print(-1)
	else:
		(x, y) = out
		print('%d %d' % (x, y))


q = int(input())
for i in range(q):
	(a, b, c, d, k) = map(int, input().split())
	tc1 = 0
	tc2 = 0
	if a % c == 0:
		tc1 += a // c
	else:
		tc1 += a // c + 1
	if b % d == 0:
		tc2 += b // d
	else:
		tc2 += b // d + 1
	if tc1 + tc2 > k:
		print(-1)
	else:
		print(tc1, tc2)


q = int(input())
for i in range(0, q):
	a = list(map(int, input().split()))
	l = a[0] // a[2]
	if a[0] % a[2] != 0:
		l += 1
	c = l
	l = l + a[1] // a[3]
	if a[1] % a[3] != 0:
		l += 1
	d = l - c
	if l <= a[4]:
		print(c + a[4] - l, d, end=' ')
		print('')
	else:
		print('-1')


import math

def pen(a, b, c, d, k):
	p = math.ceil(a / c)
	p1 = math.ceil(b / d)
	if p + p1 > k:
		return -1
	else:
		return f'{k - p1} {p1}'
set = int(input())
while set > 0:
	l = input().split(' ')
	(a, b, c, d, k) = (int(l[0]), int(l[1]), int(l[2]), int(l[3]), int(l[4]))
	set -= 1
	print(pen(a, b, c, d, k))


def ceil(n, k):
	if n % k == 0:
		return n // k
	return n // k + 1
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split(' '))
	pn = ceil(a, c)
	pc = ceil(b, d)
	if pn + pc <= k:
		print(pn, pc)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen = (a + c - 1) // c
	pencil = (b + d - 1) // d
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


import math
t = int(input())
for i in range(0, t):
	(a, b, c, d, k) = [int(z) for z in input().split()]
	x = math.ceil(b / float(d))
	y = math.ceil(a / float(c))
	if x + y <= k:
		print(y, x)
	else:
		print('-1')


t = int(input())
for i in range(t):
	dfs = False
	(a, b, c, d, k) = map(int, input().split())
	for x in range(1, k + 1):
		for y in range(1, k - x + 1):
			if x * c >= a and y * d >= b:
				print(x, y)
				dfs = True
				break
		if dfs:
			break
	if not dfs:
		print(-1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen = a // c
	if a % c > 0:
		pen = pen + 1
	pencil = b // d
	if b % d > 0:
		pencil = pencil + 1
	pc = pen + pencil
	if pc == k:
		print(pen, pencil)
	elif pc > k:
		print(-1)
	else:
		print(pen, k - pen)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split(' ')))
	tot = 0
	a = math.ceil(a / c)
	b = math.ceil(b / d)
	if a + b <= k:
		print(a, b)
	else:
		print(-1)


inp = int(input())
for x in range(inp):
	ls = list(map(int, input().split()))
	pen = ls[0] // ls[2]
	pencil = ls[1] // ls[3]
	if pen * ls[2] < ls[0]:
		pen += 1
	if pencil * ls[3] < ls[1]:
		pencil += 1
	if pen + pencil <= ls[4]:
		print(pen, pencil)
	else:
		print(-1)


def penPencil(arr):
	(penl, pencl, pena, penb, lim) = (arr[0], arr[1], arr[2], arr[3], arr[4])
	(aminr, bminr) = (0, 0)
	if penl % pena == 0:
		aminr += penl // pena
	else:
		aminr += penl // pena + 1
	if pencl % penb == 0:
		bminr += pencl // penb
	else:
		bminr += pencl // penb + 1
	if aminr + bminr > lim:
		print(-1)
	else:
		print(lim - bminr, bminr)
tc = int(input())
for i in range(tc):
	arr = list(map(int, input().split()))
	penPencil(arr)


import sys
count = 0
for line in sys.stdin:
	if count == 0:
		count += 1
		continue
	a = int(line.strip().split(' ')[0])
	b = int(line.strip().split(' ')[1])
	c = int(line.strip().split(' ')[2])
	d = int(line.strip().split(' ')[3])
	k = int(line.strip().split(' ')[4])
	num1 = a // c if a % c == 0 else a // c + 1
	num2 = b // d if b % d == 0 else b // d + 1
	if num1 + num2 <= k:
		print(str(num1) + ' ' + str(k - num1))
	else:
		print(-1)


q = int(input())
for _ in range(q):
	(a, b, c, d, e) = map(int, input().split())
	x = a // c if a % c == 0 else a // c + 1
	y = b // d if b % d == 0 else b // d + 1
	if x + y <= e:
		print(x, ' ', y)
	else:
		print(-1)


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
t = mint()
for i in range(t):
	(a, b, c, d, k) = mints()
	cc = (a + c - 1) // c
	dd = (b + d - 1) // d
	if cc + dd > k:
		print(-1)
	else:
		print(cc, dd)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if not a % c:
		p = a // c
	else:
		p = a // c + 1
	if not b % d:
		x = b // d
	else:
		x = b // d + 1
	if p + x > k:
		print(-1)
	elif p + x <= k:
		print(p, x)
	else:
		print('No answer')


t = int(input())
while t != 0:
	t -= 1
	nr2 = nr1 = 0
	(a, b, c, d, k) = map(int, input().split())
	nr1 = a // c
	if a % c:
		nr1 += 1
	nr2 = b // d
	if b % d:
		nr2 += 1
	if nr1 + nr2 <= k:
		print(str(nr1) + ' ' + str(nr2))
	else:
		print(-1)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	cp = math.floor((a + c - 1) // c)
	cpe = math.floor((b + d - 1) // d)
	if cp + cpe <= k:
		print(cp, cpe)
	else:
		print(-1)


import math
t = int(input())
for _ in range(0, t):
	(a, b, c, d, k) = list(map(int, input().split()))
	a1 = math.ceil(a / c)
	a2 = math.ceil(b / d)
	if a1 + a2 > k:
		print(-1)
	else:
		print(a1, a2)


import sys, math
input = sys.stdin.readline
t = int(input())
for r in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pens = math.ceil(a / c)
	pencils = math.ceil(b / d)
	if pens + pencils > k:
		print(-1)
	else:
		print(pens, pencils)


import math
n = int(input())
for _ in range(n):
	(a, b, c, d, k) = tuple(map(int, input().split()))
	pen_cnt = math.ceil(a / c)
	pencil_cnt = math.ceil(b / d)
	print('{} {}'.format(pen_cnt, pencil_cnt)) if k >= pen_cnt + pencil_cnt else print(-1)


n = int(input())
mas = list()
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		j = a // c
	else:
		j = a // c + 1
	if b % d == 0:
		l = b // d
	else:
		l = b // d + 1
	r = j + l
	if r <= k:
		mas.append(j)
		mas.append(l)
	else:
		mas.append(-1)
		mas.append(0)
i = 0
while i <= len(mas) - 1:
	print(mas[i], end=' ')
	if mas[i + 1] != 0:
		print(mas[i + 1])
	else:
		print()
	i += 2


import math
for rpt in range(int(input())):
	(lect_c, prac_c, pen_dur, char_dur, case_size) = [int(x) for x in input().split(' ')]
	if math.ceil(lect_c / pen_dur) + math.ceil(prac_c / char_dur) <= case_size:
		print(str(math.ceil(lect_c / pen_dur)) + ' ' + str(math.ceil(prac_c / char_dur)))
	else:
		print(-1)


for t in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	pe = a // c
	if a % c != 0:
		pe += 1
	pc = b // d
	if b % d != 0:
		pc += 1
	if k < pe + pc:
		print(-1)
	else:
		print(pe, pc)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	if a / c - a // c != 0:
		ndp = a // c + 1
	else:
		ndp = a / c
	if b / d - b // d != 0:
		ndl = b // d + 1
	else:
		ndl = b / d
	if ndl + ndp > k:
		print(-1)
	else:
		print(int(ndp), int(ndl))


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
from math import ceil, floor, log, sqrt, factorial
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		(a, b, c, d, k) = mi()
		x = ceil(a / c)
		y = ceil(b / d)
		if x + y <= k:
			print(x, y)
		else:
			print(-1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
import sys

def rl():
	return sys.stdin.readline().strip()

def rn():
	return list(map(int, sys.stdin.readline().strip().split()))

def rln(n):
	l = [None] * n
	for i in range(n):
		l[i] = int(rl())
	return l
tc = int(input())
for _ in range(tc):
	(a, b, c, d, k) = map(int, input().split())
	l = math.ceil(a / c)
	h = math.ceil(b / d)
	if l + h > k:
		print(-1)
	else:
		print(l, h)


t = int(input())
z = []
for i in range(t):
	x = 0
	y = 0
	(a, b, c, d, k) = input().split()
	(a, b, c, d, k) = (int(a), int(b), int(c), int(d), int(k))
	if a / c < 1:
		if a / c != 0:
			x = 1
	elif a % c != 0:
		x = a // c + 1
	else:
		x = a // c
	if b / d < 1:
		if b / d != 0:
			y = 1
	elif b % d != 0:
		y = b // d + 1
	else:
		y = b // d
	if x + y <= k:
		z.append(x)
		z.append(y)
	else:
		z.append(-1)
l = len(z)
i = 0
while i < l:
	if z[i] == -1:
		print(z[i])
		i = i + 1
	else:
		print(z[i], z[i + 1])
		i = i + 2


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	f = a // c + (a % c != 0)
	s = b // d + (b % d != 0)
	if f + s > k:
		print(-1)
	else:
		print(f, s)


def dd(a, b):
	if a % b == 0:
		return a // b
	return a // b + 1
inps = []
T = int(input())
for _ in range(T):
	(a, b, c, d, k) = map(int, input().split())
	inps.append((a, b, c, d, k))
for (a, b, c, d, k) in inps:
	pens = dd(a, c)
	pencils = dd(b, d)
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print(-1)


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	p = math.ceil(a / c)
	pc = math.ceil(b / d)
	if p + pc <= k:
		print(p, pc)
	else:
		print(-1)


for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	p = 0
	pl = 0
	if a % c == 0:
		p = a // c
	else:
		p = a // c + 1
	if b % d == 0:
		pl = b // d
	else:
		pl = b // d + 1
	if p + pl > k:
		print(-1)
	elif p + pl == k:
		print(p, pl)
	else:
		print(k - pl, pl)


import sys

def output(a, b):
	if a % b == 0:
		return int(a / b)
	else:
		return int(a / b + 1)
t = int(input())
for line in sys.stdin:
	[a, b, c, d, k] = list(map(int, line.split()))
	if output(a, c) + output(b, d) > k:
		print(-1)
	else:
		print(output(a, c), output(b, d))


a = int(input())
k = 0
m = 0
for i in range(a):
	b = input().split()
	if int(b[0]) % int(b[2]) == 0:
		k = int(b[0]) // int(b[2])
	else:
		k = int(b[0]) // int(b[2]) + 1
	if int(b[1]) % int(b[3]) == 0:
		m = int(b[1]) // int(b[3])
	else:
		m = int(b[1]) // int(b[3]) + 1
	if int(b[4]) - (k + m) >= 0:
		print(k, m)
	else:
		print(-1)


import math
test = int(input())
while test > 0:
	test -= 1
	(a, b, c, d, k) = map(int, input().split())
	if k >= math.ceil(a / c) + math.ceil(b / d):
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)


import math as mx
q = int(input())
for xta in range(q):
	(a, b, c, d, e) = map(int, input().split())
	ans1 = mx.ceil(a / c)
	ans2 = mx.ceil(b / d)
	if ans1 + ans2 <= e:
		print(ans1, ans2)
	else:
		print(-1)


from math import ceil
t = int(input())
o = ''
for _ in range(t):
	(a, b, c, d, k) = [int(i) for i in input().split(' ')]
	pen = ceil(a / c)
	pencil = ceil(b / d)
	if pen + pencil <= k:
		o += f'{pen} {pencil}\n'
	else:
		o += '-1\n'
print(o)


import math
t = int(input())
for q in range(0, t):
	(a, b, c, d, k) = map(int, input().split())
	m = math.ceil(a / c)
	n = math.ceil(b / d)
	if m + n <= k:
		print(m, n)
	else:
		print('-1')


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	lec = (a + c - 1) // c
	draw = (b + d - 1) // d
	if lec + draw <= k:
		print(lec, draw)
	else:
		print(-1)


from math import ceil

def fun():
	(a, b, c, d, k) = map(int, input().split())
	ans = ceil(a / c) + ceil(b / d)
	if ans <= k:
		print(ceil(a / c), ceil(b / d))
	else:
		print(-1)
t = int(input())
for ii in range(t):
	fun()


for _ in range(int(input())):
	(lecture, practical, pens, pencil, limit) = [int(x) for x in input().split()]
	cando_lecture = (lecture + pens - 1) // pens
	cando_practical = (practical + pencil - 1) // pencil
	todo = cando_lecture + cando_practical
	if todo > limit:
		print(-1)
	else:
		print(cando_lecture, cando_practical)


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	c = arr[2]
	d = arr[3]
	k = arr[4]
	if int(a / c) < a / c:
		x = int(a / c) + 1
	else:
		x = int(a / c)
	if int(b / d) < b / d:
		y = int(b / d) + 1
	else:
		y = int(b / d)
	if x + y > k:
		print(-1)
	else:
		count = 0
		while x + y < k:
			if count % 2 == 0:
				x += 1
				count += 1
			else:
				y += 1
				count += 1
		print(x, y)


n = int(input())
for i in range(n):
	(a, b, c, d, e) = [int(i) for i in input().split()]
	s = 0
	if a % c == 0:
		x = a // c
	else:
		x = a // c + 1
	if b % d == 0:
		y = b // d
	else:
		y = b // d + 1
	if x + y > e:
		print('-1')
	else:
		print(x, y)


def ceil(x, y):
	return x // y + bool(x % y)
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(u, v) = (ceil(a, c), ceil(b, d))
	if u + v > k:
		print('-1')
	else:
		print(u, v)


for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	c1 = 1
	c2 = 1
	i = 1
	i2 = 1
	if c >= a:
		c1 = 1
	else:
		while i * c < a:
			i += 1
			c1 += 1
	if d >= b:
		c2 = 1
	else:
		while i2 * d < b:
			i2 += 1
			c2 += 1
	if c1 + c2 <= k:
		print(c1, c2)
	else:
		print(-1)


def ii():
	a = int(input())
	return a

def ai():
	a = list(map(int, input().split()))
	return a

def mi():
	a = map(int, input().split())
	return a
for _ in range(ii()):
	(a, b, c, d, k) = mi()
	pen = a // c
	pencil = b // d
	if a % c:
		pen += 1
	if b % d:
		pencil += 1
	if pen + pencil < k:
		print(pen, k - pen)
	elif pencil + pen == k:
		print(pen, pencil)
	else:
		print(-1)


t = int(input())
for s in range(0, t):
	l = input()
	a = l.split(' ')
	for i in range(0, len(a)):
		a[i] = int(a[i])
	n_p = int(a[0] / a[2])
	if a[0] % a[2] != 0:
		n_p = n_p + 1
	n_p2 = int(a[1] / a[3])
	if a[1] % a[3] != 0:
		n_p2 = n_p2 + 1
	if n_p + n_p2 > a[4]:
		print(-1)
	else:
		print(n_p, end='')
		print(' ', end='')
		print(n_p2)


x = int(input())
y = []
for c in range(x):
	y.append(list(map(int, input().split())))
win = ''
for c in y:
	if c[0] % c[2] and c[1] % c[3] > 0:
		if c[0] // c[2] + c[1] // c[3] + 2 > c[4]:
			print(-1)
		else:
			if c[0] % c[2] == 0:
				win = win + str(c[0] // c[2]) + ' '
			else:
				win = win + str(c[0] // c[2] + 1) + ' '
			if c[1] % c[3] == 0:
				win = win + str(c[1] // c[3]) + ' '
			else:
				win = win + str(c[1] // c[3] + 1) + ' '
			print(win)
			win = ''
	if (c[0] % c[2] and (not c[1] % c[3])) > 0 or (c[1] % c[3] and (not c[0] % c[2])) > 0:
		if c[0] // c[2] + c[1] // c[3] + 1 > c[4]:
			print(-1)
		else:
			if c[0] % c[2] == 0:
				win = win + str(c[0] // c[2]) + ' '
			else:
				win = win + str(c[0] // c[2] + 1) + ' '
			if c[1] % c[3] == 0:
				win = win + str(c[1] // c[3]) + ' '
			else:
				win = win + str(c[1] // c[3] + 1) + ' '
			print(win)
			win = ''
	if c[0] % c[2] == 0 and c[1] % c[3] == 0:
		if c[0] // c[2] + c[1] // c[3] > c[4]:
			print(-1)
		else:
			win = win + str(c[0] // c[2]) + ' ' + str(c[1] // c[3])
			print(win)
			win = ''


from math import ceil
n = int(input())
for i in range(n):
	dano = list(map(int, input().split()))
	if dano[4] < ceil(dano[0] / dano[2]) + ceil(dano[1] / dano[3]):
		print('-1')
	else:
		print(ceil(dano[0] / dano[2]), dano[4] - ceil(dano[0] / dano[2]))


import sys
input = lambda : sys.stdin.readline().strip()
from math import *
t = int(input())
for i in range(t):
	(a, b, c, d, e) = map(int, input().split())
	if ceil(a / c) + ceil(b / d) <= e:
		print(ceil(a / c), ceil(b / d))
	else:
		print(-1)


def ans(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1
T = int(input())
while T > 0:
	(a, b, c, d, k) = map(int, input().split())
	x = ans(a, c)
	y = ans(b, d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)
	T -= 1


n = int(input())
for cases in range(n):
	(a, b, c, d, k) = map(int, input().split())
	num1 = -(-a // c)
	num2 = -(-b // d)
	if num1 + num2 > k:
		print(-1)
	else:
		print(num1, num2)


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	rpc = math.ceil(b / d)
	rp = math.ceil(a / c)
	if rp + rpc <= k:
		print(k - rpc, ' ', rpc)
	else:
		print('-1')


n = int(input())
for i in range(n):
	(l, p, lp, pp, k) = map(int, input().split())
	if l % lp == 0:
		a = l // lp
	else:
		a = l // lp + 1
	if p % pp == 0:
		b = p // pp
	else:
		b = p // pp + 1
	if a + b <= k:
		print(a, b)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	while a % c != 0:
		a += 1
	while b % d != 0:
		b += 1
	pen = a // c
	pencil = b // d
	if k < pen + pencil:
		print(-1)
	else:
		print(pen, pencil)


from math import ceil
for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	count = ceil(a / c) + ceil(b / d)
	if count <= k:
		print(ceil(a / c), ceil(b / d))
	else:
		print(-1)


t = int(input())
while t > 0:
	(a, b, c, d, k) = map(int, input().split(' '))
	if a % c == 0:
		pen_number = a // c
	else:
		pen_number = a // c + 1
	if b % d == 0:
		pencil_number = b // d
	else:
		pencil_number = b // d + 1
	if pen_number + pencil_number > k:
		print(-1)
	else:
		print('{0} {1}'.format(pen_number, pencil_number))
	t -= 1


T = int(input())
for _ in range(0, T):
	(a, b, c, d, k) = map(int, input().split())
	t1 = a // c
	if a % c != 0:
		t1 += 1
	t2 = b // d
	if b % d != 0:
		t2 += 1
	if t1 + t2 <= k:
		print(t1, t2)
	else:
		print(-1)


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	k1 = math.ceil(a / c)
	k2 = math.ceil(b / d)
	if k1 + k2 <= k:
		print(k1, k2)
	else:
		print('-1')


import math
count = int(input())
sets = []
while count > 0:
	sets.append(list(map(int, input().split())))
	count -= 1
for _set in sets:
	pens = math.ceil(_set[0] / _set[2])
	pencils = math.ceil(_set[1] / _set[3])
	if pens + pencils > _set[4]:
		print('-1')
	elif pens + pencils < _set[4]:
		print(f'{_set[4] - pencils} {pencils}')
	else:
		print(f'{pens} {pencils}')


from sys import stdin, stdout
from collections import Counter
import math

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def rmult_str():
	return stdin.readline().rstrip().split()

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)

def sortFirst(val):
	return val[0]

def main():
	t = rsingle_int()
	for _ in range(t):
		(a, b, c, d, k) = rmult_int()
		pens = math.ceil(a / c)
		pencils = math.ceil(b / d)
		if pens + pencils <= k:
			print('{} {}'.format(pens, pencils))
		else:
			print(-1)
main()


t = int(input())
n = []
for i in range(t):
	n = input().split()
	if int(n[4]) < (int(n[0]) + int(n[2]) - 1) // int(n[2]) + (int(n[1]) + int(n[3]) - 1) // int(n[3]):
		print(-1)
	else:
		print(' '.join([str((int(n[0]) + int(n[2]) - 1) // int(n[2])), str((int(n[1]) + int(n[3]) - 1) // int(n[3]))]))


import math

def pens(a, b, c, d, k):
	l = math.ceil(a / c)
	p = math.ceil(b / d)
	if l + p <= k:
		print(l, p)
	else:
		print(-1)
for i in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	pens(a, b, c, d, k)


import math
f = lambda : map(int, input().split())
(q,) = f()
for _ in [0] * q:
	(a, b, c, d, k) = f()
	l = math.ceil(a / c)
	p = math.ceil(b / d)
	if l + p <= k:
		print(l, p)
	else:
		print(-1)


from sys import stdin
t = int(stdin.readline().rstrip())
while t > 0:
	(a, b, c, d, k) = map(int, stdin.readline().split())
	p = 0
	q = 0
	if a < c:
		p = 1
	elif a % c == 0:
		p = a // c
	else:
		p = a // c + 1
	if b < d:
		q = 1
	elif b % d == 0:
		q = b // d
	else:
		q = b // d + 1
	if p + q <= k:
		print(str(p) + ' ' + str(q))
	else:
		print(-1)
	t -= 1


case = int(input())
for i in range(case):
	(a, b, c, d, k) = (int(v) for v in input().split())
	if a % c == 0:
		x = a // c
	else:
		x = a // c + 1
	if b % d == 0:
		y = b // d
	else:
		y = b // d + 1
	if x + y <= k:
		print(str(x) + ' ' + str(y))
	else:
		print(-1)


t = int(input())
for x in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		e = a // c
	else:
		e = 1 + a // c
	if b % d == 0:
		f = b // d
	else:
		f = 1 + b // d
	if e + f <= k:
		g = k - (e + f)
		print(e, f + g)
	else:
		print(-1)


import math
testcases = int(input())
for _ in range(testcases):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print('{} {}'.format(x, y))
	else:
		print(-1)


import math
t = int(input())

def solve(a, b, c, d, k):
	if a <= c:
		cnta = 1
	else:
		cnta = math.ceil(a / c)
	if b <= d:
		cntb = 1
	else:
		cntb = math.ceil(b / d)
	if cnta + cntb > k:
		return (-1,)
	else:
		return (cnta, cntb)
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	print(*solve(a, b, c, d, k))


import math
testi = int(input())
for _ in range(testi):
	(a, b, c, d, k) = map(int, input().split())
	A = math.ceil(a / c)
	B = math.ceil(b / d)
	if A + B <= k:
		print(A, B)
	else:
		print(-1)


t = int(input())
l = []
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	anum = a // c
	bnum = b // d
	if a % c > 0:
		anum += 1
	elif a < c:
		anum = 1
	if b % d > 0:
		bnum += 1
	elif b < d:
		bnum = 1
	if anum + bnum <= k:
		temp = str(anum) + ' ' + str(bnum)
	else:
		temp = -1
	l.append(temp)
for i in l:
	print(i)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	print([-1, str(a // c + int(a % c != 0)) + ' ' + str(b // d + int(b % d != 0))][a // c + int(a % c != 0) + b // d + int(b % d != 0) <= k])


def polycarp(a, b, c, d, k):
	z = a / c
	y = b / d
	q = 0
	s = 0
	t = u = 0
	s = z - int(z)
	if s == 0:
		t = z
	else:
		t = int(z + 1)
	q = y - int(y)
	if q == 0:
		s = y
	else:
		s = int(y + 1)
	if t + s > k:
		print(-1)
	if t + s <= k:
		print(int(t), end=' ')
		print(int(s))
t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	ans = polycarp(a, b, c, d, k)
	ans


I = input
for i in [0] * int(I()):
	(a, b, c, d, k) = map(int, I().split())
	q = (0 - a // -c, 0 - b // -d)
	print(*(q, [-1])[sum(q) > k])


from math import ceil
t = int(input())
for x in range(t):
	values = input()
	(numlec, numclas, limitpen, limitpencil, caselimit) = values.split()
	numlec = int(numlec)
	numclas = int(numclas)
	limitpen = int(limitpen)
	limitpencil = int(limitpencil)
	caselimit = int(caselimit)
	if numlec > limitpen:
		neededpens = ceil(numlec / limitpen)
	else:
		neededpens = 1
	if numclas > limitpencil:
		neededpencils = ceil(numclas / limitpencil)
	else:
		neededpencils = 1
	if neededpens + neededpencils <= caselimit:
		print(neededpens, neededpencils)
	else:
		print('-1')


from math import ceil
for counter in range(int(input())):
	(a, b, c, d, k) = (int(x) for x in input().split())
	m = ceil(a / c) + ceil(b / d)
	if k < m:
		print(-1)
	else:
		print(ceil(a / c), ceil(b / d))


from math import sqrt
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pens = (a + c - 1) // c
	pencils = (b + d - 1) // d
	if pens + pencils > k:
		print(-1)
	else:
		print(pens, pencils)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	pix = a // c
	if a % c != 0:
		pix += 1
	creion = b // d
	if b % d != 0:
		creion += 1
	if pix + creion > k:
		print(-1)
	else:
		print(pix, creion)


import sys
t = int(input().strip())
for a0 in range(t):
	l = [int(i) for i in input().split()]
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	e = l[4]
	x = 0
	if a % c == 0:
		x = a // c
	else:
		x = a // c + 1
	y = 0
	if b % d == 0:
		y = b // d
	else:
		y = b // d + 1
	if x + y <= e:
		print(x, y)
	else:
		print(-1)


from math import ceil
n = int(input())
for _ in range(n):
	ar = list(map(int, input().rstrip().split()))
	xs = ceil(ar[0] / ar[2])
	ys = ceil(ar[1] / ar[3])
	if xs + ys <= ar[4]:
		print('{} {}'.format(xs, ys))
	else:
		print('-1')


import math
for _ in range(int(input())):
	(l, p, r, k, n) = map(int, input().strip().split())
	lr = math.ceil(l / r)
	pk = math.ceil(p / k)
	if lr + pk > n:
		print(-1)
	else:
		print(lr, pk)


t = int(input(''))
l = []
for i in range(t):
	l.append(list(map(int, input().split())))
for i in l:
	if i[0] % i[2] == 0:
		if i[0] // i[2] > i[4]:
			print(-1)
		elif i[1] % i[3] == 0:
			if i[0] // i[2] + i[1] // i[3] <= i[4]:
				print(i[0] // i[2], i[1] // i[3])
			else:
				print(-1)
		elif i[0] // i[2] + 1 + i[1] // i[3] <= i[4]:
			print(i[0] // i[2], i[1] // i[3] + 1)
		else:
			print(-1)
	elif i[0] // i[2] > i[4]:
		print(-1)
	elif i[1] % i[3] == 0:
		if i[0] // i[2] + 1 + i[1] // i[3] <= i[4]:
			print(i[0] // i[2] + 1, i[1] // i[3])
		else:
			print(-1)
	elif i[0] // i[2] + 2 + i[1] // i[3] <= i[4]:
		print(i[0] // i[2] + 1, i[1] // i[3] + 1)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	if a % c == 0 and b % d == 0:
		if a // c + b // d <= k:
			print(a // c, b // d)
		else:
			print(-1)
	elif a % c != 0 and b % d == 0:
		if a // c + 1 + b // d <= k:
			print(a // c + 1, b // d)
		else:
			print(-1)
	elif a % c != 0 and b % d != 0:
		if a // c + 1 + (b // d + 1) <= k:
			print(a // c + 1, b // d + 1)
		else:
			print(-1)
	elif a % c == 0 and b % d != 0:
		if a // c + (b // d + 1) <= k:
			print(a // c, b // d + 1)
		else:
			print(-1)


import math
T = int(input())
for i in range(T):
	(a, b, c, d, k) = map(int, input().split(' '))
	value1 = math.ceil(a / c)
	value2 = math.ceil(b / d)
	if value1 + value2 <= k:
		print(value1, value2)
	else:
		print(-1)


import math
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	(r1, r2) = (int(math.ceil(a / c)), int(math.ceil(b / d)))
	if r1 + r2 > k:
		print(-1)
	else:
		print(r1, r2)


def main():
	import sys
	input = sys.stdin.readline
	t = int(input())
	for __ in [0] * t:
		(a, b, c, d, k) = map(int, input().split())
		cnt = 0
		if a % c == 0:
			cnt += a // c
		else:
			cnt += a // c + 1
		bb = 0
		if b % d == 0:
			bb += b // d
		else:
			bb += b // d + 1
		if bb + cnt > k:
			print(-1)
		else:
			print(cnt, bb)
main()


import math
n = int(input())
list = []
list2 = []
for i in range(n):
	list.append([int(j) for j in input().split()])
for i in range(n):
	a = list[i][0]
	b = list[i][1]
	c = list[i][2]
	d = list[i][3]
	k = list[i][4]
	xx = a / c
	yy = b / d
	x = math.ceil(xx)
	y = math.ceil(yy)
	if x + y <= k:
		ele = [x, y]
		list2.append(ele)
	else:
		ele = [-1]
		list2.append(ele)
for row in list2:
	print(' '.join([str(elem) for elem in row]))


import math
testCases = int(input())
for t in range(testCases):
	(numLectures, numPractices, capPen, capPencil, pocketSize) = tuple(map(int, input().split(' ')))
	minPens = math.ceil(numLectures / capPen)
	minPencils = math.ceil(numPractices / capPencil)
	if minPens + minPencils > pocketSize:
		print(-1)
	else:
		print(minPens, minPencils)


from bisect import bisect
from collections import defaultdict
from math import gcd, sqrt, ceil
from collections import Counter
import sys
sys.setrecursionlimit(10 ** 9)
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	z1 = ceil(a / c)
	z2 = ceil(b / d)
	if z1 + z2 <= k:
		print(z1, z2)
	else:
		print(-1)


import math
am = int(input())
for i in range(am):
	strIn = input().split(' ')
	a = int(strIn[0])
	b = int(strIn[1])
	c = int(strIn[2])
	d = int(strIn[3])
	k = int(strIn[4])
	if math.ceil(a / c) + math.ceil(b / d) <= k:
		print(math.ceil(a / c), math.ceil(b / d))
		continue
	print(-1)


t = int(input())
out = ''
for i in range(t):
	inp = input().split(' ')
	nos = [int(x) for x in inp]
	(a, b, c, d, k) = (nos[0], nos[1], nos[2], nos[3], nos[4])
	if a % c != 0:
		pens = int(a // c + 1)
	else:
		pens = int(a / c)
	if b % d != 0:
		pencils = int(b // d + 1)
	else:
		pencils = int(b / d)
	if pens + pencils <= k:
		out += str(pens) + ' ' + str(pencils) + '\n'
	else:
		out += str(-1) + '\n'
print(out[:-1])


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	need1 = a // c + (1 if a % c > 0 else 0)
	need2 = b // d + (1 if b % d > 0 else 0)
	if need1 + need2 > k:
		print(-1)
	else:
		print(need1, need2)


import math
n = int(input())
x = []
for i in range(n):
	(a, b, c, d, k) = map(float, input().split())
	if math.ceil(a / c) + math.ceil(b / d) <= k:
		x.append(str(math.ceil(a / c)) + ' ' + str(math.ceil(b / d)))
	else:
		x.append(-1)
for i in range(len(x)):
	print(x[i])


import math
t = int(input())
for _ in range(t):
	s = input().split()
	for i in range(5):
		s[i] = int(s[i])
	if math.ceil(s[0] / s[2]) + math.ceil(s[1] / s[3]) > s[4]:
		print(-1)
	else:
		print(math.ceil(s[0] / s[2]), math.ceil(s[1] / s[3]))


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = list(map(int, input().split(' ')))
	total_pen = 0
	if c >= a:
		total_pen = 1
	else:
		total_pen = a // c
		if a % c != 0:
			total_pen += 1
	total_pencil = 0
	if d >= b:
		total_pencil = 1
	else:
		total_pencil = b // d
		if b % d != 0:
			total_pencil += 1
	if total_pen + total_pencil <= k:
		print(total_pen, total_pencil)
	else:
		print(-1)


def computeTotal(a, c):
	p = divmod(a, c)
	pTotal = p[0]
	while True:
		if p[1] > c:
			p = divmod(p[1], c)
			pTotal += p[0]
		else:
			if p[1] == 0:
				pass
			else:
				pTotal += 1
			break
	return pTotal

def polycarp(a, b, c, d, k):
	penTotal = computeTotal(a, c)
	pencilTotal = computeTotal(b, d)
	return (penTotal, pencilTotal) if penTotal + pencilTotal <= k else [-1]
testCases = int(input())
holder = []
for i in range(testCases):
	holder.append(input())
for val in holder:
	print(*polycarp(*map(int, val.split(' '))))


import math

def solve(a, b, c, d, k):
	require_min_pen = math.ceil(a / c)
	require_min_pencil = math.ceil(b / d)
	if require_min_pen + require_min_pencil > k:
		return None
	return (require_min_pen, require_min_pencil)
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	e = solve(a, b, c, d, k)
	print(-1 if e is None else ' '.join(map(str, e)))


from math import ceil
t = int(input())
for i in range(t):
	alls = 0
	(a, b, c, d, k) = list(map(int, input().split()))
	alls += ceil(a / c) + ceil(b / d)
	if alls <= k:
		print(ceil(a / c), ceil(b / d))
	else:
		print(-1)


import math
t = int(input())
while t > 0:
	t -= 1
	(a, b, c, d, k) = map(int, input().split())
	a1 = math.ceil(a / c)
	a2 = math.ceil(b / d)
	if a1 + a2 > k:
		print(-1)
	else:
		print(a1, a2)


import math

def main():
	t = int(input())
	for i in range(t):
		(a, b, c, d, k) = tuple(map(int, input().split()))
		minpen = math.ceil(a / c)
		mincil = math.ceil(b / d)
		if minpen + mincil > k:
			print(-1)
		else:
			print(minpen + k - (minpen + mincil), mincil)
main()


t = int(input())
q = []
for i in range(t):
	l = list(input().split())
	a = int(l[0])
	b = int(l[1])
	c = int(l[2])
	d = int(l[3])
	k = int(l[4])
	x = a // c
	y = b // d
	if a % c != 0:
		x += 1
	if b % d != 0:
		y += 1
	if x + y > k:
		q.append([-1])
	else:
		q.append([x, y])
for i in q:
	print()
	for j in i:
		print(j, end=' ')


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = input().split(' ')
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	k = int(k)
	a_c = math.ceil(a / c)
	b_c = math.ceil(b / d)
	if a_c == 0:
		a_c = 1
	if b_c == 0:
		b_c = 1
	if a_c + b_c > k:
		print('-1')
	else:
		print('{} {}'.format(a_c, b_c))


n = int(input())
e = []
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		m = a // c
	else:
		m = a // c + 1
	if b % d == 0:
		n = b // d
	else:
		n = b // d + 1
	if m + n > k:
		e.append([-1])
	else:
		e.append([m, k - m])
for i in range(len(e)):
	if len(e[i]) == 1:
		print(e[i][0])
	else:
		print(e[i][0], e[i][1])


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for i in range(t):
	(a, b, c, d, k) = invr()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


import math
T = int(input())
for _ in range(T):
	(a, b, c, d, k) = [int(i) for i in input().split(' ')]
	if math.ceil(a / c) + math.ceil(b / d) <= k:
		print(math.ceil(a / c), k - math.ceil(a / c))
	else:
		print(-1)


N = int(input())
data = []
for i in range(N):
	arr = list(map(int, input().strip().split(' ')))
	data.append(arr)
for i in range(N):
	(a, b, c, d, k) = data[i]
	flag = False
	for i in range(k):
		j = k - i
		if c * i >= a and d * j >= b:
			print(i, j)
			flag = True
			break
	if not flag:
		print(-1)


import math
amount = int(input())
for i in range(amount):
	(a, b, c, d, k) = [int(s) for s in input().split()]
	if math.ceil(a / c) + math.ceil(b / d) > k:
		print(-1)
	else:
		print(math.ceil(a / c), math.ceil(b / d))


from math import *
t = int(input())
for l in range(t):
	(a, b, c, d, k) = map(int, input().split())
	val1 = ceil(a / c)
	val2 = ceil(b / d)
	if val1 + val2 <= k:
		print(val1, val2)
	else:
		print(-1)


def number_pen(lecture, practical, pen, pencil, pencil_case):
	pen = lecture / pen
	pen = math.ceil(pen)
	pencil = practical / pencil
	pencil = math.ceil(pencil)
	if pen + pencil > pencil_case:
		print(-1)
	else:
		print(pen, pencil)
import math
i = 0
y = 0
x = 0
lecture = ''
t = int(input())
information = 0
for i in range(t):
	information = input()
	information = information.split(' ')
	for y in range(5):
		information[y] = int(information[y])
	number_pen(lecture=information[0], practical=information[1], pen=information[2], pencil=information[3], pencil_case=information[4])


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen_list = [0 for i in range(a)]
	pencil_list = [0 for i in range(b)]
	final_pen_list = [pen_list[i * c:(i + 1) * c] for i in range((a + c - 1) // c)]
	final_pencil_list = [pencil_list[i * d:(i + 1) * d] for i in range((b + d - 1) // d)]
	if len(final_pen_list) + len(final_pencil_list) <= k:
		print(len(final_pen_list), len(final_pencil_list))
	else:
		print(-1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	l = a / c
	m = b / d
	if l - int(l) > 0:
		l = int(l) + 1
	if m - int(m) > 0:
		m = int(m) + 1
	if l + m > k:
		print('-1')
	else:
		print(int(l), int(m))


from math import *
n = int(input())
for x in range(n):
	(a, b, c, d, e) = map(int, input().split())
	if ceil(a / c) + ceil(b / d) > e:
		print(-1)
	else:
		print(ceil(a / c), end=' ')
		print(ceil(b / d))


t = int(input())
count = 0
cnt = 0
for _ in range(t):
	List = list(map(int, input().split()))
	if List[0] % List[2] == 0:
		count = List[0] // List[2]
	else:
		count = List[0] // List[2] + 1
	if List[1] % List[3] == 0:
		cnt = List[1] // List[3]
	else:
		cnt = List[1] // List[3] + 1
	if cnt + count <= List[4]:
		print(count, cnt)
	else:
		print(-1)


t = int(input())
ans = []
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	if a % c == 0:
		x = a / c
	else:
		x = a // c + 1
	if b % d == 0:
		y = b / d
	else:
		y = b // d + 1
	if x + y <= k:
		ans.append([int(x), int(y)])
	else:
		ans.append([-1])
for i in range(t):
	print(*ans[i], sep=' ')


n = input()
n = int(n)
for i in range(0, n):
	l = input()
	(a, b, c, d, k) = l.split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	k = int(k)
	if a % c != 0:
		pens = int(a / c) + 1
	else:
		pens = int(a / c)
	if b % d != 0:
		pins = int(b / d) + 1
	else:
		pins = int(b / d)
	if pins + pens > k:
		print(-1)
	else:
		print(pens, pins)


import sys
ip = lambda : sys.stdin.readline().rstrip()
for _ in range(int(ip())):
	(a, b, c, d, k) = map(int, ip().split())
	v1 = a // c + (1 if a % c else 0)
	v2 = b // d + (1 if b % d else 0)
	v = v1 + v2
	if v > k:
		print(-1)
	else:
		print(v1, v2)


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().strip().split()))
	e = math.ceil(a / c)
	f = math.ceil(b / d)
	if e + f <= k:
		print(e, f)
	else:
		print(-1)


for i in range(int(input())):
	(a, b, c, d, e) = list(map(int, input().split(' ')))
	if a % c > 0:
		x = a // c + 1
	else:
		x = a // c
	if b % d > 0:
		y = b // d + 1
	else:
		y = b // d
	if x + y <= e:
		print(x, y)
	else:
		print(-1)


from sys import stdin
t = int(stdin.readline().strip())
for _ in range(t):
	(a, b, c, d, k) = [int(i) for i in stdin.readline().strip().split()]
	m = a // c
	if m * c < a:
		m += 1
	n = b // d
	if n * d < b:
		n += 1
	if m + n > k:
		print('-1')
	else:
		print(m, n)


t = int(input())
import math
for _ in range(t):
	a = list(map(int, input().split()))
	k = math.ceil(a[0] / a[2]) + math.ceil(a[1] / a[3])
	if k <= a[4]:
		print(math.ceil(a[0] / a[2]), math.ceil(a[1] / a[3]))
	else:
		print(-1)


from math import ceil
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	num_pens = ceil(a / c)
	num_pencils = ceil(b / d)
	if num_pens + num_pencils > k:
		print('-1')
	else:
		print('{} {}'.format(num_pens, num_pencils))
exit(0)


n = int(input())

def solve(n):
	result = []
	counter = 0
	for i in range(0, n):
		a = input().split()
		pens = int(int(a[0]) / int(a[2]) + 1)
		if not int(a[0]) % int(a[2]):
			pens -= 1
		pencils = int(int(a[1]) / int(a[3]) + 1)
		if not int(a[1]) % int(a[3]):
			pencils -= 1
		if pens + pencils > int(a[4]):
			result.append(-1)
		else:
			result.append(pens)
			result.append(pencils)
	for i in range(len(result)):
		if result[i] == -1:
			print('')
			print(result[i])
		elif counter == 2:
			print('')
			counter = 0
			print(result[i], end=' ')
		else:
			print(result[i], end=' ')
		counter += 1
solve(n)


n = int(input())
import math
for i in range(n):
	(a, b, c, d, e) = map(int, input().strip().split())
	if math.ceil(a / c) + math.ceil(b / d) <= e:
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)


from math import ceil
(pen, pencil, cap) = ([], [], [])
number = int(input())
for m in range(number):
	(a, b, c, d, k) = map(int, input().split())
	x = ceil(a / c)
	y = ceil(b / d)
	pen.append(x)
	pencil.append(y)
	cap.append(k)
for n in range(number):
	if pencil[n] + pen[n] > cap[n]:
		print(-1)
	else:
		print(pen[n], pencil[n])


import math
y = []
for i in range(int(input())):
	b = list(map(int, input().split()))
	if math.ceil(b[0] / b[2]) + math.ceil(b[1] / b[3]) <= b[4]:
		y.append(str(math.ceil(b[0] / b[2])) + ' ' + str(math.ceil(b[1] / b[3])))
	else:
		y.append(-1)
print(*y, sep='\n')


t = int(input())
import math
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().split()))
	nb_pen = math.ceil(a / c)
	nb_pencil = math.ceil(b / d)
	if nb_pen + nb_pencil <= k:
		print(nb_pen, nb_pencil)
	else:
		print(-1)


N = int(input())
for _ in range(N):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	pc = (a + c - 1) // c
	pn = (b + d - 1) // d
	if pc + pn > k:
		print(-1)
	else:
		print(pc, pn)


for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	s = (a - 1) // c + 1
	q = (b - 1) // d + 1
	print(-1 if s + q > k else f'{s} {q}')


t = int(input())
kq = []
for i in range(t):
	ab = [int(c) for c in input().split()]
	x1 = ab[0] / ab[2]
	x2 = ab[1] / ab[3]
	if x1 > int(x1):
		x1 = int(x1) + 1
	else:
		x1 = int(x1)
	if x2 > int(x2):
		x2 = int(x2) + 1
	else:
		x2 = int(x2)
	if x1 + x2 > ab[4]:
		kq.append('-1')
	else:
		x2 = ab[4] - x1
		out = []
		out = str(x1) + ' ' + str(x2)
		kq.append(out)
for i in range(t):
	print(kq[i])


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	s = 0
	g = 0
	if a % c == 0:
		s = a // c
	else:
		s = a // c + 1
	if b % d == 0:
		g = b // d
	else:
		g = b // d + 1
	if s + g > k:
		print(-1)
	else:
		print(s, g)


import math as mt
t = int(input())
while t:
	(a, b, c, d, k) = map(int, input().split())
	min_pen = mt.ceil(a / c)
	min_pencil = mt.ceil(b / d)
	if min_pen + min_pencil > k:
		print(-1)
	else:
		print('{} {}'.format(min_pen, min_pencil))
	t = t - 1


import math
t = int(input())
for i in range(0, t):
	(a, b, c, d, k) = map(int, input().split())
	if math.ceil(a / c) + math.ceil(b / d) > float(k):
		print(-1)
	else:
		print(int(math.ceil(a / c)), int(math.ceil(b / d)))


n = int(input())
for i in range(n):
	ans = 0
	(a, b, c, d, k) = input().split()
	(a, b, c, d, k) = (int(a), int(b), int(c), int(d), int(k))
	p = a // c
	if a % c != 0:
		p += 1
	ans += p
	q = b // d
	if b % d != 0:
		q += 1
	ans += q
	if ans <= k:
		print(p, q)
	else:
		print(-1)


import math
n = int(input())
for i in range(n):
	(a, b, c, d, k) = [int(j) for j in input().split()]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


q = int(input())
while q > 0:
	(a, b, c, d, k) = map(int, input().split())
	p = a // c
	if a % c != 0:
		p += 1
	r = b // d
	if b % d != 0:
		r += 1
	if p + r > k:
		print(-1)
	else:
		print(p, end=' ')
		print(r)
	q -= 1


n = int(input())
for i in range(n):
	l = list(map(int, input().split(' ')))
	if l[0] / l[2] == l[0] // l[2]:
		a = l[0] // l[2]
	else:
		a = l[0] // l[2] + 1
	if l[1] / l[3] == l[1] // l[3]:
		b = l[1] // l[3]
	else:
		b = l[1] // l[3] + 1
	if a + b <= l[4]:
		print(a, end=' ')
		print(b)
	else:
		print(-1)


for _ in range(int(input())):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	if c >= a:
		num1 = 1
	else:
		num1 = a // c
		if a % c:
			num1 += 1
	if d >= b:
		num2 = 1
	else:
		num2 = b // d
		if b % d:
			num2 += 1
	if num2 + num1 <= k:
		print(num1, num2)
	else:
		print(-1)


o = int(input())
for i in range(o):
	(a, b, c, d, e) = map(int, input().split())
	k = a // c
	if a % c != 0:
		k = k + 1
	l = b // d
	if b % d != 0:
		l = l + 1
	if l + k != e and l + k < e:
		h = e - l - k
		k = k + h
		print(k, l)
	elif l + k == e:
		print(k, l)
	elif l + k > e:
		print(-1)


from math import ceil
n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	t = ceil(a / c)
	g = ceil(b / d)
	if k >= t + g:
		print(t, g)
	else:
		print(-1)


t = int(input())
tests = list()
for _ in range(t):
	tests.append(list(map(int, input().split())))
result = list()
for test in tests:
	(a, b, c, d, k) = test
	pens = a // c if a % c == 0 else a // c + 1
	pencils = b // d if b % d == 0 else b // d + 1
	if pens + pencils <= k:
		result.append((pens, pencils))
	else:
		result.append(-1)
for value in result:
	if value != -1:
		print(f'{value[0]} {value[1]}')
	else:
		print(value)


import sys

def pens_and_pencils(a, b, c, d, k):
	n = a // c + int(a % c > 0)
	m = b // d + int(b % d > 0)
	if n + m > k:
		print(-1)
	else:
		print(f'{n} {m}')
for (i, line) in enumerate(sys.stdin):
	if i != 0:
		(a, b, c, d, k) = [int(x) for x in line.split()]
		pens_and_pencils(a, b, c, d, k)


import math
q = int(input())
for _ in range(q):
	(a, b, c, d, k) = map(int, input().split())
	num1 = math.ceil(a / c)
	num2 = math.ceil(b / d)
	num = num1 + num2
	num = int(num)
	if num > k:
		print(-1)
	else:
		print(int(num1), int(num2))


import math
t = int(input())
for ti in range(t):
	temp = input().split()
	a = int(temp[0])
	b = int(temp[1])
	c = int(temp[2])
	d = int(temp[3])
	k = int(temp[4])
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, k - x)
	else:
		print(-1)


for (a, b, c, d, k) in [map(int, input().split()) for _ in range(int(input()))]:
	x = a // c + [0, 1][a % c > 0]
	y = b // d + [0, 1][b % d > 0]
	print([' '.join([str(x), str(y)]), -1][x + y > k])


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
(t,) = I()
while t:
	t -= 1
	(a, b, c, d, k) = I()
	for i in range(k + 1):
		j = k - i
		if i * c >= a and j * d >= b:
			print(i, j)
			break
	else:
		print(-1)


from math import ceil
n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	(x, z) = (ceil(a / c), ceil(b / d))
	if x + z > k:
		print(-1)
	else:
		print(x, z, sep=' ')


import math
t = int(input())
result = []
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pensRequired = math.ceil(a / c)
	pencilsRequired = math.ceil(b / d)
	if pensRequired + pencilsRequired <= k:
		result.append((pensRequired, pencilsRequired))
	else:
		result.append(-1)
for x in result:
	if x == -1:
		print(x)
	else:
		print(x[0], x[1], sep=' ')


import sys
import math
from sys import stdin, stdout
n = int(input())
for p in range(n):
	[a, b, c, d, k] = [int(i) for i in input().split()]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y, '\n')
	else:
		print('-1\n')


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()

def addDictList(d, key, val):
	if key not in d:
		d[key] = []
	d[key].append(val)

def addDictInt(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] = val

def addDictCount(d, key):
	if key not in d:
		d[key] = 0
	d[key] += 1

def addDictSum(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] += val
import math
t = getInt()
for i in range(t):
	(a, b, c, d, k) = getVars()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
t = int(input())
x = 0
while x < t:
	x += 1
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	c = inp[2]
	d = inp[3]
	k = inp[4]
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	sum = pen + pencil
	if sum > k:
		print(-1)
	else:
		print('%d %d' % (pen, pencil))


import sys
import itertools
import math
n = None
for (line_num, line) in zip(itertools.count(), sys.stdin):
	if line_num == 0:
		n = int(line)
	elif line_num - 1 == n:
		break
	else:
		(a, b, c, d, k) = map(int, line.split(' '))
		pens = math.ceil(a / c)
		pencils = math.ceil(b / d)
		if pens + pencils > k:
			print(-1)
		else:
			print(pens, pencils)


import math
t = int(input())
out = []
for i in range(t):
	(a, b, c, d, k) = list(map(int, input().split(' ')))
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		out.append([str(x), str(y)])
	else:
		out.append(['-1'])
for o in out:
	print(' '.join(o))


T = int(input())
for _ in range(T):
	(a, b, c, d, k) = map(int, input().split())
	e = a // c + int(a % c > 0)
	f = b // d + int(b % d > 0)
	if e + f > k:
		print(-1)
	else:
		print('%d %d' % (e, f))


def lastpen(a, c):
	if a % c == 0:
		s = a // c
	else:
		s = a // c + 1
	return s

def lastpencil(a, c):
	if a % c == 0:
		s = a // c
	else:
		s = a // c + 1
	return s
for i in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	e = lastpen(a, c)
	f = lastpencil(b, d)
	if k < e + f:
		print('-1')
	else:
		print('%d %d' % (e, f))


from sys import stdin

def scal(typ=int):
	return typ(stdin.readline())

def vec(typ=int):
	if isinstance(typ, list):
		inp = stdin.readline().split()
		return [typ[i](inp[i]) for i in range(len(inp))]
	else:
		return list(map(typ, stdin.readline().split()))
from math import ceil
t = scal()
for _ in range(t):
	(a, b, c, d, k) = vec()
	(x, y) = (ceil(a / c), ceil(b / d))
	print(x, y) if x + y <= k else print(-1)


from math import ceil
T = int(input())
for t in range(1, T + 1):
	ans = 0
	(a, b, c, d, k) = map(int, input().split())
	ans1 = ceil(a / c)
	ans2 = ceil(b / d)
	if ans1 + ans2 > k:
		print(-1)
	else:
		print(ans1, ans2)


def main():
	t = int(input())
	for i in range(t):
		(a, b, c, d, k) = map(int, input().split())
		aa = a // c
		if a % c != 0:
			aa += 1
		bb = b // d
		if b % d != 0:
			bb += 1
		if aa + bb > k:
			print('-1')
		else:
			print('{} {}'.format(aa, bb))
main()


t = int(input())
if t >= 1 and t <= 100:
	plist = []
	for i in range(t):
		abcdk = list(map(int, input().split()))
		if abcdk[0] >= 1 and abcdk[0] <= 100 and (abcdk[1] >= 1) and (abcdk[1] <= 100) and (abcdk[2] >= 1) and (abcdk[2] <= 100) and (abcdk[3] >= 1) and (abcdk[3] <= 100) and (abcdk[4] >= 1) and (abcdk[4] <= 100):
			if abcdk[0] % abcdk[2] == 0:
				numpen = abcdk[0] // abcdk[2]
			else:
				numpen = abcdk[0] // abcdk[2] + 1
			if abcdk[1] % abcdk[3] == 0:
				numpencil = abcdk[1] // abcdk[3]
			else:
				numpencil = abcdk[1] // abcdk[3] + 1
			if numpen + numpencil <= abcdk[4]:
				plist.append(numpen)
				plist.append(numpencil)
			else:
				plist.append(-1)
		else:
			break
	i = 0
	while i <= len(plist) - 1:
		if plist[i] == -1:
			print(plist[i])
			i += 1
		else:
			print(plist[i], plist[i + 1])
			i += 2


import math

def PensandPencils(a, b, c, d, k):
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	out = x + y
	if out > k:
		print(-1)
	else:
		print(x, y)
for i in range(0, int(input())):
	(a, b, c, d, k) = map(int, input().rstrip().split())
	PensandPencils(a, b, c, d, k)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	resa = a // c + (1 if a % c != 0 else 0)
	resb = b // d + (1 if b % d != 0 else 0)
	if resa + resb > k:
		print(-1)
	else:
		print(resa, k - resa)


test_case = int(input())
for _ in range(test_case):
	(a, b, c, d, k) = map(int, input().split())
	no_pen = (a + c - 1) // c
	no_pencil = (b + d - 1) // d
	if no_pencil + no_pen > k:
		print(-1)
	else:
		print(no_pen, no_pencil)


q = int(input())
import math
for _ in range(q):
	(a, b, c, d, k) = map(int, input().split())
	x = 0
	x += math.ceil(a / c)
	x += math.ceil(b / d)
	if k < x:
		print(-1)
	else:
		print(math.ceil(a / c), math.ceil(b / d))


import math
for _ in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	c1 = math.ceil(a / c)
	c2 = math.ceil(b / d)
	if c1 + c2 <= e:
		print(c1, e - c1)
	else:
		print(-1)


querries = int(input())
for querrie in range(querries):
	pens = 0
	pencils = 0
	abcdk = input().split(' ')
	for num in range(5):
		abcdk[num] = int(abcdk[num])
	while abcdk[2] * pens < abcdk[0]:
		pens = pens + 1
	while abcdk[3] * pencils < abcdk[1]:
		pencils = pencils + 1
	if pens + pencils > abcdk[4]:
		print('-1')
	else:
		print(pens, pencils)


for _ in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	t = a // c
	s = b // d
	t1 = a % c
	s1 = b % d
	if t1 > 0:
		t += 1
	if s1 > 0:
		s += 1
	if t + s <= k:
		if t < s:
			print(t, end=' ')
			print(k - t)
		else:
			print(k - s, end=' ')
			print(s)
	else:
		print(-1)


import sys
from math import ceil
raw_data = sys.stdin.readlines()
testcases = raw_data.pop(0)
for i in raw_data:
	current_case = i.split()
	lectures = int(current_case[0])
	practical = int(current_case[1])
	pen = int(current_case[2])
	pencil = int(current_case[3])
	total = int(current_case[4])
	number = ceil(lectures / pen) + ceil(practical / pencil)
	if total >= number:
		print(str(ceil(lectures / pen)) + ' ' + str(ceil(practical / pencil)))
	else:
		print(-1)


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	m1 = ceil(a / c)
	m2 = ceil(b / d)
	print(-1) if m1 + m2 > k else print(m1, m2)


tes = int(input())
for i in range(tes):
	angka = input().split()
	if int(angka[0]) > int(angka[2]) and int(angka[0]) % int(angka[2]) != 0:
		hasil1 = int(angka[0]) // int(angka[2]) + 1
	elif int(angka[0]) % int(angka[2]) == 0:
		hasil1 = int(angka[0]) // int(angka[2])
	else:
		hasil1 = 1
	if int(angka[1]) > int(angka[3]) and int(angka[1]) % int(angka[3]) != 0:
		hasil2 = int(angka[1]) // int(angka[3]) + 1
	elif int(angka[1]) % int(angka[3]) == 0:
		hasil2 = int(angka[1]) // int(angka[3])
	else:
		hasil2 = 1
	if hasil1 + hasil2 <= int(angka[4]):
		print(hasil1, hasil2)
	elif hasil1 + hasil2 > int(angka[4]):
		print(-1)


tcase = int(input().strip())
for i in range(tcase):
	(a, b, c, d, k) = (int(x) for x in input().strip().split(' '))
	if a % c == 0:
		r1 = a // c
	else:
		r1 = a // c + 1
	if b % d == 0:
		r2 = b // d
	else:
		r2 = b // d + 1
	if r1 + r2 <= k:
		print(r1, r2)
	else:
		print(-1)


import math
a = int(input())
for i in range(a):
	b = list(map(int, input().split()))
	if b[0] <= b[2]:
		x = 1
	if b[0] > b[2]:
		if b[0] % b[2] == 0:
			x = round(b[0] / b[2])
		else:
			x = math.ceil(b[0] / b[2])
	if b[1] <= b[3]:
		y = 1
	if b[1] > b[3]:
		if b[1] % b[3] == 0:
			y = round(b[1] / b[3])
		else:
			y = math.ceil(b[1] / b[3])
	if x + y <= b[4]:
		print(x, end=' ')
		print(y)
	else:
		print('-1')


def main():
	t = int(input())
	for _ in range(t):
		(a, b, c, d, k) = (int(i) for i in input().split())
		need = 0 - -a // c + 0 - -b // d
		if need > k:
			print(-1)
		else:
			print(0 - -a // c, 0 - -b // d)
main()


import math as m
for tc in [0] * int(input()):
	(a, b, c, d, k) = map(int, input().split())
	(x, y) = (m.ceil(a / c), m.ceil(b / d))
	print(-1) if x + y > k else print(x, y)


for _ in range(int(input())):
	(a, b, c, d, k) = [int(i) for i in input().split()]
	r1 = a % c
	sum1 = a // c
	if r1 != 0:
		sum1 = sum1 + 1
	sum2 = b // d
	r2 = b % d
	if r2 != 0:
		sum2 = sum2 + 1
	if sum1 + sum2 <= k:
		print(sum1 + (k - (sum1 + sum2)), sum2)
	else:
		print(-1)


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	count1 = ceil(a / c)
	count2 = ceil(b / d)
	if count1 + count2 > k:
		print(-1)
	else:
		print(count1, count2)


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = True
optimise_for_recursion = True

def main():
	(a, b, c, d, k) = get_tuple()
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y <= k:
		print(x, y)
	else:
		print(-1)
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


class pensAndPencils:

	def __init__(self, testCase):
		self.testCase = testCase
		self.calculatePeanAndPencils(self.testCase)

	def calculatePeanAndPencils(self, tC):
		penList = []
		pencilList = []
		for x in range(0, tC):
			pen = 1
			pencil = 1
			(a, b, c, d, k) = map(int, input().split())
			if a > c:
				p = a - c
				while p != 0 and p > 0:
					pen += 1
					a = p
					p = a - c
			if b > d:
				m = b - d
				while m != 0 and m > 0:
					pencil += 1
					b = m
					m = b - d
			z = pen + pencil
			if z <= k:
				penList.append(str(pen))
				pencilList.append(str(pencil))
			else:
				penList.append('-1')
				pencilList.append('-1')
		for x in range(0, len(penList)):
			if penList[x] == '-1':
				print('-1')
			else:
				print(penList[x], pencilList[x])
testCase = int(input())
pensAndPencilsObj = pensAndPencils(testCase)


from math import ceil
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	r1 = ceil(a / c)
	r2 = k - r1
	if c * r1 >= a and d * r2 >= b:
		print(r1, r2)
	else:
		print(-1)


q = int(input())

def strs_to_ints(strs: str):
	return list(map(int, strs.split()))

def count_tools_for_str(inp):
	(lections, practics, pens_per_lection, pencils_per_practice, capacity) = strs_to_ints(inp)

	def counting_tools(lessons, tools_per_lessons):
		if tools_per_lessons > lessons:
			return 1
		if lessons % tools_per_lessons == 0:
			return lessons // tools_per_lessons
		return lessons // tools_per_lessons + 1
	pens = counting_tools(lections, pens_per_lection)
	pencils = counting_tools(practics, pencils_per_practice)
	if pens + pencils > capacity:
		print(-1)
	else:
		print(pens, pencils)
for _ in range(q):
	count_tools_for_str(input())


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = [int(x) for x in input().strip().split()]
	pen = a // c
	if a % c != 0:
		pen += 1
	pc = b // d
	if b % d != 0:
		pc += 1
	if pen + pc <= k:
		print(pen, pc)
	else:
		print(-1)


from math import ceil
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	no_pens = ceil(a / c)
	no_pencils = ceil(b / d)
	if no_pens + no_pencils <= k:
		print(no_pens, no_pencils)
	else:
		print('-1')


terms = int(input())
l = []
i = 0
while i < terms:
	(a, b, c, d, k) = map(int, input().split())
	x = a // c
	y = b // d
	if a % c != 0:
		x = x + 1
	if b % d != 0:
		y = y + 1
	if x + y <= k:
		t = '' + str(x) + ' ' + str(y)
		l.append(t)
		i += 1
	else:
		l.append('-1')
		i += 1
i = 0
while i < terms:
	pen_pencils = l[i]
	print(pen_pencils)
	i += 1


for i in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	if int(a / c + 0.9999999999999) + int(b / d + 0.9999999999999) <= k:
		print(int(a / c + 0.9999999999999), int(b / d + 0.9999999999999))
	else:
		print(-1)


import math
ceil = math.ceil
t = int(input())
for i in range(t):
	l = str(input()).split(' ')
	l = list(map(int, l))
	(a, b, c, d, k) = l
	ans = ceil(a / c) + ceil(b / d)
	if ans <= k:
		print(str(ceil(a / c)) + ' ' + str(ceil(b / d)))
	else:
		print('-1')


t = int(input())
while t > 0:
	t -= 1
	(a, b, c, d, k) = map(int, input().split())
	pens = a / c
	p = b / d
	if int(pens) < pens:
		pens = int(pens) + 1
	if int(p) < p:
		p = int(p) + 1
	(pens, p) = (int(pens), int(p))
	if p + pens == k:
		print(pens, p)
	elif p + pens < k:
		rem = k - p - pens
		print(pens + rem, p)
	else:
		print(-1)


import math
for t in range(int(input())):
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	c = arr[2]
	d = arr[3]
	k = arr[4]
	z = math.ceil(a / c)
	k = k - z
	y = math.ceil(b / d)
	if y > k:
		print('-1')
	else:
		print(z, y)


from math import ceil
t = int(input())
while t:
	(a, b, c, d, k) = map(int, input().split())
	tp = ceil(a / c)
	tcil = ceil(b / d)
	te = tp + tcil
	if te <= k:
		print(tp, tcil, sep=' ')
	else:
		print(-1)
	t -= 1


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	r1 = a % c
	r2 = b % d
	rm1 = a // c
	rm2 = b // d
	pn = 0
	pc = 0
	if r1 == 0:
		pn = rm1
	else:
		pn = 1 + rm1
	if r2 == 0:
		pc = rm2
	else:
		pc = 1 + rm2
	if pc + pn <= k:
		print(pn, pc)
	else:
		print('-1')


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
for _testcases_ in range(int(input())):
	(a, b, c, d, k) = get_ints()
	A = math.ceil(a / c)
	B = math.ceil(b / d)
	print(-1) if A + B > k else print(A, B)


import math

def solve(a, b, c, d, k):
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		return '-1'
	else:
		return f'{x} {y}'
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = [int(r) for r in input().split(' ')]
	print(solve(a, b, c, d, k))


fun = lambda : map(int, input().split())
V = []
for _ in range(int(input())):
	l = list(fun())
	x = l[0] // l[2]
	y = l[1] // l[3]
	if l[0] % l[2] != 0:
		x = x + 1
	if l[1] % l[3] != 0:
		y = y + 1
	if x + y > l[4]:
		V.append(-1)
	else:
		V.append(x)
		V.append(l[4] - x)
i = 0
while i in range(len(V)):
	if V[i] < 0:
		print(V[i])
		i = i + 1
	else:
		print(V[i], ' ', V[i + 1])
		i = i + 2


def solve():
	data = list(map(int, input().split()))
	num_lectures = data[0]
	num_practicals = data[1]
	ink_lectures = data[2]
	lead_practical = data[3]
	total_hold = data[4]
	if num_lectures % ink_lectures == 0:
		x = int(num_lectures / ink_lectures)
	else:
		x = int(num_lectures / ink_lectures) + 1
	if num_practicals % lead_practical == 0:
		y = int(num_practicals / lead_practical)
	else:
		y = int(num_practicals / lead_practical) + 1
	if x + y <= total_hold:
		print(x, end=' ')
		print(y)
	else:
		print('-1')
test_cases = int(input())
for x in range(test_cases):
	solve()


num = int(input())
for _ in range(num):
	arr = [int(num) for num in input().split()]
	if arr[0] % arr[2] == 0:
		num1 = int(arr[0] / arr[2])
	else:
		num1 = int(arr[0] / arr[2]) + 1
	if arr[1] % arr[3] == 0:
		num2 = int(arr[1] / arr[3])
	else:
		num2 = int(arr[1] / arr[3]) + 1
	if num1 + num2 <= arr[4]:
		print(num1, num2)
	else:
		print(-1)


from math import ceil
t = int(input())
for i in range(t):
	(a, b, a1, b1, k) = [int(i) for i in input().split()]
	pen = ceil(a / a1)
	pencil = ceil(b / b1)
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		c1 = a // c
	else:
		c1 = a // c + 1
	if b % d == 0:
		c2 = b // d
	else:
		c2 = b // d + 1
	if c1 + c2 <= k:
		print(c1, c2)
	else:
		print(-1)


T = int(input())
for t in range(T):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		m = a // c
	elif a % c != 0:
		m = a // c + 1
	if b % d == 0:
		n = b // d
	elif b % d != 0:
		n = b // d + 1
	if m + n <= k:
		print(m, n)
	elif m + n > k:
		print(-1)


n = int(input())
for _ in range(n):
	(a, b, c, d, k) = map(int, input().split())
	count = 0
	count2 = 0
	r = a % c
	if r == 0:
		count = a // c
	else:
		count = a // c + 1
	if count >= k:
		print(-1)
		continue
	t = b % d
	if t == 0:
		count2 = b // d
	else:
		count2 = b // d + 1
	if count2 >= k:
		print(-1)
		continue
	if count + count2 <= k:
		print(count, count2)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		npen = int(a / c)
	elif a % c != 0:
		npen = int(a / c) + 1
	if b % d == 0:
		np = int(b / d)
	elif b % d != 0:
		np = int(b / d) + 1
	if k < npen + np:
		print('-1')
	elif k >= npen + np:
		print(npen, np)


import sys
input = sys.stdin.readline
from math import ceil, floor, factorial

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(a, b, c, d, k) = int_array()
	pens = ceil(a / c)
	pencil = ceil(b / d)
	if pens + pencil <= k:
		print(*(pens, pencil))
	else:
		print(-1)


import math
for i in range(int(input())):
	first = list(map(int, input().split()))
	x = math.ceil(first[0] / first[2])
	y = math.ceil(first[1] / first[3])
	if x + y <= first[4]:
		print(x, y, sep=' ')
	else:
		print(-1)


import math
for _ in range(int(input())):
	(a, b, c, d, k) = [*map(int, input().split())]
	pen = 0
	pencil = 0
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	if pen + pencil <= k:
		print(str(pen) + ' ' + str(pencil))
	else:
		print(-1)


import math
z = int(input())
i = 0
while i < z:
	l = list(map(int, input().split()))
	m = math.ceil(l[0] / float(l[2]))
	n = math.ceil(l[1] / float(l[3]))
	if m + n <= l[4]:
		print(m, n)
	else:
		print(-1)
	i += 1


test_cases = int(input())
for counter in range(test_cases):
	(lec, pra, l, p, k) = map(int, input().split())
	if lec % l == 0:
		p1 = lec // l
	else:
		p1 = lec // l + 1
	if pra % p == 0:
		p2 = pra // p
	else:
		p2 = pra // p + 1
	e = p1 + p2
	if e > k:
		print(-1)
	else:
		print(p1, p2)


import math

def main():
	t = int(input())
	for i in range(t):
		(a, b, c, d, k) = (int(x) for x in input().split())
		solver(a, b, c, d, k)

def solver(a, b, c, d, k):
	pens = math.ceil(a / c)
	pencils = math.ceil(b / d)
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print(-1)
main()


n = int(input())
(k, l) = (0, 0)
for i in range(n):
	st = list(map(int, input().split()))
	arr = []
	arr.append(st[2])
	arr.append(st[3])
	k = 1
	while st[0] > st[2]:
		k += 1
		st[2] += arr[0]
	l = 1
	while st[1] > st[3]:
		l += 1
		st[3] += arr[1]
	if k + l <= st[4]:
		print(k, l)
	else:
		print('-1')


from math import ceil

def Polycarp():
	(a, b, c, d, k) = list(map(int, input().split()))
	minPencils = ceil(a / c)
	minPen = ceil(b / d)
	if minPen + minPencils > k:
		print(-1)
	else:
		print(minPencils, minPen)
t = int(input())
for i in range(t):
	Polycarp()


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = []
	for _ in range(n):
		(a, b, c, d, e) = LI()
		x = (a + c - 1) // c
		y = (b + d - 1) // d
		if x + y > e:
			ans.append(-1)
		else:
			ans.append(str(x) + ' ' + str(y))
	for x in ans:
		print(x)
main()


import math

def solve():
	(a, b, c, d, k) = [int(x) for x in input().split(' ')]
	num_of_pen_needed = int(math.ceil(a / c))
	num_of_pencil_needed = int(math.ceil(b / d))
	if num_of_pen_needed + num_of_pencil_needed <= k:
		print(num_of_pen_needed, num_of_pencil_needed)
	else:
		print(-1)
t = int(input())
for i in range(t):
	solve()


import math
try:
	for _ in range(int(input())):
		(a, b, c, d, k) = map(int, input().split())
		t1 = math.ceil(a / c)
		t2 = math.ceil(b / d)
		if t1 + t2 <= k:
			print(t1, t2)
		else:
			print(-1)
except:
	pass


from collections import defaultdict as dc
from collections import deque as dq
from bisect import bisect_left, bisect_right, insort_left
import sys
import math
mod = 10 ** 9 + 7

def bs(a, x):
	i = bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def inp():
	p = sys.stdin.readline()
	return p

def line():
	p = list(map(int, inp().split()))
	return p
for _ in range(int(inp())):
	(a, b, c, d, k) = line()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


from math import ceil
for _ in [0] * int(input()):
	(a, b, c, d, k) = map(int, input().split())
	lst = [ceil(a / c), ceil(b / d)]
	print(f'{lst[0]} {lst[1]}' if sum(lst) <= k else -1)


def answer():
	n = int(input())
	while n:
		z = [int(x) for x in input().split()]
		(a, c) = (z[0], z[2])
		pens = int(a / c) + 1 * (a % c != 0)
		(b, d) = (z[1], z[3])
		pencils = int(b / d) + 1 * (b % d != 0)
		if pens + pencils > z[4]:
			print(-1)
		else:
			print(pens, pencils)
		n -= 1
answer()


from sys import stdin
from math import *
for i in range(int(stdin.readline())):
	(a, b, c, d, k) = map(int, stdin.readline().split())
	n1 = ceil(a / c)
	n2 = ceil(b / d)
	if n1 + n2 <= k:
		print(n1, n2)
	else:
		print(-1)


for T in range(int(input())):
	(lec, prac, pen, pencil, k) = map(int, input().split())
	reqpen = lec // pen
	if lec % pen != 0:
		reqpen += 1
	reqpencils = prac // pencil
	if prac % pencil != 0:
		reqpencils += 1
	if reqpen + reqpencils <= k:
		print(reqpen, reqpencils)
	else:
		print(-1)


def main():
	Q = int(input())
	for _ in range(Q):
		(A, B, C, D, K) = map(int, input().split())
		x = (A + C - 1) // C
		y = (B + D - 1) // D
		if x + y <= K:
			print(x, y)
		else:
			print(-1)
main()


import sys
import math
from collections import defaultdict
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : map(int, input().split())

def write(*args, sep='\n'):
	for i in args:
		sys.stdout.write('{}'.format(i) + sep)
INF = float('inf')
MOD = int(1000000000.0 + 7)
for q in range(int(input())):
	(a, b, c, d, k) = read()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
x = int(input())
lst = []
for i in range(0, x):
	(a, b, c, d, k) = map(int, input().split())
	f = math.ceil(a / c)
	g = math.ceil(b / d)
	if f + g > k:
		lst.append(-1)
	else:
		lst.append((f, g))
for i in lst:
	if i == -1:
		print(i)
	else:
		print(*i, sep=' ')


from math import *
t = int(input())
for i in range(t):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	c = int(s[2])
	d = int(s[3])
	k = int(s[4])
	p = ceil(float(a / c))
	q = ceil(float(b / d))
	if p + q > k:
		print('-1')
	else:
		print(p, ' ', q)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split(' '))
	qa = a // c
	ra = int(a % c > 0)
	qb = b // d
	rb = int(b % d > 0)
	if qa + ra + qb + rb <= k:
		print(qa + ra, qb + rb)
	else:
		print(-1)


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (a, b, c, d, k) in Query:
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


import math
for i in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	j = math.ceil(a / c)
	k = math.ceil(b / d)
	if j + k <= e:
		print(j, k)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	s = input()
	s = s.split(' ')
	for i in range(len(s)):
		s[i] = int(s[i])
	(a, b, c, d, k) = (s[0], s[1], s[2], s[3], s[4])
	if a % c == 0:
		ap = a // c
	else:
		ap = a // c + 1
	if b % d == 0:
		bp = b // d
	else:
		bp = b // d + 1
	if ap + bp > k:
		print(-1)
	else:
		print(ap, bp)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	flag = False
	ans = -1
	for i in range(k):
		if a <= c * i and b <= d * (k - i):
			flag = True
			ans = i
			break
	if flag:
		print(ans, k - ans)
	else:
		print(ans)


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen = -(-a // c)
	pencil = -(-b // d)
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


for _ in range(int(input())):
	(a, b, c, d, k) = [int(__) for __ in input().split()]
	shit = 0
	ans = 0
	if a % c == 0:
		shit += a // c
	else:
		shit += a // c + 1
	if b % d == 0:
		ans += b // d
	else:
		ans += b // d + 1
	if shit + ans > k:
		print(-1)
		continue
	else:
		print(shit, ans)


sum = int(input())
list = {}
for j in range(sum):
	list[j] = [int(x) for x in input().split()]
for j in range(sum):
	flag = 0
	for i in range(list[j][4]):
		if (list[j][4] * list[j][2] < list[j][0]) | (list[j][4] * list[j][3] < list[j][1]):
			flag = 1
			print('-1')
			break
		if (i * list[j][2] >= list[j][0]) & ((list[j][4] - i) * list[j][3] >= list[j][1]):
			print('%d %d' % (i, list[j][4] - i))
			flag = 1
			break
	if flag == 0:
		print('-1')


t = int(input())
for te in range(t):
	a = [int(i) for i in input().split()]
	ans1 = (a[0] - 1) // a[2] + 1
	ans2 = (a[1] - 1) // a[3] + 1
	if ans1 + ans2 > a[4]:
		print(-1)
	else:
		print(ans1, ' ', ans2)


s = int(input())
for i in range(s):
	a = list(map(int, input().split()))
	x = bool(a[0] % a[2])
	y = bool(a[1] % a[3])
	ans1 = int(a[0] / a[2] + x)
	ans2 = int(a[1] / a[3] + y)
	if ans1 + ans2 <= a[4]:
		print(ans1, end=' ')
		print(ans2)
	else:
		print(-1)


import math
n = int(input())
for i in range(n):
	pen = 0
	pencil = 0
	(a, b, c, d, e) = [int(i) for i in input().split()]
	if a <= c:
		pen = 1
	elif a > c:
		f = math.ceil(a / c)
		pen = f
	if b <= d:
		pencil = 1
	elif b > d:
		f = math.ceil(b / d)
		pencil = f
	if pen + pencil <= e:
		print(pen, pencil)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	pen = 0
	pencil = 0
	while True:
		if c * pen >= a and d * pencil >= b:
			break
		if c * pen < a and d * pencil < b:
			pen += 1
			pencil += 1
			continue
		if c * pen < a and d * pencil >= b:
			pen += 1
			continue
		if d * pencil < b and c * pen >= a:
			pencil += 1
			continue
	if pen + pencil > k:
		print('-1')
		(a, b, c, d, k) = (0, 0, 0, 0, 0)
	elif pen + pencil <= k:
		print(pen, pencil)
		(a, b, c, d, k) = (0, 0, 0, 0, 0)


from sys import stdin
import math
t = int(stdin.readline())
while t:
	(a, b, c, d, k) = map(int, stdin.readline().split())
	(x, y) = (math.ceil(a / c), math.ceil(b / d))
	if x + y <= k:
		print(x, y)
	else:
		print(-1)
	t -= 1


from math import ceil
answers = []
t = int(input())
for i in range(t):
	n = input().split()
	a = int(n[0])
	b = int(n[1])
	c = int(n[2])
	d = int(n[3])
	k = int(n[4])
	pencils = ceil(a / c)
	pens = ceil(b / d)
	if k < pencils + pens:
		answers.append('-1')
	else:
		answers.append(str(pencils) + ' ' + str(pens))
print('\n'.join(answers))


from sys import stdin, stdout
for i in stdin:
	t = int(i.strip())
	break
while t:
	for i in stdin:
		(a, b, c, d, k) = list(map(int, i.strip().split()))
		break
	i = a // c + bool(a % c)
	j = b // d + bool(b % d)
	if i + j > k:
		stdout.write('-1\n')
	else:
		stdout.write(str(i) + ' ' + str(j) + '\n')
	t -= 1


t = int(input())

def pp(a, b, c, d, k):
	pens = a // c if a // c == a / c else a // c + 1
	pencils = b // d if b // d == b / d else b // d + 1
	if pens + pencils > k:
		print(-1)
		return
	print(k - pencils, pencils)
	return
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pp(a, b, c, d, k)


tests = int(input())
import math
for test in range(0, tests):
	data = input().split()
	x = math.ceil(int(data[0]) / int(data[2]))
	if x > int(data[4]):
		print(-1)
	else:
		y = math.ceil(int(data[1]) / int(data[3]))
		if x + y > int(data[4]):
			print(-1)
		else:
			print(x, y)


n = int(input())
for g in range(n):
	(a, b, c, d, k) = map(int, input().split())
	x = a // c
	if a % c > 0:
		x += 1
	y = b // d
	if b % d > 0:
		y += 1
	if x + y <= k:
		print(x, y)
	else:
		print('-1')


n = int(input())
for i in range(n):
	s = input().split()
	lekZ = int(s[0])
	prakZ = int(s[1])
	hvataetR = int(s[2])
	hvataetK = int(s[3])
	penal = int(s[4])
	x = int(lekZ) // int(hvataetR)
	if lekZ % hvataetR > 0:
		x = x + 1
	y = int(prakZ) // int(hvataetK)
	if prakZ % hvataetK > 0:
		y = y + 1
	if x + y <= penal:
		print(x, y)
	else:
		print(-1)


import sys
import math
T = int(input())
for i in range(0, T):
	l = list(map(int, input().split()))
	pen = math.ceil(l[0] / l[2])
	pencil = math.ceil(l[1] / l[3])
	if pen + pencil > l[4]:
		print(-1)
	else:
		print(pen, pencil)


import sys
from math import ceil
cin = sys.stdin.buffer.readline
for _ in range(int(cin())):
	(a, b, c, d, k) = map(int, cin().split())
	for el in [[-1], [ceil(a / c), ceil(b / d)]][ceil(a / c) + ceil(b / d) <= k]:
		print(el, end=' ')
	print()


number = int(input())
for _ in range(number):
	i = list(map(int, input().split()))
	if i[0] % i[2] == 0:
		pen = i[0] // i[2]
	else:
		pen = i[0] // i[2] + 1
	if i[1] % i[3] == 0:
		pencil = i[1] // i[3]
	else:
		pencil = i[1] // i[3] + 1
	if pen + pencil <= i[4]:
		print(pen + (i[4] - pen - pencil), pencil)
	else:
		print(-1)


for t in range(int(input())):
	l = list(map(int, input().split()))
	if l[0] % l[2] == 0:
		x = l[0] // l[2]
	else:
		x = l[0] // l[2] + 1
	if l[1] % l[3] == 0:
		y = l[1] // l[3]
	else:
		y = l[1] // l[3] + 1
	if x + y <= l[4]:
		print(x, y)
	else:
		print('-1')


from math import ceil as ceil
t = int(input())
for i in range(t):
	s = input()
	(a, b, c, d, k) = [int(x) for x in s.split()]
	m = ceil(a / c)
	n = ceil(b / d)
	if m + n <= k:
		print(m, n)
	else:
		print(-1)


import math
n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	pen = math.floor((a + c - 1) / c)
	pencils = math.floor((b + d - 1) / d)
	if pen + pencils > k:
		print(-1)
	else:
		print(pen, pencils)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	ar = 0
	br = 0
	ar = a // c
	if a % c > 0:
		ar += 1
	br = b // d
	if b % d > 0:
		br += 1
	if ar + br <= k:
		print(ar, br)
	else:
		print('-1')


def get_val(a, b):
	if a % b == 0:
		return int(a / b)
	else:
		return int(a / b) + 1
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if get_val(a, c) + get_val(b, d) <= k:
		print(get_val(a, c), ' ', get_val(b, d))
	else:
		print(-1)


t = int(input())
z = []
p = True
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = 0
	y = 0
	w = 0
	t = True
	while t:
		t = False
		if a > x * c:
			x += 1
			t = True
		if b > y * d:
			y += 1
			t = True
		if k < x + y:
			w = 1
			t = False
	if w == 1:
		z.append(-1)
	else:
		z.append(str(x) + ' ' + str(y))
for i in z:
	print(i)


t = int(input())
for i in range(t):
	(a, b, c, d, e) = map(int, input().split())
	pen = (a - 1) // c + 1
	pencil = (b - 1) // d + 1
	if pen + pencil > e:
		print('-1')
	else:
		print(pen, pencil)


import time

def calculatePensInLectures(lin):
	qlect = lin[0]
	maxLectPen = lin[2]
	qtyPens = int(qlect / maxLectPen)
	mod = qlect % maxLectPen
	if mod > 0:
		qtyPens += 1
	if qtyPens == 0:
		qtyPens = 1
	return qtyPens

def calculatePencilsInPractices(lin):
	qpract = lin[1]
	maxPractPenc = lin[3]
	qtyPencils = int(qpract / maxPractPenc)
	mod = qpract % maxPractPenc
	if mod > 0:
		qtyPencils += 1
	if qtyPencils == 0:
		qtyPencils = 1
	return qtyPencils

def getResult(lin):
	penNdd = calculatePensInLectures(lin)
	pencilNdd = calculatePencilsInPractices(lin)
	capacityCase = lin[4]
	qtyNeeded = penNdd + pencilNdd
	res = ''
	if qtyNeeded > capacityCase:
		res = '-1'
	else:
		res = str(penNdd) + ' ' + str(pencilNdd)
	print(res)
	return

def solve():
	cases = int(input())
	for x in range(cases):
		lin = [int(y) for y in input().split(' ')]
		getResult(lin)
solve()


import math
t = int(input())
for i in range(t):
	array = list(map(int, input().split()))
	a = array[0]
	b = array[1]
	c = array[2]
	d = array[3]
	k = array[4]
	ink_amount = math.ceil(a / c)
	pen_amount = math.ceil(b / d)
	if ink_amount + pen_amount > k:
		print(-1)
	else:
		print(str(ink_amount) + ' ' + str(pen_amount))


import math
t = int(input())
while t:
	(a, b, c, d, e) = list(map(int, input().split()))
	m = math.ceil(a / c) + math.ceil(b / d)
	if m <= e:
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)
	t = t - 1


from math import *
t = int(input())
for i in range(t):
	s = list(map(int, input().split()))
	a = s[0]
	b = s[1]
	c = s[2]
	d = s[3]
	k = s[4]
	if a % c == 0:
		c = a // c
	else:
		c = a // c + 1
	if b % d == 0:
		d = b // d
	else:
		d = b // d + 1
	if c + d <= k:
		print(c, d)
	else:
		print(-1)


tets = int(input())
for x in range(tets):
	(a, b, c, d, e) = list(map(int, input().split()))
	pen = a / c
	if pen == pen // 1:
		pass
	else:
		pen = int(pen // 1) + 1
	pencil = b / d
	if pencil == pencil // 1:
		pass
	else:
		pencil = int(pencil // 1) + 1
	if pen + pencil <= e:
		print(int(pen), int(pencil))
	else:
		print(-1)


from math import gcd
from math import ceil, floor
from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
from random import randint
import sys
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 9) + 7
test = int_input()
for _ in range(test):
	(a, b, c, d, k) = multi_int_input()
	no_of_pens_req = ceil(a / c)
	no_of_pencils = ceil(b / d)
	if no_of_pens_req + no_of_pencils <= k:
		print(no_of_pens_req, no_of_pencils)
	else:
		print(-1)


t = int(input())
for j in range(t):
	(a, b, c, d, k) = map(int, input().split())
	(pen, pencil) = (0, 0)
	if a <= c:
		pen = 1
	else:
		i = 1
		while True:
			if a <= c * i:
				pen += i
				break
			else:
				i += 1
	if b <= d:
		pencil = 1
	else:
		i = 1
		while True:
			if b <= d * i:
				pencil += i
				break
			else:
				i += 1
	if pen + pencil <= k:
		print(pen, pencil)
	else:
		print(-1)


import math
entries = int(input())
for i in range(entries):
	(a, b, c, d, e) = map(int, input().split())
	min_pen = math.ceil(a / c)
	min_pencil = math.ceil(b / d)
	if min_pencil + min_pen <= e:
		print(min_pen, min_pencil)
	else:
		print(-1)


import math
n = int(input())
a = list((list(map(int, input().split())) for i in range(n)))
for j in range(n):
	if math.ceil(a[j][0] / a[j][2]) + math.ceil(a[j][1] / a[j][3]) <= a[j][4]:
		print(str(math.ceil(a[j][0] / a[j][2])) + ' ' + str(math.ceil(a[j][1] / a[j][3])))
	else:
		print('-1')


for i in range(int(input())):
	values = list(map(int, input().split(' ')))
	a = values[0]
	b = values[1]
	c = values[2]
	d = values[3]
	k = values[4]
	if c > a:
		x = 1
	elif a % c == 0:
		x = a // c
	else:
		x = a // c + 1
	if d > b:
		y = 1
	elif b % d == 0:
		y = b // d
	else:
		y = b // d + 1
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


t = int(input())
array = []
for i in range(t):
	x = list(map(int, input().split()))
	array.append(x)
for j in array:
	if j[0] % j[2] == 0:
		pen = j[0] // j[2]
	if j[0] % j[2] != 0:
		pen = j[0] // j[2] + 1
	if j[1] % j[3] == 0:
		pencil = j[1] // j[3]
	if j[1] % j[3] != 0:
		pencil = j[1] // j[3] + 1
	if pen + pencil > j[4]:
		print('-1')
	if pen + pencil <= j[4]:
		print(j[4] - pencil, pencil)


t = int(input())
for i in range(t):
	x = list(map(int, input().split()))
	if x[0] / x[2] > x[0] // x[2]:
		x1 = x[0] // x[2] + 1
	else:
		x1 = x[0] // x[2]
	if x[1] / x[3] > x[1] // x[3]:
		x2 = x[1] // x[3] + 1
	else:
		x2 = x[1] // x[3]
	if x1 + x2 <= x[4]:
		print(x1, end=' ')
		print(x2)
	else:
		print(-1)
	x = []


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	pn = math.ceil(a / c)
	pncl = math.ceil(b / d)
	if pn + pncl <= k:
		print(str(pn) + ' ' + str(k - pn))
	else:
		print('-1')


from math import ceil
t = int(input())
while t > 0:
	(a, b, c, d, k) = tuple(map(int, input().split()))
	y = ceil(b / d)
	if ceil(a / c) > k - y:
		ans = -1
	else:
		ans = str(k - y) + ' ' + str(y)
	print(ans)
	t -= 1


import math
t = int(input())
for j in range(t):
	ele = list(map(int, input().rstrip().split()))
	x = math.ceil(ele[0] / ele[2])
	y = math.ceil(ele[1] / ele[3])
	total = x + y
	if total <= ele[4]:
		print(x, y)
	else:
		print(-1)


n = int(input())
answer = [None for i in range(n)]
for i in range(n):
	(a, b, c, d, k) = [int(j) for j in input().split()]
	x = a // c + bool(a % c)
	y = b // d + bool(b % d)
	answer[i] = f'{x} {y}' if x + y <= k else '-1'
print('\n'.join(answer))


try:
	t = int(input())
	for i in range(0, t):
		(a, b, c, d, k) = map(int, input().split())
		if a / c == a // c:
			x = a // c
		else:
			x = a // c + 1
		if b / d == b // d:
			y = b // d
		else:
			y = b // d + 1
		if x + y <= k:
			print(str(x) + ' ' + str(y))
		else:
			print(-1)
except:
	pass


def solve(need, last):
	if need <= last:
		return 1
	if need % last == 0:
		return need // last
	else:
		return need // last + 1
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen = solve(a, c)
	pencil = solve(b, d)
	if pen + pencil > k:
		print(-1)
		continue
	else:
		print(pen, pencil)


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	s1 = ceil(a / c)
	s2 = ceil(b / d)
	if s1 + s2 > e:
		print(-1)
	else:
		print(str(s1) + ' ' + str(s2))


from math import ceil
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	sum = 0
	suma = ceil(a / c)
	sumb = ceil(b / d)
	if suma + sumb <= k:
		print(suma, sumb)
		continue
	else:
		print(-1)
		continue


import math
I = lambda : int(input())
ID = lambda : map(int, input().split())
IL = lambda : list(ID())
t = I()
for _ in range(t):
	(a, b, c, d, k) = ID()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		print(-1)
	else:
		print(x, y)


from math import *
from sys import *
from heapq import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def alldivisors(n):
	list = []
	arr = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				arr += [i]
			else:
				arr += [i]
				list.append(n // i)
	arr += list[::-1]
	return arr

def primefactorisation(n):
	potentional_p = 3
	itog_list = defaultdict(int)
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			itog_list[n] += 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			itog_list[potentional_p] += 1
		potentional_p += 2
	return itog_list

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c, d, k) = list(map(int, input().split()))
		pen = ceil(a / c)
		pencil = ceil(b / d)
		if pen + pencil <= k:
			print(pen, pencil)
		else:
			print(-1)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math

def mi():
	return map(int, input().split())
t = int(input())
while t:
	(a, b, c, d, k) = mi()
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, end=' ')
		print(y)
	else:
		print('-1')
	t -= 1


t = int(input())
m = []
for i in ' ' * t:
	(a, b, c, d, k) = map(int, input().split())
	r1 = a // c
	if a % c != 0:
		r1 += 1
	r2 = b // d
	if b % d != 0:
		r2 += 1
	if r1 + r2 > k:
		m += [[-1]]
	else:
		m += [[r1, r2]]
for i in m:
	print(*i)


from math import ceil
T = int(input())
for _ in range(T):
	(a, b, c, d, k) = (int(x) for x in input().split())
	pen = int(ceil(a / c))
	pencil = int(ceil(b / d))
	if pen + pencil > k:
		print(-1)
	else:
		print('{} {}'.format(pen, pencil))


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
t = ii()
for i in range(t):
	(a, b, c, d, k) = mi()
	if math.ceil(a / c) + math.ceil(b / d) > k:
		print(-1)
	else:
		print(math.ceil(a / c), math.ceil(b / d))


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	T = Scanner.int()
	for _ in range(T):
		(a, b, c, d, k) = Scanner.map_int()
		x = Math.round_up(a, c)
		y = Math.round_up(b, d)
		if x + y <= k:
			print(x, y, sep=' ')
		else:
			print(-1)
main()


import math
t = int(input())
for _ in range(t):
	[a, b, c, d, k] = map(int, input().split())
	pens = math.ceil(a / c)
	pencils = math.ceil(b / d)
	if pencils + pens > k:
		print(-1)
		continue
	print(pens, pencils)


import math
for case in range(int(input())):
	(m, n, a, b, c) = map(int, input().split())
	a = math.ceil(m / a)
	b = math.ceil(n / b)
	if a + b > c:
		print(-1)
	else:
		print(a, b)


q = int(input())
for _ in range(q):
	(a, b, c, d, k) = [int(x) for x in input().split(' ')]
	pens = (a + c - 1) // c
	pencils = (b + d - 1) // d
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print(-1)


from math import ceil
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
n = ii()
for i in range(n):
	a = iia()
	x = ceil(a[0] / a[2])
	y = ceil(a[1] / a[3])
	if x + y <= a[4]:
		print(x, y)
	else:
		print(-1)


import math
t = int(input())
output_lst = []
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		output_lst.append(-1)
		output_lst.append(' ')
	else:
		output_lst.append(x)
		output_lst.append(y)
		output_lst.append(' ')
for j in range(len(output_lst)):
	if output_lst[j] == ' ':
		if output_lst[j - 1] == -1:
			print(-1)
		else:
			print(output_lst[j - 2], output_lst[j - 1])


q = int(input())
for i in range(q):
	s = input()
	l = list(map(int, s.split(' ')))
	a = (l[0] + l[2] - 1) // l[2]
	b = (l[1] + l[3] - 1) // l[3]
	if a + b <= l[4]:
		print(a, b)
	else:
		print('-1')


import math
tests = eval(input())
for i in range(tests):
	a = list(map(int, input().split(' ')))
	pens = math.ceil(a[0] / a[2])
	pencils = math.ceil(a[1] / a[3])
	if pens + pencils > a[4]:
		print(-1)
		continue
	else:
		print('%d %d' % (pens, pencils))


from math import *

def ri():
	return int(input())

def rli():
	return list(map(int, input().split()))
q = ri()
for _ in range(q):
	(a, b, c, d, k) = rli()
	x = int(ceil(a / c))
	y = int(ceil(b / d))
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


q = int(input())
ans = []
for i in range(q):
	(a, b, c, d, k) = map(int, input().split())
	s1 = 0
	s2 = 0
	if a % c:
		s1 += 1
	s1 += a // c
	if b % d:
		s2 += 1
	s2 += b // d
	if k < s1 + s2:
		ans.append('-1')
	else:
		ans.append(str(s1) + ' ' + str(s2))
for i in range(q):
	print(ans[i])


n = int(input())
inputs = []
while len(inputs) < n:
	i = [int(_) for _ in input().split()]
	inputs.append(i)
for i in inputs:
	(a, b, c, d, k) = i
	need_c = int((a + c - 1) / c)
	need_d = int((b + d - 1) / d)
	if need_c + need_d > k:
		print(-1)
	else:
		las = k - need_c - need_d
		print(las + need_c, need_d)


testCases = int(input())
for i in range(testCases):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	contador = 1
	while True:
		if a <= contador * c:
			break
		else:
			contador += 1
	minLecture = contador
	contador = 1
	while True:
		if b <= contador * d:
			break
		else:
			contador += 1
	minPratical = contador
	if minPratical + minLecture <= k:
		print(minLecture, minPratical)
	else:
		print(-1)


import math
for i in range(int(input())):
	(nl, np, p, pe, k) = list(map(int, input().strip().split()))
	c = math.ceil(nl / p)
	t = math.ceil(np / pe)
	if c + t <= k:
		print(abs(k - t), abs(t))
	else:
		print('-1')


import math
test = int(input())
while test != 0:
	(a, b, c, d, k) = list(map(int, input().split()))
	pen = math.ceil(a / c)
	pencil = math.ceil(b / d)
	if pen + pencil <= k:
		print(str(pen) + ' ' + str(pencil))
	else:
		print(-1)
	test -= 1


x = 0
g = int(input())
a = []
l = []
while x != g:
	a = input().split()
	for h in range(5):
		a[h] = int(a[h])
	m = a[0] // a[2] + 1
	if a[0] % a[2] == 0:
		m -= 1
	n = a[1] // a[3] + 1
	if a[1] % a[3] == 0:
		n -= 1
	if m + n <= a[4]:
		l.append(str(m) + ' ' + str(n))
	else:
		l.append(str(-1))
	x += 1
for h in l:
	print(h)


t = int(input())
for _ in range(t):
	arr = [int(num) for num in input().split()]
	if arr[0] % arr[2] == 0:
		pens = arr[0] // arr[2]
	else:
		pens = arr[0] // arr[2] + 1
	if arr[1] % arr[3] == 0:
		pencils = arr[1] // arr[3]
	else:
		pencils = arr[1] // arr[3] + 1
	if pens + pencils <= arr[4]:
		print(pens, pencils)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = list(map(int, input().split()))
	e = a // c
	if a % c != 0:
		e += 1
	f = b // d
	if b % d != 0:
		f += 1
	if e + f <= k:
		print(e, f)
	else:
		print(-1)


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if math.ceil(a / c) + math.ceil(b / d) <= k:
		p = math.ceil(a / c) + math.ceil(b / d)
		l = k - p
		if l % 2 == 0:
			print(math.ceil(a / c) + l // 2, math.ceil(b / d) + l // 2)
		else:
			print(math.ceil(a / c) + l // 2, math.ceil(b / d) + l // 2 + 1)
	else:
		print('-1')


import math
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().strip().split(' '))
	p1 = math.ceil(a / c)
	p2 = math.ceil(b / d)
	p3 = p1 + p2
	if p3 <= k:
		print(p1, p2, end=' ')
	else:
		print('-1')


T = int(input())
for _ in range(T):
	(A, B, C, D, K) = map(int, input().split())
	x = -(-A // C)
	y = -(-B // D)
	if x + y > K:
		print(-1)
	else:
		print(x, y)


t = int(input())
if 1 <= t <= 100:
	for i in range(t):
		(a, b, c, d, k) = input().split()
		a = int(a)
		b = int(b)
		c = int(c)
		d = int(d)
		k = int(k)
		if a % c == 0:
			e = a / c
		else:
			e = a // c + 1
		if b % d == 0:
			f = b / d
		else:
			f = b // d + 1
		p = e + f
		p = int(p)
		if p <= k:
			e = int(e)
			f = int(f)
			print(e, f)
		else:
			print(-1)


n = int(input())

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1
for _ in range(n):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	(aa, bb) = (ceil(a, c), ceil(b, d))
	if aa + bb <= k:
		print(aa, bb)
	else:
		print(-1)


from math import ceil
for x in range(int(input())):
	a = list(map(int, input().split()))
	if ceil(a[0] / a[2]) + ceil(a[1] / a[3]) <= a[-1]:
		print(ceil(a[0] / a[2]), ceil(a[1] / a[3]))
	else:
		print(-1)


from math import ceil
import sys

def atoi(line):
	line = line.rstrip().split()
	return list(map(int, line))

def check(n1, n2):
	if n1 < n2:
		return 1
	return int(ceil(n1 / n2))

def read():
	t = int(input())
	ans = []
	for i in range(t):
		(a, b, c, d, k) = atoi(sys.stdin.readline())
		x = check(a, c)
		y = check(b, d)
		if x + y <= k:
			ans.append(' '.join([str(x), str(y)]))
		else:
			ans.append('-1')
	return ans

def print_ans(a):
	for row in a:
		print(row)
ans = read()
print_ans(ans)


T = int(input())
for a in range(T):
	x = input()
	L = list(map(int, x.split()))
	a = L[0]
	b = L[1]
	c = L[2]
	d = L[3]
	k = L[4]
	if a % c == 0:
		pens = a // c
	else:
		pens = a // c + 1
	if b % d == 0:
		pencils = b // d
	else:
		pencils = b // d + 1
	if pens + pencils > k:
		print(-1)
	else:
		print(pens, pencils)


from math import ceil
n = int(input())
for bla in range(n):
	(numLec, numPrac, lecPerPen, pracPerPencil, pencilcaseSize) = [int(x) for x in input().split()]
	pen = ceil(numLec / lecPerPen)
	pencil = ceil(numPrac / pracPerPencil)
	if pen + pencil > pencilcaseSize:
		print(-1)
	else:
		print(str(pen) + ' ' + str(pencil))


t = int(input())
for q in range(t):
	s = list(map(int, input().split()))
	a = s[0]
	b = s[1]
	c = s[2]
	d = s[3]
	k = s[4]
	nx = 0
	ny = 0
	if a % c == 0:
		nx = a // c
	else:
		nx = a // c + 1
	if b % d == 0:
		ny = b // d
	else:
		ny = b // d + 1
	if nx + ny <= k:
		print(nx, ny)
	else:
		print(-1)


t = int(input())

def roundup(x):
	y = round(x)
	if y < x:
		return y + 1
	else:
		return y
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pen = roundup(a / c)
	pencil = roundup(b / d)
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, ' ', pencil)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	a1 = 0
	a2 = 0
	if a % c == 0:
		a1 = a // c
	else:
		a1 = a // c + 1
	if b % d == 0:
		a2 = b // d
	else:
		a2 = b // d + 1
	if a1 + a2 <= k:
		print(a1, a2)
	else:
		print(-1)


t = int(input())
x = []
y = []
for z in range(t):
	s = input()
	s = s.split(' ')
	s = [int(s[i]) for i in range(len(s))]
	a = s[0]
	b = s[1]
	c = s[2]
	d = s[3]
	k = s[4]
	tempX = 0
	tempY = 0
	for i in range(1, k):
		j = 1
		while i + j <= k and (tempX == 0 or tempY == 0):
			if i * c >= a and j * d >= b:
				tempX = i
				tempY = j
			j += 1
	x.append(tempX)
	y.append(tempY)
for i in range(t):
	if x[i] != 0 and y[i] != 0:
		print(x[i], y[i])
	else:
		print(-1)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	x = (a + c - 1) // c
	y = (b + d - 1) // d
	total = x + y
	xy = str(x) + ' ' + str(y)
	print(xy if total <= k else -1)


t = int(input())
for i in range(t):
	lis = list(map(int, input().split()))
	a = lis[0]
	b = lis[1]
	c = lis[2]
	d = lis[3]
	k = lis[4]
	l = 1
	m = 1
	xans = 0
	yans = 0
	flag = 0
	penneed = a / c
	if penneed % 1 != 0:
		penneed = int(penneed) + 1
	pencilneed = b / d
	if pencilneed % 1 != 0:
		pencilneed = int(pencilneed) + 1
	if pencilneed + penneed <= k:
		print(int(penneed), end=' ')
		print(int(pencilneed))
	else:
		print('-1')


def pens_and_pencils(case):
	x = 1
	y = 1
	if case[0] > case[2] and case[0] % case[2] != 0:
		x += case[0] // case[2]
	elif case[0] > case[2]:
		x = case[0] // case[2]
	if case[1] > case[3] and case[1] % case[3] != 0:
		y += case[1] // case[3]
	elif case[1] > case[3]:
		y = case[1] // case[3]
	if case[4] >= x + y:
		return str(x) + ' ' + str(y)
	return str(-1)
t = int(input())
data = []
for i in range(t):
	data.append(list(map(int, input().split())))
for i in data:
	print(pens_and_pencils(i))


t = int(input())
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	if a % c == 0:
		pn = a // c
	else:
		pn = a // c + 1
	if b % d == 0:
		pc = b // d
	else:
		pc = b // d + 1
	if pn + pc <= k:
		print(str(pn) + ' ' + str(pc))
	else:
		print(-1)


from sys import stdin, stdout
from collections import Counter

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
from math import ceil
t = ip()
for i in range(t):
	(a, b, c, d, k) = ei()
	(x, y) = (ceil(a / c), ceil(b / d))
	ans = x + y
	if ans <= k:
		print(x, y)
	else:
		print(-1)


import math
n = int(input())
for i in range(n):
	(a, b, c, d, e) = [int(s) for s in input().split()]
	if a / c > 1:
		c1 = math.ceil(a / c)
	elif a == 0:
		c1 = 0
	else:
		c1 = 1
	if b / d > 1:
		d1 = math.ceil(b / d)
	elif b == 0:
		d1 = 0
	else:
		d1 = 1
	if c1 + d1 > e:
		print(-1)
	else:
		print(c1, d1)


import math as m
t = int(input())
a = []
for i in range(t):
	a.append(input())
for i in a:
	(a, b, c, d, k) = map(int, i.split(' '))
	s1 = m.ceil(a / c)
	s2 = m.ceil(b / d)
	if s1 + s2 > k:
		print(-1)
	else:
		print(s1, s2)


import math

def input_int():
	return list(map(int, input().split()))

def solve():
	[lecture, practical, per_pen, per_pencil, pencil_case] = input_int()
	pen = math.ceil(lecture / per_pen)
	pencil = math.ceil(practical / per_pencil)
	if pen + pencil > pencil_case:
		print(-1)
	else:
		print(pen, pencil)
[q] = input_int()
while q > 0:
	q -= 1
	solve()


import math
t = int(input())
for _ in range(t):
	args = [int(x) for x in input().split(' ')]
	a = args[0]
	b = args[1]
	c = args[2]
	d = args[3]
	k = args[4]
	if math.ceil(a / c) + math.ceil(b / d) > k:
		print('-1')
	else:
		print(str(math.ceil(a / c)) + ' ' + str(math.ceil(b / d)))


import math
t = int(input())
a = []
b = []
c = []
d = []
e = []
for i in range(t):
	line = input().split()
	a.append(int(line[0]))
	b.append(int(line[1]))
	c.append(int(line[2]))
	d.append(int(line[3]))
	e.append(int(line[4]))
for i in range(t):
	pens = int(math.ceil(a[i] / c[i]))
	pencils = int(math.ceil(b[i] / d[i]))
	if pens + pencils > e[i]:
		print(-1)
	else:
		print(pens, end=' ')
		print(pencils)


for itr in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	if a % c == 0:
		pen = a // c
	else:
		pen = a // c + 1
	if b % d == 0:
		pencil = b // d
	else:
		pencil = b // d + 1
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


import sys
import itertools
import math
import collections
from collections import Counter

def pow(x, y, mod):
	r = 1
	x = x % mod
	while y > 0:
		if y & 1:
			r = r * x % mod
		y = y >> 1
		x = x * x % mod
	return r

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
t = ii()
for _ in range(t):
	(a, b, c, d, k) = mi()
	t = cdiv(a, c)
	r = cdiv(b, d)
	print(t, r) if t + r <= k else print(-1)


import math
n = int(input())
for i in range(n):
	arr = input().split(' ')
	a = int(arr[0])
	b = int(arr[1])
	c = int(arr[2])
	d = int(arr[3])
	k = int(arr[4])
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y <= k:
		print(x, y)
	else:
		print(-1)


def solve():
	(a, b, c, d, k) = map(int, input().split())
	for x in range(k + 1):
		y = k - x
		if x * c >= a and y * d >= b:
			print(x, y)
			return
	print(-1)

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


from math import ceil
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	temp1 = ceil(a / c)
	temp2 = ceil(b / d)
	if temp1 + temp2 > k:
		print(-1)
	else:
		print(temp1, temp2)


for i in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	if a % c == 0:
		p = a // c
	else:
		p = a // c + 1
	if b % d == 0:
		q = b // d
	else:
		q = b // d + 1
	if p + q <= e:
		print(p, q)
	else:
		print(-1)


import math
x = int(input())
for i in range(1, x + 1):
	f = input()
	(lect, pract, pen, penc, maxc) = f.split()
	lect = int(lect)
	pract = int(pract)
	pen = int(pen)
	penc = int(penc)
	maxc = int(maxc)
	numpenc = math.ceil(pract / penc)
	numpen = math.ceil(lect / pen)
	if numpen + numpenc <= maxc:
		print(numpen, numpenc)
	else:
		print(-1)


import math
t = int(input())
outputs = []
for i in range(t):
	ip = input().split()
	a = int(ip[0])
	b = int(ip[1])
	c = int(ip[2])
	d = int(ip[3])
	k = int(ip[4])
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		outputs.append('-1')
	else:
		outputs.append('%i  %i' % (x, y))
for i in outputs:
	print(i)


import sys

def solution(a, b, c, d, k):
	black = a // c
	if a % c != 0:
		black += 1
	red = b // d
	if b % d != 0:
		red += 1
	if black + red > k:
		print(-1)
	else:
		print('%i %i' % (black, red))
t = sys.stdin.readline().split()[0]
t = int(t)
for i in range(t):
	(a, b, c, d, k) = sys.stdin.readline().split()
	solution(int(a), int(b), int(c), int(d), int(k))


import sys, math
Ncase = int(sys.stdin.readline().strip())
for i in range(Ncase):
	(a, b, c, d, k) = sys.stdin.readline().strip().split(' ')
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	k = int(k)
	n = math.ceil(a / c) + math.ceil(b / d)
	if n <= k:
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)


from math import *
q = int(input())
for y in range(q):
	(a, b, c, d, n) = map(int, input().split())
	m1 = ceil(a / c)
	m2 = ceil(b / d)
	if m1 + m2 <= n:
		print(m1, m2)
	else:
		print(-1)


import sys
import math
CASE = 1
rla = ''

def solve():
	(n, m, a, b, k) = map(int, input().split())
	(x, y) = map(int, '0 0'.split())
	while n > 0:
		n -= a
		x += 1
	while m > 0:
		m -= b
		y += 1
	print(x, y) if x + y <= k else print(-1)
while True:
	rla = sys.stdin.readline()
	cases = 1
	if not rla:
		break
	if (rla == '\n') | (rla == ''):
		continue
	if CASE == 1:
		cases = int(rla)
	for cas in range(cases):
		solve()


from math import ceil
n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	r = (0 - -a // c, 0 - -b // d)
	print(*(r, [-1])[sum(r) > k])


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	t1 = a // c
	if a % c != 0:
		t1 += 1
	t2 = k - t1
	t3 = t2 * d
	if t3 >= b:
		print(t1, t2)
	else:
		print(-1)


import math
t = int(input())
s = []
for i in range(t):
	s.append(list(map(int, input().split())))
for j in range(t):
	a = s[j][0]
	b = s[j][1]
	c = s[j][2]
	d = s[j][3]
	k = s[j][4]
	pen = 1
	penc = 1
	if c < a:
		pen = math.ceil(a / c)
	if d < b:
		penc = math.ceil(b / d)
	if pen + penc > k:
		print(-1)
	else:
		print(str(pen) + ' ' + str(penc))


import math
t = int(input())
for case in range(t):
	(a, b, c, d, k) = [int(s) for s in input().split(' ')]
	if math.ceil(a / c) + math.ceil(b / d) > k:
		print(-1)
	else:
		print(math.ceil(a / c), math.ceil(b / d))


import sys, math

def input():
	return sys.stdin.readline()[:-1]

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c, d, k) = map(int, input().split())
		if math.ceil(a / c) + math.ceil(b / d) <= k:
			print(math.ceil(a / c), math.ceil(b / d))
		else:
			print(-1)
main()


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		ans1 = a // c
	else:
		ans1 = a // c + 1
	if b % d == 0:
		ans2 = b // d
	else:
		ans2 = b // d + 1
	if ans1 + ans2 > k:
		print(-1)
	else:
		print(ans1, ans2)


import math

class univer:

	def __init__(self, FullHouse):
		self.FullHouse = FullHouse

	def result(self):
		q = FullHouse[0] % FullHouse[2]
		q1 = FullHouse[1] % FullHouse[3]
		ans1 = 0
		ans2 = 0
		if q == 0:
			ans1 = ans1 + math.ceil(FullHouse[0] / FullHouse[2])
		else:
			ans1 = ans1 + math.ceil((FullHouse[0] - q) / FullHouse[2])
			ans1 = ans1 + 1
		if q1 == 0:
			ans2 = ans2 + math.ceil(FullHouse[1] / FullHouse[3])
		else:
			ans2 = ans2 + math.ceil((FullHouse[1] - q1) / FullHouse[3])
			ans2 = ans2 + 1
		if ans1 + ans2 > FullHouse[4]:
			return (-1, -1)
		else:
			return (ans1, ans2)
t = int(input())
result = list(range(t))
result1 = list(range(t))
for i in range(t):
	FullHouse = [int(x) for x in input().split(' ')]
	q = univer(FullHouse)
	(result[i], result1[i]) = q.result()
for i in range(t):
	if result[i] == -1:
		print(-1)
	else:
		print(result[i], result1[i])


n = int(input())
ans = []
for i in range(0, n):
	s = input()
	data = s.split()
	(a, b, c, d, k) = (int(data[0]), int(data[1]), int(data[2]), int(data[3]), int(data[4]))
	pen = a // c
	if pen != a / c:
		pen += 1
	pencil = b // d
	if pencil != b / d:
		pencil += 1
	if pen + pencil > k:
		ans.append(-1)
	else:
		ans.append((pen, pencil))
for k in ans:
	if isinstance(k, tuple):
		print(k[0], k[1])
	else:
		print(k)


for m in range(int(input())):
	abcdk = list(map(int, input().split()))
	if abcdk[0] % abcdk[2] == 0:
		pens = abcdk[0] // abcdk[2]
	else:
		pens = abcdk[0] // abcdk[2] + 1
	if abcdk[1] % abcdk[3] == 0:
		pencils = abcdk[1] // abcdk[3]
	else:
		pencils = abcdk[1] // abcdk[3] + 1
	if pencils + pens <= abcdk[4]:
		print(pens, pencils)
	else:
		print(-1)


t = int(input())
while t != 0:
	(a, b, c, d, k) = map(int, input().split())
	q = 0
	w = 0
	if a % c == 0:
		q += a // c
	else:
		q += a // c + 1
	if b % d == 0:
		w += b // d
	else:
		w += b // d + 1
	if q + w <= k:
		print(q, w)
	else:
		print('-1')
	t -= 1


for i in range(int(input())):
	a = [int(i) for i in input().split()]
	if (a[0] - 1) // a[2] + (a[1] - 1) // a[3] <= a[4] - 2:
		print((a[0] - 1) // a[2] + 1, (a[1] - 1) // a[3] + 1)
	else:
		print(-1)


n = int(input())
for i in range(n):
	vet = input().split()
	a = int(vet[0])
	b = int(vet[1])
	c = int(vet[2])
	d = int(vet[3])
	k = int(vet[4])
	x = int(a / c)
	if a % c != 0:
		x = x + 1
	y = int(b / d)
	if b % d != 0:
		y = y + 1
	if x + y <= k:
		x = x + (k - x - y)
		print(int(x), int(y))
	else:
		print(-1)


tests = int(input())
for _ in range(tests):
	(a, b, c, d, k) = list(map(int, input().split()))
	t1 = 1
	t2 = 1
	while c * t1 < a:
		t1 += 1
	while d * t2 < b:
		t2 += 1
	if t1 + t2 <= k:
		print(t1, t2)
	else:
		print(-1)


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split(' '))
	v = math.ceil(a / c)
	v2 = math.ceil(b / d)
	if v + v2 > k:
		print(-1)
	else:
		print(v, v2)


n = int(input())
for r in range(n):
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	c = arr[2]
	d = arr[3]
	k = arr[4]
	if a % c == 0:
		x = int(a / c)
	else:
		x = int(a / c + 1)
	if b % d == 0:
		y = int(b / d)
	else:
		y = int(b / d + 1)
	if x + y <= k:
		print(x, end=' ')
		print(y)
	else:
		print('-1')


nLoops = int(input())

def ceil(n):
	if int(n) < n:
		return int(n) + 1
	return int(n)
for i in range(nLoops):
	(a, b, c, d, k) = (int(i) for i in input().split())
	ac = ceil(a / c)
	bd = ceil(b / d)
	if ac + bd <= k:
		print('{} {}'.format(ac, bd))
	else:
		print(-1)


def polycarp(lst):
	a = lst[0]
	b = lst[1]
	c = lst[2]
	d = lst[3]
	k = lst[4]
	m = a // c
	if a % c != 0:
		m += 1
	n = b // d
	if b % d != 0:
		n += 1
	if m + n > k:
		print(-1)
		return -1
	elif m + n == k:
		print(m, n)
		return (m, n)
	elif m + n < k:
		print(m, n)
		return (m, n)
l = []
n = int(input())
ln = []
for i in range(1, n + 1):
	ln = list(map(int, input().split()))
	l.append(ln)
for i in range(0, len(l)):
	polycarp(l[i])


tcases = int(input())

def min_quan(clss, max_clss):
	check = clss % max_clss
	if check == 0:
		min_eqp = clss // max_clss
	else:
		min_eqp = clss // max_clss + 1
	return min_eqp
for l1 in range(tcases):
	(lecs, pracs, pen_lec, penc_prac, space) = map(int, input().split())
	min_pens = min_quan(lecs, pen_lec)
	min_pencils = min_quan(pracs, penc_prac)
	total = min_pencils + min_pens
	if total > space:
		print(-1)
	else:
		print(min_pens, min_pencils)


import math
T = int(input())
while T:
	(a, b, c, d, k) = list(map(int, input().split()))
	if math.ceil(a / c) + math.ceil(b / d) <= k:
		print(math.ceil(a / c), math.ceil(b / d))
	else:
		print(-1)
	T -= 1


for i in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	resa = (a + c - 1) // c
	resb = (b + d - 1) // d
	if resa + resb > e:
		print(-1)
	else:
		print(resa, resb)


n = int(input())
for i in range(n):
	(a, b, c, d, k) = map(int, input().split())
	print(-1 if (a + (c - 1)) // c + (b + (d - 1)) // d > k else ' '.join((str((a + (c - 1)) // c), str((b + (d - 1)) // d))))


t = int(input())
result = []
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	pens = a // c
	if a % c != 0:
		pens += 1
	pencils = b // d
	if b % d != 0:
		pencils += 1
	if pencils + pens <= k:
		result.append([pens, pencils])
	else:
		result.append([-1])
for i in range(t):
	print(*result[i])


import math
n = int(input())
ans = []
for i in range(n):
	ls = list(map(int, input().split()))
	a = math.ceil(ls[0] / ls[2])
	b = math.ceil(ls[1] / ls[3])
	if a + b > ls[4]:
		ans.append(-1)
	else:
		ans.append(a)
		ans.append(b)
i = 0
while i < len(ans):
	if ans[i] == -1:
		print(ans[i])
		i = i + 1
	else:
		print(ans[i], end=' ')
		print(ans[i + 1])
		i = i + 2


import os
import sys
from io import BytesIO, IOBase
from math import ceil

def solution(a, b, c, d, k):
	if ceil(a / c) + ceil(b / d) <= k:
		write(ceil(a / c), ceil(b / d))
	else:
		write(-1)

def main():
	for _ in range(r_int()):
		(a, b, c, d, k) = r_array()
		solution(a, b, c, d, k)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


n = int(input())
for i in range(n):
	(a, b, c, d, k) = list(map(int, input().split()))
	if a % c != 0:
		ans1 = a // c + 1
	else:
		ans1 = a // c
	if b % d != 0:
		ans2 = b // d + 1
	else:
		ans2 = b // d
	if ans1 + ans2 <= k:
		print(ans1, ans2)
	else:
		print(-1)


for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	cnt = 0
	pens = 0
	pencil = 0
	if a % c != 0:
		cnt += a // c + 1
		pens += a // c + 1
	else:
		cnt += a // c
		pens += a // c
	if b % d != 0:
		cnt += b // d + 1
		pencil = b // d + 1
	else:
		cnt += b // d
		pencil = b // d
	if cnt > k:
		print(-1)
	else:
		print(pens, ' ', pencil)


import math as m
t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	ans1 = m.ceil(a / c)
	ans2 = m.ceil(b / d)
	z = ans1 + ans2
	if z <= k:
		print(ans1, ans2)
	else:
		print(-1)


t = int(input())
m = 0
while m < t:
	l = list(map(int, input().split()))
	p = 0
	q = 0
	if l[2] >= l[0]:
		p = 1
	else:
		k = 2
		while l[2] * k < l[0]:
			k = k + 1
		p = k
	if l[3] >= l[1]:
		q = 1
	else:
		k = 2
		while l[3] * k < l[1]:
			k = k + 1
		q = k
	if p + q <= l[4]:
		print(str(p) + ' ' + str(q))
	else:
		print(-1)
	m = m + 1


import math
t = int(input())
while t != 0:
	t -= 1
	(a, b, c, d, k) = [int(i) for i in input().split()]
	a1 = math.ceil(a / c)
	b1 = math.ceil(b / d)
	if a1 + b1 <= k:
		print(a1, b1, sep=' ')
	else:
		print(-1)


def main():
	(a, b, c, d, k) = map(int, input().split())
	if a % c == 0:
		pens = a // c
	else:
		pens = a // c + 1
	if b % d == 0:
		pencils = b // d
	else:
		pencils = b // d + 1
	if pens + pencils <= k:
		print(pens, pencils)
	else:
		print('-1')
for _ in range(int(input())):
	main()


import sys, math
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	q = math.ceil(a / c)
	w = math.ceil(b / d)
	if q + w > k:
		print(-1)
	else:
		print(q, w)


t = int(input())
for i in range(t):
	(a, b, c, d, k) = map(int, input().split())
	num = a // c + (a % c != 0)
	num2 = b // d + (b % d != 0)
	if num + num2 > k:
		print(-1)
	else:
		print(num, num2)


import math
t = int(input())
output = ''

def main(x, y):
	if y >= x:
		answer = 1
	else:
		answer = math.ceil(x / y)
	return answer
for _ in range(t):
	line = input()
	(a, b, c, d, k) = [int(i) for i in line.split(' ')]
	(x, y) = (main(a, c), main(b, d))
	if x + y <= k:
		output += f'{x} {y}\n'
	else:
		output += '-1\n'
print(output)


t = int(input())
javab_pen = []
javab_pencil = []
for i in range(t):
	(a, b, c, d, k) = [int(x) for x in input().split()]
	if a % c != 0:
		javab_pen.append(a // c + 1)
	else:
		javab_pen.append(a // c)
	if b % d != 0:
		javab_pencil.append(b // d + 1)
	else:
		javab_pencil.append(b // d)
	if javab_pen[i] + javab_pencil[i] > k:
		javab_pen[i] = -1
for i in range(t):
	if javab_pen[i] == -1:
		print(-1)
		continue
	print(javab_pen[i], javab_pencil[i])


import sys, math, queue, collections
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
for _ in range(int(input())):
	(a, b, c, d, k) = map(int, input().split())
	(p, q) = (math.ceil(a / c), math.ceil(b / d))
	if p + q <= k:
		print(p, q)
	else:
		print(-1)


import sys
import math
t = int(input())
for i in range(t):
	(a, b, c, d, e) = map(int, input().split())
	k = a // c
	if a % c != 0:
		k = k + 1
	l = b // d
	if b % d != 0:
		l = l + 1
	if l + k != e and l + k < e:
		h = e - l - k
		k = k + h
		print(k, l)
	elif l + k == e:
		print(k, l)
	elif l + k > e:
		print(-1)


t = input()
for i in range(int(t)):
	k = input()
	lis = k.split(' ')
	pen = int(int(lis[0]) / int(lis[2]) + 0.999)
	pencil = int(int(lis[1]) / int(lis[3]) + 0.999)
	if pen + pencil > int(lis[4]):
		print('-1')
	else:
		print(str(pen) + ' ' + str(pencil))


from sys import stdin
from math import ceil
I = lambda : map(int, input().split())
Input = stdin.readline
for i in range(int(input())):
	(a, b, c, d, k) = I()
	(x, y) = (ceil(a / c), ceil(b / d))
	print(*((x, y), (-1,))[x + y > k])


kol = int(input())
for i in range(kol):
	(l, p, le, pe, pi) = map(int, input().split())
	r = 0
	k = 0
	r = l / le
	if l % le != 0:
		r += 1
	k = p / pe
	if p % pe != 0:
		k += 1
	(r, k) = (int(r), int(k))
	if r + k <= pi:
		print(pi - int(k), int(k))
	else:
		print(-1)


from math import *
for _ in range(int(input())):
	(a, b, c, d, k) = list(map(int, input().split()))
	p = ceil(a / c)
	q = ceil(b / d)
	if p + q <= k:
		print(p, q)
	else:
		print(-1)


from sys import stdin
from math import ceil
case = int(stdin.readline())
for x in range(case):
	(a, b, c, d, k) = tuple(map(int, stdin.readline().split()))
	pen = ceil(a / c)
	pencil = ceil(b / d)
	if pen + pencil > k:
		print(-1)
	else:
		print(pen, pencil)


def get(a, b, c, d, k):
	x = a // c + bool(a % c)
	y = b // d + bool(b % d)
	if x + y <= k:
		print(x, y, sep=' ')
	else:
		print(-1)
for i in range(int(input())):
	get(*map(int, input().split()))


for x in range(int(input())):
	l = [int(x) for x in input().split()]
	(a, b) = (0, 0)
	if l[0] % l[2] == 0:
		a = l[0] // l[2]
	else:
		a = l[0] // l[2] + 1
	if l[1] % l[3] == 0:
		b = l[1] // l[3]
	else:
		b = l[1] // l[3] + 1
	if a + b <= l[4]:
		print(a, b)
	else:
		print(-1)


import math
t = int(input())

def solve():
	(a, b, c, d, k) = [int(x) for x in input().split()]
	x = math.ceil(a / c)
	y = math.ceil(b / d)
	if x + y > k:
		return '-1'
	else:
		return '%s %s' % (x, y)
for i in range(t):
	print(solve())


import math

def pen(a, b, c, d, k):
	p = math.ceil(a / c)
	p1 = math.ceil(b / d)
	if p + p1 > k:
		return -1
	else:
		t = (k - p1, p1)
		return ' '.join((str(i) for i in t))
set = int(input())
while set > 0:
	l = input().split(' ')
	(a, b, c, d, k) = (int(l[0]), int(l[1]), int(l[2]), int(l[3]), int(l[4]))
	set -= 1
	print(pen(a, b, c, d, k))