There are 10 problems in a contest. You know that the score of each problem is either 1 or 100 points.

Chef came to know the total score of a participant and he is wondering how many problems were actually solved by that participant.

Given the total score P of the participant, determine the number of problems solved by the participant. Print -1 in case the score is invalid.

------ Input Format ------ 

- First line will contain T, number of test cases. Then the test cases follow.
- Each test case contains of a single line containing a single integer P - denoting the number of points scored by the participant.

------ Output Format ------ 

For each testcase, output the number of problems solved by the participant or -1 if the score is invalid.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$0 ≤ P ≤ 1000$

----- Sample Input 1 ------ 
5
103
0
6
142
1000

----- Sample Output 1 ------ 
4
0
6
-1
10

----- explanation 1 ------ 
Test Case $1$: The participant has solved $4$ problems out of which $3$ problems are worth $1$ point each while $1$ problem is worth $100$ points.

Test Case $2$: Since participant's score is $0$, he solved $0$ problems.

Test Case $3$: The participant has solved $6$ problems out of which all the problems are worth $1$ point.

Test Case $4$: It is not possible to get a score of $142$.

Test Case $5$: The participant solved all the $10$ problems and score of all the problems is $100$.

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	n = int(input())
	r = n % 100 + n // 100
	if r <= 10:
		print(r)
	else:
		print('-1')


T = int(input())
for i in range(0, T):
	P = int(input())
	a = P // 100
	if a + (P - 100 * a) > 10:
		print(-1)
	else:
		print(a + (P - 100 * a))


