import sys
count = int(input())
for i in range(count):
H, W, N = list(map(lambda a: int(a), sys.stdin.readline().strip().split()))
yy = 0
xx = 0
if N % H == 0:
# print(H, end='')
yy = H*100
# print(N//H)
xx = N//H
else:
# print(N % H, end='')
yy = N%H * 100
xx = 1+N//H
print(yy+xx)
t = int(input())
for i in range(t):
h, w, n = map(int, input().split())
f = 0
ho = 0
if n % h == 0:
f = h * 100
ho = n // h
else:
f = (n % h) * 100
ho = 1 + n // h
print(f + ho)