t = int(input())
for i in range(t):
	p = int(input())
	if p % 100 == 0 and p // 100 <= 10:
		print(p // 100)
	else:
		temp = p % 100
		p = p - temp
		div = p // 100
		print(div + temp if div + temp <= 10 else '-1')


t = int(input())
tp = 10
for i in range(t):
	p = int(input())
	if p % 100 == 0:
		print(p // 100)
	elif p < 10:
		print(p)
	elif p % 100 != 0:
		a = p // 100 + p % 100
		if a <= 10:
			print(a)
		else:
			print('-1')


t = int(input())
for i in range(t):
	a = int(input())
	r = a % 100 + a // 100
	if r <= 10:
		print(r)
	else:
		print('-1')


T = int(input())
for i in range(0, T):
	p = int(input())
	temp = p // 100
	temp2 = p % 100
	if temp + temp2 > 10:
		print('-1')
	else:
		print(temp + temp2)


for k in range(int(input())):
	p = int(input())
	p = p // 100 + p % 100
	if p <= 10:
		print(p)
	else:
		print(-1)


n = int(input())
for i in range(n):
	a = int(input())
	b = int(a / 100) + a % 100
	if b <= 10:
		print(b)
	else:
		print('-1')


for _ in range(int(input())):
	points = int(input())
	solutions = points // 100 + points % 100
	if solutions > 10:
		print(-1)
	else:
		print(solutions)


t = int(input())
for i in range(t):
	p = int(input())
	if p <= 1000 and p >= 0:
		a = int(p / 100)
		b = p % 100
		if a + b <= 10:
			print(a + b)
		else:
			print('-1')
	else:
		print('-1')


for i in range(int(input())):
	n = int(input())
	w = n % 100 + n // 100
	if w <= 10:
		print(w)
	else:
		print('-1')


t = int(input())
for _ in range(t):
	p = int(input())
	results = p // 100 + p % 100 // 1
	if results > 10:
		print(-1)
	else:
		print(results)


for i in range(int(input())):
	x = int(input())
	if x // 100 + x % 100 <= 10:
		print(x // 100 + x % 100)
	else:
		print(-1)


t = int(input())
for i in range(t):
	p = int(input())
	b = p % 100
	c = p // 100
	if b + c <= 10:
		print(b + c)
	else:
		print('-1')


t = int(input())
for i in range(t):
	p = int(input())
	if p <= 10:
		print(p)
	elif p % 100 + p // 100 <= 10:
		print(p % 100 + p // 100)
	else:
		print(-1)


for i in range(int(input())):
	p = int(input())
	s = p % 100 + p // 100
	if s <= 10:
		print(s)
	else:
		print(-1)


for i in range(int(input())):
	a = int(input())
	c = 0
	if a <= 10:
		print(a)
	elif a == 1000:
		print('10')
	else:
		c += a // 100
		if 10 - c >= a % 100:
			print(c + a % 100)
		else:
			print('-1')


a = 0
for i in range(int(input())):
	x = int(input())
	if x > 100 or x % 100 in range(0, 11):
		a = x % 100
		b = x // 100
		if a + b <= 10:
			print(a + b)
		else:
			print(-1)
	else:
		print(-1)


t = int(input())
for i in range(0, t):
	n = int(input())
	ans = n // 100 + n % 100
	if ans >= 0 and ans <= 10:
		print(ans)
	else:
		print(-1)


def ac(p):
	n = p % 100 + p // 100
	if n <= 10:
		return n
	else:
		return '-1'
t = int(input())
for i in range(t):
	p = int(input())
	v = ac(p)
	print(v)


for i in range(int(input())):
	a = int(input())
	d = a // 100
	a = a - d * 100
	if a + d > 10:
		print('-1')
	else:
		print(a + d)


t = int(input())
for i in range(t):
	n = int(input())
	d = n // 100
	c = n // 1 - d * 100
	if c + d <= 10:
		print(c + d)
	else:
		print(-1)


for i in range(int(input())):
	p = int(input())
	if p <= 1000:
		s1 = p // 100
		s2 = p % 100
		if s1 + s2 <= 10:
			print(s1 + s2)
		else:
			print('-1')


import math
for _ in range(int(input())):
	p = int(input())
	p1 = p % 100 + p // 100
	if p1 <= 10:
		print(p1)
	else:
		print(-1)


t = int(input())
for i in range(t):
	p = int(input())
	w = p % 100
	n_w = (p - w) / 100
	n_sol = int(w + n_w)
	if n_sol <= 10:
		print(n_sol)
	else:
		print(-1)


for _ in range(int(input())):
	a = int(input())
	c = a // 100 + a % 100
	if c > 10:
		print(-1)
	else:
		print(c)


t = int(input())
for i in range(t):
	num = int(input())
	if num // 100 + num % 100 <= 10:
		print(num // 100 + num % 100)
	else:
		print(-1)


for t in range(int(input())):
	n = int(input())
	total = 0
	total += n // 100
	n = n % 100
	total += n // 1
	n = n % 1
	if total <= 10:
		print(total)
	else:
		print(-1)


for t in range(int(input())):
	n = int(input())
	s = n // 100 + n % 100
	if s <= 10:
		print(s)
	else:
		print('-1')


t = int(input())
for i in range(t):
	c = 0
	n = int(input())
	x = n // 100
	y = n % 100
	if x + y <= 10:
		print(x + y)
	else:
		print('-1')


T = int(input())
for _ in range(T):
	P = int(input())
	if P % 100 + P // 100 <= 10:
		print(P // 100 + P % 100)
	else:
		print(-1)


n = int(input())
for i in range(n):
	a = int(input())
	p = a % 100
	points = a // 100 + p // 1
	if points > 10:
		print('-1')
	else:
		print(points)


a = int(input())
for i in range(a):
	b = int(input())
	if b >= 0 and b <= 10:
		print(b)
	elif b > 10:
		c = b / 100
		e = int(c)
		d = 100 * e
		f = 10 - e
		g = b - d
		if b == d:
			print(e)
		elif g > f:
			print(-1)
		else:
			print(e + g)


t = int(input())
for i in range(t):
	p = int(input())
	count = 0
	if p % 100 == 0:
		count = p // 100
	else:
		count = p // 100 + p % 100
	if count <= 10:
		print(count)
	else:
		print(-1)


for _ in range(int(input())):
	a = int(input())
	res = a // 100 + a % 100
	v = res if res <= 10 else -1
	print(v)


t = int(input())
for i in range(t):
	N = int(input())
	count = 0
	if N == 0:
		print(0)
	else:
		y = N // 100
		count = count + y
		z = N - 100 * y
		count = count + z
		if 1 <= count <= 10:
			print(count)
		else:
			print(-1)


for test_case in range(int(input())):
	p = int(input())
	solved = p // 100 + p % 100
	if solved <= 10:
		print(solved)
	else:
		print('-1')


T = int(input())
while T:
	s = 0
	n = int(input())
	s += n // 100
	n = n - 100 * s
	s += n
	if s > 10:
		print(-1)
	else:
		print(s)
	T -= 1