You have an initially empty cauldron, and you want to brew a potion in it. The potion consists of two ingredients: magic essence and water. The potion you want to brew should contain exactly $k\ \%$ magic essence and $(100 - k)\ \%$ water.

In one step, you can pour either one liter of magic essence or one liter of water into the cauldron. What is the minimum number of steps to brew a potion? You don't care about the total volume of the potion, only about the ratio between magic essence and water in it.

A small reminder: if you pour $e$ liters of essence and $w$ liters of water ($e + w > 0$) into the cauldron, then it contains $\frac{e}{e + w} \cdot 100\ \%$ (without rounding) magic essence and $\frac{w}{e + w} \cdot 100\ \%$ water.


-----Input-----

The first line contains the single $t$ ($1 \le t \le 100$) — the number of test cases.

The first and only line of each test case contains a single integer $k$ ($1 \le k \le 100$) — the percentage of essence in a good potion.


-----Output-----

For each test case, print the minimum number of steps to brew a good potion. It can be proved that it's always possible to achieve it in a finite number of steps.


-----Examples-----

Input
3
3
100
25
Output
100
1
4


-----Note-----

In the first test case, you should pour $3$ liters of magic essence and $97$ liters of water into the cauldron to get a potion with $3\ \%$ of magic essence.

In the second test case, you can pour only $1$ liter of essence to get a potion with $100\ \%$ of magic essence.

In the third test case, you can pour $1$ liter of magic essence and $3$ liters of water.

Source: codeforces | Difficulty: EASY
Tags: Number theory

Mathematics


Solutions:
from math import gcd

def answer(x, y):
	d = gcd(x, y)
	x = x // d
	y = y // d
	print(x + y)
t = int(input())
for w in range(t):
	p = int(input())
	q = 100 - p
	answer(p, q)


t = int(input())
for t in range(t):
	k = int(input())
	x = []
	for i in range(1, k + 1):
		if k % i == 0 and (100 - k) % i == 0:
			x.append(k / i + (100 - k) / i)
	print(int(min(x)))


from math import gcd
answers = []
for i in range(int(input())):
	k = int(input())
	k1 = 100 - k
	if k == 100:
		answers.append('1')
		continue
	f = gcd(k, k1)
	k /= f
	k1 /= f
	answers.append(str(int(k + k1)))
print('\n'.join(answers))


import math
g = math.gcd
for _ in range(int(input())):
	n = int(input())
	print(100 // g(n, 100))


a = int(input())
while a != 0:
	k = int(input())
	n = 100
	while n != k:
		if n > k:
			n -= k
		else:
			k -= n
	print(100 // k)
	a = a - 1


import math
for _ in range(int(input())):
	n = int(input())
	a = 100 - n
	if n == 100:
		print(1)
	else:
		k = math.gcd(n, 100 - n)
		if k != 1:
			a = a // k
			n = n // k
		print(a + n)


from math import gcd
for i in range(int(input())):
	n = int(input())
	a = gcd(n, 100)
	print(100 // a)


import math
t = int(input())
for i in range(t):
	k = int(input())
	w = 100 - k
	d = math.gcd(k, w)
	w //= d
	k //= d
	print(k + w)


def gcd(x, y):
	a = max(x, y)
	b = min(x, y)
	while True:
		z = min(a, a % b)
		a = b
		if z == 0:
			return b
		b = z
for i in range(int(input())):
	k = int(input())
	if k == 100:
		print(1)
		continue
	if k % (100 - k) == 0:
		print(1 + k // (100 - k))
	else:
		print((100 - k) // gcd(k, 100 - k) + k // gcd(k, 100 - k))


def gcd(a, b):
	if b > a:
		(a, b) = (b, a)
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
t = int(input())
while t > 0:
	k = int(input())
	x = 100 - k
	ans = k / gcd(k, x) + x / gcd(k, x)
	print(int(ans))
	t = t - 1


n = int(input())
for i in range(n):
	a = int(input())
	b = 100
	g = []
	c = []
	for y in range(1, 101):
		if b / y == b // y:
			g.append(y)
	for z in range(1, a + 1):
		if a / z == a // z:
			c.append(z)
	v = []
	for elem1 in g:
		for elem2 in c:
			if elem1 == elem2:
				v.append(elem1)
	h = max(v)
	print(100 // h)


import math
for _ in range(int(input())):
	k = int(input())
	print(100 // math.gcd(100, k))


t = int(input())
for i in range(t):
	a = int(input())
	for j in range(1, 100):
		e = j
		w = e * 100 / a - e
		if w.is_integer():
			break
	print(int(e + w))


import math
t = int(input())
for i in range(t):
	k = int(input())
	if math.gcd(k, 100 - k) == 1:
		print(100)
	elif k == 1:
		print(100)
	elif k == 100:
		print(1)
	else:
		print(100 // math.gcd(k, 100))


import math
t = int(input(''))
for i in range(t):
	n = int(input(''))
	d = 100 - n
	d = d // math.gcd(100, d)
	n = n // math.gcd(100, n)
	print(d + n)


t = int(input())
printing = []
for i in range(t):
	percentage = int(input())
	base = 100
	for number in range(100, 1, -1):
		if percentage % number == 0 and base % number == 0:
			percentage //= number
			base //= number
	printing.append(base)
for number in printing:
	print(number)


import math
for i in range(int(input())):
	k = int(input())
	print(100 // math.gcd(k, 100))


t = int(input())
for i in range(0, t):
	k = int(input())
	if k == 100:
		print(1)
	else:
		y = 1
		while True:
			if 100 * y % (100 - k) == 0:
				print(100 * y // (100 - k))
				break
			else:
				y += 1


print(*list(([0, 100, 50, 100, 25, 20, 50, 100, 25, 100, 10, 100, 25, 100, 50, 20, 25, 100, 50, 100, 5, 100, 50, 100, 25, 4, 50, 100, 25, 100, 10, 100, 25, 100, 50, 20, 25, 100, 50, 100, 5, 100, 50, 100, 25, 20, 50, 100, 25, 100, 2, 100, 25, 100, 50, 20, 25, 100, 50, 100, 5, 100, 50, 100, 25, 20, 50, 100, 25, 100, 10, 100, 25, 100, 50, 4, 25, 100, 50, 100, 5, 100, 50, 100, 25, 20, 50, 100, 25, 100, 10, 100, 25, 100, 50, 20, 25, 100, 50, 100, 1][int(input())] for i in range(int(input())))), sep='\n')


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
t = int(input())
for i in range(t):
	n = int(input())
	w = 100 - n
	e = n
	k = gcd(w, e)
	l = w // k
	m = e // k
	print(l + m)


import math
t = int(input())
for i in range(0, t, 1):
	n = int(input())
	if n == 100:
		print(1)
	else:
		l = math.gcd(n, 100 - n)
		c1 = n // l
		c2 = (100 - n) // l
		print(c1 + c2)


w = int(input())
for i in range(w):
	k = int(input())
	i = 1
	while i * 100 % k != 0:
		i += 1
	print(i * 100 // k)


from math import gcd
for i in range(int(input())):
	n = int(input())
	if n == 100:
		print(1)
	else:
		(x, y) = (n, 100 - n)
		d = gcd(x, y)
		x = x // d
		y = y // d
		print(x + y)


from math import gcd
t = int(input())
for _ in range(1, t + 1):
	n = int(input())
	print(100 // gcd(100, n))


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from decimal import *
from io import BytesIO, IOBase
from itertools import *
from collections import *
M = 10 ** 9 + 7
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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')

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

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynum(x, l, r, a):
	if x >= l and x <= r:
		a.append(x)
	if x > r:
		a.append(x)
		return a
	if x < 10000000000.0:
		luckynum(x * 10 + 4, l, r, a)
		luckynum(x * 10 + 7, l, r, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solven(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solven(p * 10 + a, l + 1, a, b, n)
	solven(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def print_factors(x):
	factors = []
	for i in range(1, x + 1):
		if x % i == 0:
			factors.append(i)
	return factors

def calc(X, d, ans, D):
	if len(X) == 0:
		return
	i = X.index(max(X))
	ans[D[max(X)]] = d
	Y = X[:i]
	Z = X[i + 1:]
	calc(Y, d + 1, ans, D)
	calc(Z, d + 1, ans, D)

def factorization(n, l):
	c = n
	if prime(n) == True:
		l.append(n)
		return l
	for i in range(2, c):
		if n == 1:
			break
		while n % i == 0:
			l.append(i)
			n = n // i
	return l

def good(b):
	l = []
	i = 0
	while len(b) != 0:
		if b[i] < b[len(b) - 1 - i]:
			l.append(b[i])
			b.remove(b[i])
		else:
			l.append(b[len(b) - 1 - i])
			b.remove(b[len(b) - 1 - i])
	if l == sorted(l):
		return True
	return False

def generate(st, s):
	if len(s) == 0:
		return
	if s not in st:
		st.add(s)
		for i in range(len(s)):
			t = list(s).copy()
			t.remove(s[i])
			t = ''.join(t)
			generate(st, t)
	return

def largestincreasingsubsequence(A):
	l = [1] * len(A)
	sub = []
	for i in range(1, len(l)):
		for k in range(i):
			if A[k] < A[i]:
				sub.append(l[k])
		l[i] = 1 + max(sub, default=0)
	return max(l, default=0)

def findOR(nums, N):
	prefix_sum = 0
	result = 0
	for i in range(N):
		result |= nums[i]
		prefix_sum += nums[i]
		result |= prefix_sum
	return result

def OR(a, n):
	ans = a[0]
	for i in range(1, n):
		ans |= a[i]
	return ans

def toString(List):
	return ''.join(List)
p = []

def permute(a, l, r):
	if l == r:
		p.append(toString(a))
	else:
		for i in range(l, r + 1):
			(a[l], a[i]) = (a[i], a[l])
			permute(a, l + 1, r)
			(a[l], a[i]) = (a[i], a[l])

def squareRoot(number, precision):
	start = 0
	(end, ans) = (number, 1)
	while start <= end:
		mid = int((start + end) / 2)
		if mid * mid == number:
			ans = mid
			break
		if mid * mid < number:
			start = mid + 1
		else:
			end = mid - 1
	increment = 0.1
	for i in range(0, precision):
		while ans * ans <= number:
			ans += increment
		ans = ans - increment
		increment = increment / 10
	return ans
import math

def main():
	for _ in range(int(input())):
		k = int(input())
		if k == 100:
			print(1)
		else:
			p = 100 - k
			s = math.gcd(k, p)
			k //= s
			p //= s
			print(k + p)
main()


import sys
input = sys.stdin.readline

def print(x, end='\n'):
	sys.stdout.write(str(x) + end)

def get_int():
	return int(input())

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

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

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

def print_iterable(p):
	print(' '.join(map(str, p)))
from math import gcd

def main():
	t = get_int()
	for i in range(t):
		k = get_int()
		if gcd(100, k) > 1:
			print(100 // gcd(100, k))
		elif k == 0:
			print(0)
		else:
			print(100)
main()


import math

def getgcd(x, y):
	return math.gcd(x, y)

def solve(n):
	t1 = 100 - n
	t2 = n
	gcd = getgcd(100, n)
	t1 = t1 // gcd
	t2 = t2 // gcd
	return t1 + t2
t = int(input())
for i in range(t):
	n = int(input())
	ans = solve(n)
	print(ans)


t = int(input())
for _ in range(t):
	k = int(input())
	e = 0
	w = 0
	p = 0
	cnt = 0
	while p != k:
		if p < k:
			e += 1
		else:
			w += 1
		p = e * 100 / (e + w)
		cnt += 1
	print(cnt)


def gcd(a, b):
	i = a % b
	if i != 0:
		while i != 0:
			a = b
			b = i
			i = a % b
			if i == 0:
				return b
	else:
		return b
n = int(input())
k = []
for i in range(n):
	x = int(input())
	k.append(x)
for i in k:
	print(100 // gcd(100, i))


T = int(input())
for t in range(T):
	k = int(input())
	(count, e, w, ep) = (0, 0, 0, 0)
	while ep != k:
		count += 1
		if ep < k:
			e += 1
		else:
			w += 1
		ep = e * 100 / (e + w)
	print(count)


from math import gcd
for kdj in range(int(input())):
	k = int(input())
	g = gcd(k, 100 - k)
	print(int(k / g + (100 - k) / g))


import math

def solve(k):
	print(100 // math.gcd(100, k))
t = int(input())
for i in range(t):
	k = int(input())
	solve(k)


import math

def solve(k):
	g = math.gcd(k, 100 - k)
	(e, w) = (k // g, (100 - k) // g)
	return e + w
T = int(input())
for t in range(T):
	k = int(input())
	print(solve(k))


def MaxCommDivisor(p, q):
	temp = p % q
	while temp != 0:
		p = q
		q = temp
		temp = p % q
	return q
t = int(input())
for i in range(0, t):
	x = int(input())
	y = MaxCommDivisor(x, 100)
	s = 100 // y
	print(s)


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
threading.stack_size(10 ** 8)
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(300000)
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')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	k = int(input())
	ans = 100 // int(math.gcd(k, 100))
	print(ans)


import math
t = int(input())
step = 0
e = 0
w = 0
for i in range(t):
	k = int(input())
	x = math.gcd(k, 100 - k)
	print(k // x + (100 - k) // x)


t = int(input())
for case in range(1, t + 1):
	k = int(input())
	gcd = 1
	denom = [2, 5]
	(tmp1, tmp2) = (k, 100 - k)
	while denom:
		if tmp1 % denom[0] == tmp2 % denom[0] == 0:
			gcd *= denom[0]
			tmp1 /= denom[0]
			tmp2 /= denom[0]
		else:
			denom.pop(0)
	ans = tmp1 + tmp2
	print(int(ans))


def gcd(a, b):
	if b == 0:
		return a
	if a % b == 0:
		return b
	if b % a == 0:
		return a
	if a % b != 0 and a > b:
		return gcd(a % b, b)
	if b % a != 0 and b > a:
		return gcd(a, b % a)
t = int(input())
for i in range(t):
	n = int(input())
	if 100 % n != 0:
		mid = gcd(n, 100)
		print(100 // mid)
	else:
		print(100 // n)


import sys
input = sys.stdin.readline
import math

def gcd(a, b):
	return gcd(b, a % b) if b else a

def solve():
	n = int(input())
	g = gcd(n, 100)
	x = 100 // g
	print(x)
for _ in range(int(input())):
	solve()


def get_gcd(a, b):
	while b:
		a = a % b
		(a, b) = (b, a)
	return a

def func():
	p = int(input())
	w = 100 - p
	g = get_gcd(p, w)
	r = p // g + w // g
	print(r)
t = int(input())
for _ in range(t):
	func()


from math import gcd

def func():
	t = int(input())
	for _ in range(t):
		k = int(input())
		print(100 // gcd(k, 100))
func()


from math import gcd
t = int(input())
for _ in range(t):
	k = int(input())
	g = gcd(k, 100)
	print(100 // g)


number = int(input())

def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x
for i in range(number):
	x = int(input())
	print(int(100 / gcd(x, 100)))


import math
s = []
for i in range(int(input())):
	k = int(input())
	if math.gcd(k, 100) == 1:
		s.append(100)
	else:
		s.append(100 // math.gcd(100, k))
for i in range(len(s)):
	print(s[i])


import math
for i in range(int(input())):
	n = int(input())
	a = 100 - n
	b = n
	if n == 100:
		print(1)
	else:
		g = math.gcd(a, b)
		print(a // g + b // g)


import math
t = int(input())
for i in range(t):
	x = int(input())
	y = math.gcd(x, 100)
	print(int(100 / y))


import math
t = int(input())
for _ in range(t):
	k = int(input())
	water = 100 - k
	g = math.gcd(k, water)
	ans1 = k // g
	ans2 = water // g
	print(ans1 + ans2)


try:
	import math
	for _ in range(int(input())):
		k = int(input())
		p = math.gcd(100, k)
		print(100 // p)
except EOFError:
	print(' ')


t = int(input())
k = []
for i in range(t):
	k.append(int(input()))
ans = []
for i in range(t):
	p = k[i]
	w = 100 - k[i]
	if p == 0 or p == 100:
		ans.append(1)
		continue
	while True:
		divFound = False
		for d in range(min(p, w), 1, -1):
			rp = p % d
			rw = w % d
			if rp == 0 and rw == 0:
				p = p // d
				w = w // d
				divFound = True
				break
		if not divFound:
			break
	ans.append(p + w)
for a in ans:
	print(a)


from sys import stdin
from math import gcd
lst = list(map(int, stdin.read().split()))
_s = 0

def inp(n=1):
	global _s
	ret = lst[_s:_s + n]
	_s += n
	return ret

def inp1():
	return inp()[0]
t = inp1()
for _ in range(t):
	k = inp1()
	w = 100 - k
	gd = gcd(k, w)
	print(k // gd + w // gd)


def gcd(x, y):
	if x % y == 0:
		return y
	else:
		return gcd(y, x % y)
for _ in range(int(input())):
	n = int(input())
	print(100 // gcd(n, 100))


import math
test = int(input())
for t in range(test):
	k = int(input())
	if 100 % k == 0:
		print(100 // k)
	else:
		(e, w) = (k, 100 - k)
		gcd = math.gcd(e, w)
		res = e // gcd + w // gcd
		print(res)


from math import gcd
t = int(input())
for _ in range(t):
	r = int(input())
	print(100 // gcd(100, r))


import sys
input = sys.stdin.readline

def solve():
	k = int(input())
	for i in range(1, k + 1):
		if 100 * i % k == 0:
			return 100 * i // k
for _ in range(int(input())):
	print(solve())


t = int(input())
for i in range(0, t):
	es = int(input())
	if es in [100]:
		print(1)
		continue
	water = 100 - es
	if es > water and es % water == 0:
		print(1 + es // water)
		continue
	if es <= water and water % es == 0:
		print(1 + water // es)
		continue
	num = min(water, es)
	for i in range(2, num):
		while es % i == 0 and water % i == 0:
			es = es // i
			water = water // i
	print(es + water)


def zip_sorted(a, b):
	return (zip(*sorted(zip(a, b)))[0], zip(*sorted(zip(a, b)))[1])

def gcd(a, b):
	return math.gcd(a, b)

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

def ncr(n, r):
	return math.comb(n, r)

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

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

def binary_to_decimal(s):
	return int(s, 2)
import sys, os.path
import math
from collections import defaultdict, deque
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
S = lambda : list(map(str, input()))

def main():
	(t,) = I()
	for t1 in range(t):
		(k,) = I()
		min1 = 10 ** 10
		for i in range(1, 201):
			for j in range(201):
				if 100 * i / (i + j) == k:
					min1 = min(min1, i + j)
		print(min1)
main()


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
for j in range(x):
	y = int(input())
	print(int(100 / gcd(100, y)))


from math import gcd
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 100:
		print(1)
		continue
	m = 100 - n
	g = int(gcd(m, n))
	n = n // g
	m = m // g
	print(m + n)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for i in range(t):
	k = int(input())
	if k == 100:
		print(1)
		continue
	e = 1
	while True:
		if e * (100 - k) % k == 0:
			print(e + e * (100 - k) // k)
			break
		e = e + 1


t = int(input())
for i in range(0, t):
	n = int(input())
	s = 100
	if 100 % n == 0:
		print(100 // n)
	else:
		while n % 2 == 0 and s % 2 == 0:
			n = n // 2
			s = s // 2
		while n % 5 == 0 and s % 5 == 0:
			n = n // 5
			s = s // 5
		print(s)


def coprime(a, b):
	if b == 0:
		return (1, b)
	if a % b == 0:
		(a, b) = (a // b, 1)
		return (a, b)
	for i in range(b // 2 + 1, 1, -1):
		if a % i == 0 and b % i == 0:
			(a, b) = (a // i, b // i)
	return (a, b)
t = int(input())
for _ in range(t):
	e = int(input())
	w = 100 - e
	print(sum(coprime(max(e, w), min(e, w))))


import math
for _ in range(int(input())):
	p = int(input())
	mk = 101
	for w in range(1, 100):
		ew = 100 * w / p
		if ew.is_integer():
			mk = min(mk, ew)
	print(int(mk))


def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	if b == 0:
		return a
	return gcd(b, a % b)
t = int(input())
while t:
	t -= 1
	k = int(input())
	(a, b) = (k, 100 - k)
	print(a // gcd(a, b) + b // gcd(a, b))


from sys import stdin, stdout
import math, bisect, heapq
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	print(' '.join(list(map(str, a))))

def solve():
	n = I()
	x = 100 - n
	d = math.gcd(x, n)
	print(x // d + n // d)
for _ in range(I()):
	solve()


for _ in range(int(input())):
	k = int(input())
	ans = 100
	while ans % k != 0:
		ans += 100
	print(ans // k)


import math
for _ in range(int(input())):
	k = int(input())
	l = 100 - k
	a = math.gcd(k, l)
	c1 = k // a
	c2 = l // a
	print(c1 + c2)


from math import gcd
n = int(input())

def steps(k):
	return int(100 / gcd(k, 100 - k))
for i in range(n):
	print(steps(int(input())))


from math import gcd
for t in range(int(input())):
	percent = int(input())
	g = gcd(100 - percent, percent)
	a = (100 - percent) // g + percent // g
	print(a)


x = int(input())
l = []
l1 = []
for i in range(x):
	l.append(int(input()))
for i in range(x):
	E = l[i]
	W = 100 - l[i]

	def gcd(x, y):
		m = min(x, y)
		while m >= 1:
			if x % m == 0 and y % m == 0:
				return m
				break
			else:
				m = m - 1
	if E != 100 and W != 100:
		e = E / int(gcd(E, W))
		w = W / int(gcd(E, W))
		l1.append(int(e + w))
	elif E == 0 or W == 0:
		l1.append(1)
for i in range(x):
	print(l1[i])


t = int(input())
k = []
for i in range(t):
	m = int(input())
	k.append(m)
steps = []
for i in range(t):
	magic = k[i]
	water = 100 - k[i]
	if magic == 0:
		water = 1
	elif water == 0:
		magic = 1
	elif magic < water:
		for j in range(magic, 1, -1):
			if magic % j == 0 and water % j == 0:
				magic = magic // j
				water = water // j
	else:
		for j in range(water, 1, -1):
			if magic % j == 0 and water % j == 0:
				magic = magic // j
				water = water // j
	s = magic + water
	steps.append(s)
	print(steps[i])


import math
t = int(input())
while t != 0:
	t = t - 1
	k = int(input())
	print(100 // math.gcd(100, k))


t = int(input())
for _ in range(t):
	k = int(input())
	a = 1
	for _ in range(2):
		if k % 2 == 0:
			k /= 2
			a *= 2
	for _ in range(2):
		if k % 5 == 0:
			k /= 5
			a *= 5
	if a == 1:
		print(100)
	elif a % 100 == 0:
		print(1)
	elif a % 50 == 0:
		print(2)
	elif a % 25 == 0:
		print(4)
	elif a % 20 == 0:
		print(5)
	elif a % 10 == 0:
		print(10)
	elif a % 5 == 0:
		print(20)
	elif a % 4 == 0:
		print(25)
	elif a % 2 == 0:
		print(50)
	elif a % 1 == 0:
		print(100)


def gcd(a, b):
	if a == 0:
		return b
	if b == 0:
		return a
	if a == b:
		return a
	if a > b:
		return gcd(a - b, b)
	return gcd(a, b - a)
n = int(input())
for i in range(n):
	a = int(input())
	print(100 // gcd(a, 100))


import math

def rdArr():
	return list(map(int, input().split()))
ar = [100, 50, 25, 20, 10, 5, 4, 2, 1]

def solve():
	k = int(input())
	for i in ar:
		if k % i == 0:
			break
	print(100 // i)
t = int(input())
for i in range(t):
	solve()


from math import gcd
for _ in range(int(input())):
	k = int(input())
	w = (100 - k) // gcd(100 - k, k)
	e = k // gcd(100 - k, k)
	print(w + e)


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
for _ in range(int(input())):
	a = int(input())
	b = 100 - a
	k = gcd(a, b)
	print(int(100 / k))


import math
t = int(input())
while t != 0:
	t = t - 1
	n = int(input())
	print(100 // math.gcd(100, n))


import sys
import math

def scan(input_type='int'):
	if input_type == 'int':
		return list(map(int, sys.stdin.readline().strip().split()))
	else:
		return list(map(str, sys.stdin.readline().strip()))

def solution():
	for _ in range(int(input())):
		k = int(input())
		if k == 1:
			print(100)
		else:
			b = 100
			for i in range(2, 101):
				while b % i == 0 and k % i == 0:
					b = b // i
					k = k // i
			print(b)
solution()


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
pr = lambda x: x

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

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

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])

def solve():
	for _ in range(int(input())):
		(k,) = aj()
		print(100 // math.gcd(k, 100))
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	from aj import *
except:
	pass
solve()


from fractions import Fraction
t = int(input())
while t > 0:
	k = int(input())
	a = Fraction(k) / Fraction(100)
	print(a.denominator)
	t -= 1


for i in range(int(input())):
	k = int(input())
	if 100 % k == 0:
		print(100 // k)
	else:
		for j in range(k - 1, 0, -1):
			if 100 % j == 0 and k % j == 0:
				print(100 // j)
				break


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

def main():
	t = int(input())
	allans = []
	for _ in range(t):
		k = int(input())
		x = 100 - k
		g = gcd(k, x)
		allans.append((k + x) // g)
	multiLineArrayPrint(allans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(i, j):
	print('? {} {}'.format(i, j))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(' '.join([str(x) for x in ans])))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
for _abc in range(1):
	main()


import math
for _ in range(int(input())):
	k = int(input())
	if k == 100 or k == 0:
		print(1)
	else:
		x = math.gcd(k, 100 - k)
		print(100 // x)


import math
t = int(input())
for _ in range(t):
	i = int(input())
	if 100 % i == 0:
		print(100 // i)
	else:
		d = math.gcd(i, 100 - i)
		print(i // d + (100 - i) // d)


from collections import Counter, deque
from itertools import accumulate, product, groupby
import operator
import math
from functools import reduce

def solve():
	k = int(input())
	gcd = math.gcd(k, 100)
	if gcd == 1:
		return 100
	else:
		return 100 // gcd
for _ in range(int(input())):
	print(solve())


import math
t = int(input())
r = []
for x in range(t):
	n = int(input())
	r.append(100 // math.gcd(n, 100))
for x in r:
	print(x)


import math as m
for _ in range(int(input())):
	n = int(input())
	k = m.gcd(n, 100)
	print(100 // k)


import math
for _ in range(int(input())):
	print('%d' % (100 / math.gcd(int(input()), 100)))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(int(input())):
	n = int(input())
	if 100 / n == int(100 / n):
		print(100 // n)
	else:
		print(100 // gcd(100, n))


for i in range(int(input())):
	n = int(input())
	(a, b, ans) = (1, 0, 1)
	while a * 100 / (a + b) != n:
		if a * 100 / (a + b) < n:
			a += 1
		else:
			b += 1
		ans += 1
	print(ans)


t = int(input())
for i in range(t):
	a = int(input())
	if a == 100:
		print('1')
	else:
		b = 100 - a
		for i in range(min(b, a), 0, -1):
			if b % i == 0 and a % i == 0:
				print(int(b / i + a / i))
				break


t = int(input())
for _ in range(t):
	k = int(input())
	n = 100
	a = 2
	while a < 50:
		while k % a == 0 and n % a == 0:
			k //= a
			n //= a
		a += 1
	print(n)


import math
for j in range(int(input())):
	k = int(input())
	m = k
	w = 100 - k
	ratio = m if m >= w else w
	for i in range(ratio, 0, -1):
		if m % i == 0 and w % i == 0:
			m /= i
			w /= i
	print(int(m + w))


def potion(n):
	p = n
	w = 100 - n
	if w == 0:
		return 1
	gcd = hcf(p, w)
	return p / gcd + w / gcd

def hcf(n1, n2):
	curr_hcf = 1
	for i in range(1, min(n1, n2) + 1):
		if n1 % i == 0 and n2 % i == 0:
			curr_hcf = max(i, curr_hcf)
	return curr_hcf
t = int(input())
for i in range(t):
	n = int(input())
	print(int(potion(n)))


def hcfnaive(a, b):
	if b == 0:
		return a
	else:
		return hcfnaive(b, a % b)
for i in range(int(input())):
	n = int(input())
	a = hcfnaive(100, n)
	if 100 % a == 0:
		print(100 // a)
	else:
		print(100)


def gdc(e, w):
	while w:
		(e, w) = (w, e % w)
	return e
for _ in range(int(input())):
	k = int(input())
	e = k
	w = 100 - k
	div = gdc(e, w)
	while div != 1:
		e = e // div
		w = w // div
		div = gdc(e, w)
	print(e + w)


for s in [*open(0)][1:]:
	r = 1
	while int(s) * r % 100:
		r += 1
	print(r)


import math
for _ in range(int(input())):
	k = int(input())
	magic = k
	water = 100 - k
	common = math.gcd(magic, water)
	answer = magic / common + water / common
	print(int(answer))


def NOD(x, y):
	for i in range(min(x, y), 0, -1):
		if x % i == 0 and y % i == 0:
			return i
			break
gigka = int(input())
for kumar in range(gigka):
	k = int(input())
	print(100 // NOD(100, k))


GLOBALZ = []

def divisors(n):
	i = 2
	li = []
	while i <= n:
		if n % i == 0:
			li.append(i)
		i += 1
	return li

def check(k, w):
	if (k == 0 or w == 0) and len(GLOBALZ) == 0:
		print(1)
		GLOBALZ.append(1)
		return
	small = min([k, w])
	big = max([k, w])
	res = []
	res = divisors(small)
	res[::-1]
	if len(res) == 0:
		if len(GLOBALZ) == 0:
			print(small + big)
			GLOBALZ.append(1)
			return
	for ele in res:
		if big % ele == 0:
			big = big // ele
			small = small // ele
			check(big, small)
			return
	if len(GLOBALZ) == 0:
		print(small + big)
	return
t = int(input())
for _ in range(t):
	GLOBALZ = []
	k = int(input())
	w = 100 - k
	check(k, w)


import math
a = int(input())
i = 0
while i < a:
	b = int(input())
	c = 100 - b
	r = math.gcd(b, c)
	b = b // r
	c = c // r
	print(c + b)
	i = i + 1


import math

def main():
	t = int(input())
	while t > 0:
		k = int(input())
		ans = 100 // math.gcd(100, k)
		print(ans)
		t -= 1
main()


import sys
input = sys.stdin.readline

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(int(input())):
	n = int(input())
	print(int(100 / gcd(n, 100)))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(int(input())):
	k = int(input())
	x = 100 // gcd(k, 100)
	print(x)


def solveq1():

	def euclidean(a, b):
		if a == 0:
			return b
		return euclidean(b % a, a)
	k = int(input())
	gcd = euclidean(k, 100 - k)
	print(int(100 / gcd))
for tc in range(int(input())):
	solveq1()


t = int(input())
for i in range(t):
	k = int(input())
	a = k
	b = 100
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	r = a + b
	print(100 // r)


import math

def solve():
	n = int(input())
	a = n
	b = 100 - n
	while 1:
		g = math.gcd(a, b)
		if g == 1:
			print(a + b)
			return
		else:
			a = a // g
			b = b // g
t = int(input())
while t > 0:
	t -= 1
	solve()


factors = [100, 50, 25, 20, 10, 5, 4, 2]
t = int(input())
for z in range(t):
	k = int(input())
	div = 100 / k
	for fac in factors:
		div = k / fac
		if div == int(div):
			print(100 // fac)
			break
		elif fac == 2:
			print(100)


t = int(input())

def reduction(a):
	(c, d) = (max(a, 100 - a), min(a, 100 - a))
	while 1:
		if c % d == 0:
			break
		else:
			(c, d) = (d, c % d)
	return a // d + (100 - a) // d
for i in range(t):
	n = int(input())
	if n == 100 or n == 0:
		print(1)
		continue
	ans = reduction(n)
	print(ans)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = eval(input())
while t:
	t -= 1
	k = eval(input())
	g = gcd(100, k)
	c = 100 / g
	print('%d' % c)


for case in range(int(input())):
	k = int(input())
	for i in range(max(k, 100 - k), 0, -1):
		if k % i == 0 and (100 - k) % i == 0:
			print(100 // i)
			break


t = int(input())
for task in range(t):
	k = int(input())
	i = 2
	res = 100
	while i <= k:
		if k % i == 0:
			k //= i
			if res % i == 0:
				res //= i
		else:
			i += 1
	print(res)


from math import ceil, gcd
from collections import Counter
for ttt in range(int(input())):
	n = int(input())
	ess = n
	wat = 100 - n
	hh = gcd(ess, wat)
	print(wat // hh + ess // hh)


def GCF(x, y):
	while x % y != 0:
		z = x % y
		x = y
		y = z
	return y
t = int(input())
for x in range(t):
	n = int(input())
	print(int(100 / int(GCF(n, 100))))


import math
t = int(input())
while t > 0:
	k = int(input())
	if k == 0 or k == 100:
		print('1')
		t = t - 1
		continue
	l = math.gcd(k, 100 - k)
	print(k // l + (100 - k) // l)
	t -= 1


from math import gcd
for _ in range(int(input())):
	n = int(input())
	rem = gcd(n, 100)
	print(100 // rem)


def hcf(num1, num2):
	a = num1
	b = num2
	while b:
		(a, b) = (b, a % b)
	return a
for _ in range(int(input())):
	n = int(input())
	h = hcf(100, n)
	print(100 // h)


import sys
input = sys.stdin.readline
from sys import stdin, stdout
from math import gcd
M = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		k = int(input())
		w = gcd(100, k)
		n = 100 // w
		print(n)
main()


import sys
import math
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor, log
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)
N = 20005
T = 1
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	(x, y) = (min(n, 100 - n), max(n, 100 - n))
	if y == 100:
		print(1)
		continue
	g = gcd(x, y)
	ans = (x + y) // g
	print(ans)


from math import gcd as g
for i in range(int(input())):
	print(100 // g(100, int(input())))


from math import *
from sys import *
from bisect import *
from collections import *
t = int(stdin.readline())
for _ in range(t):
	a = int(stdin.readline())
	b = 100 - a
	x = gcd(a, b)
	ans = a // x + b // x
	print(ans)


import math

def is_integer(num):
	epislon = 10 ** (-6)
	return abs(round(num) - num) < epislon

def solve(essence_percentage):
	if essence_percentage == 100 or essence_percentage == 0:
		return 1
	K = essence_percentage / 100.0
	for step in range(1, 100):
		w = step / K - step
		if is_integer(w):
			return round(step + w)
	return -1
test_cases = int(input())
for index in range(test_cases):
	required_essence = int(input())
	print(solve(required_essence))


for t in range(int(input())):
	k = int(input())
	r = 1
	while k * r % 100 != 0:
		r += 1
	print(r)


i = int(input())
for i in range(0, i):
	e = int(input())
	w = 100 - e
	if e == 100 or e == 0:
		print(1)
	elif e == 50:
		print(2)
	elif e == 25 or e == 75:
		print(4)
	elif e > w:
		if e % w == 0:
			e //= w
			w //= w
			print(e + w)
		else:
			for b in range(e, 1, -1):
				if e % b == 0 and w % b == 0:
					e //= b
					w //= b
			print(e + w)
	elif e < w:
		if w % e == 0:
			w //= e
			e //= e
			print(e + w)
		else:
			for b in range(e, 1, -1):
				if e % b == 0 and w % b == 0:
					e //= b
					w //= b
			print(e + w)
	w = 0


for testcase in range(int(input())):
	N = int(input())
	(percentage, cent) = (N, 100)
	while cent:
		(percentage, cent) = (cent, percentage % cent)
	print(100 // percentage)


n = int(input())
for i in range(n):
	m = int(input())
	if m == 100 or m == 0:
		print(1)
	else:
		for j in range(m):
			if m % (m - j) == 0:
				a = 100 % (m - j)
				if a == 0:
					print(int(100 / (m - j)))
					break


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase

def main():
	pass
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')
import math
t = int(input().rstrip())
for _ in range(t):
	n = int(input().rstrip())
	s1 = math.gcd(n, 100)
	s2 = 100 // s1
	print(s2)


from fractions import Fraction
for enumeration in range(int(input())):
	k = int(input())
	water = 100 - k
	steps = 0
	num = 1
	xd = Fraction(water, 100)
	if xd == 0:
		print(1)
	else:
		print(xd.denominator)


for _ in range(int(input())):
	n = int(input())
	m = 100
	while m:
		(n, m) = (m, n % m)
	print(100 // n)


def Gcd(m, n) -> int:
	return m if n == 0 else Gcd(n, m % n)
t = int(input())
for _ in range(t):
	k = int(input())
	g = Gcd(k, 100)
	print(f'{100 // g}')


import math
for _ in range(int(input())):
	a = int(input())
	print(100 // math.gcd(a, 100))


import math
t = int(input())
x = 0
for x in range(t):
	k = int(input())
	w = 100 - k
	d = math.gcd(k, w)
	while d > 1:
		k = k // d
		w = w // d
		d = math.gcd(k, w)
	print(k + w)


for _ in range(int(input())):
	k = int(input())
	j = min(k, 100 - k)
	if j == 0:
		print(1)
	elif 100 % j == 0:
		z = int(100 / j)
		print(z)
	elif j % 50 == 0:
		print(2)
	elif j % 25 == 0:
		print(4)
	elif j % 20 == 0:
		print(5)
	elif j % 10 == 0:
		print(10)
	elif j % 5 == 0:
		print(20)
	else:
		z = 100
		while j % 2 == 0 and z % 2 == 0:
			z = z / 2
			j = j / 2
		print(int(z))


t = int(input())
for i in range(t):
	x = int(input())
	sad = 100
	for j in range(100, 1, -1):
		if x % j == 0 and sad % j == 0:
			x //= j
			sad //= j
	print(sad)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
for _ in range(int(input())):
	n = int(input())
	print(100 // gcd(n, 100 - n))


import math

def func(k):
	if k == 100 or 0:
		print(1)
	else:
		m = 100 - k
		if k <= 50:
			if m % k == 0:
				print(int(m / k + 1))
			else:
				g = math.gcd(k, m)
				a = k / g
				b = m / g
				print(int(a + b))
		elif k % m == 0:
			print(int(k / m + 1))
		else:
			g = math.gcd(k, m)
			a = k / g
			b = m / g
			print(int(a + b))
t = int(input())
for i in range(t):
	k = int(input())
	func(k)


import math
t = int(input())
for _ in range(t):
	k = int(input())
	a = int(k / math.gcd(k, 100 - k))
	b = int((100 - k) / math.gcd(k, 100 - k))
	print(a + b)


from math import gcd
for _ in range(int(input())):
	x = int(input())
	print(100 // gcd(x, 100))


from sys import stdin
input = stdin.readline

def gcd(a, b):
	if a == 0:
		return b
	if b == 0:
		return a
	if a == b:
		return a
	if a > b:
		return gcd(a - b, b)
	return gcd(a, b - a)
for _ in range(int(input())):
	k = int(input())
	if gcd(k, 100 - k) == 1:
		print(100)
	else:
		g = gcd(k, 100 - k)
		h = (100 - k) // g
		k = k // g
		print(k + h)


import math
for _ in range(int(input())):
	k = int(input())
	water = 100 - k
	c = math.gcd(water, k)
	ans = 0
	if c == 1:
		print('100')
	else:
		water = water // c
		k = k // c
		print(water + k)


t = int(input())
for _ in range(t):
	k = int(input())
	if k == 100:
		print(1)
		continue
	res = 2
	while k % (100 / res) != 0:
		res += 1
	print(res)


import math
a = int(input())
for x in range(a):
	b = int(input())
	if math.gcd(100, b) == 1:
		print(100)
	else:
		c = math.gcd(100, b)
		print(100 // c)


import sys, math
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ans = 100
	while math.gcd(n, ans) > 1:
		c = math.gcd(n, ans)
		ans = ans // c
		n = n // c
	print(ans)


def gcd(num1, num2):
	if num1 == 0:
		return num2
	return gcd(num2 % num1, num1)

def solN():
	n = int(input())
	r = gcd(n, 100 - n)
	print(n // r + (100 - n) // r)

def main():
	for _ in range(int(input())):
		solN()
main()


import math
for i in range(int(input())):
	n = int(input())
	m = 100 - n
	g = math.gcd(m, n)
	print(int(n / g + m / g))


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
import heapq
I = sys.stdin.readline
alpha = 'abcdefghijklmnopqrstuvwxyz'
mod = 10 ** 9 + 7

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

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

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

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

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def main():
	ans = ''
	for _ in range(ii()):
		k = ii()
		tmp = 100
		g = gcd(tmp, k)
		tmp //= g
		ans += str(tmp) + '\n'
	print(ans)
main()


a = int(input())
for i in range(a):
	b = int(input())
	c = 100
	for j in range(100, 1, -1):
		if b % j == 0 and c % j == 0:
			b = b // j
			c = c // j
	print(c)


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

def solve():
	k = int(input())
	g = gcd(100 - k, k)
	return int(100 / g)
for _ in range(int(input().strip())):
	print(solve())


from itertools import permutations, combinations
import heapq
from collections import OrderedDict
import bisect
from functools import cmp_to_key
from collections import deque
import string
from collections import Counter
from collections import defaultdict
from math import sqrt
import math
import sys
try:
	sys.stdin = open('inputf.in', 'r')
	sys.stdout = open('outputf.in', 'w')
except:
	pass

def ii():
	return int(sys.stdin.readline().strip())

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

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

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

def dparr(m, n):
	return [[0] * n for i in range(m)]
t = ii()
for _ in range(t):
	k = ii()
	i = 1
	while True:
		x = k * i / 100
		if x.is_integer():
			break
		i += 1
	print(i)


for _ in range(int(input())):
	n = int(input())
	m = 99999999
	for i in range(1, n + 1):
		if (100 * i - n * i) % n == 0:
			m = min(m, i + (100 * i - n * i) // n)
	print(m)


def gcd(a, b):
	if a < b:
		smaller = a
	elif b < a:
		smaller = b
	for i in range(1, smaller + 1):
		if a % i == 0 and b % i == 0:
			hcf = i
	return hcf
n = int(input())
for i in range(n):
	x = int(input())
	if x == 100:
		print(1)
	else:
		y = gcd(x, 100)
		print(100 // y)


def com_div(m, n):
	if m >= n:
		(large, small) = (m, n)
	else:
		(large, small) = (n, m)
	large_divs = []
	for i in range(1, 101):
		if large % i == 0:
			large_divs.append(i)
	for i in range(len(large_divs)):
		a = large_divs[-i - 1]
		if small % a == 0:
			return a
	return 1

def potion(k):
	s = 100 // com_div(k, 100)
	return s

def test_case(t):
	input_list = []
	for i in range(t):
		input_list.append(int(input()))
	for i in range(t):
		print(potion(input_list[i]))
t = int(input())
test_case(t)


t = int(input())
for i in range(t):
	x = int(input())
	import math
	d = math.gcd(x, 100)
	m = 100 / d
	print(int(m))


def f():

	def gcd(a, b):
		while b != 0:
			t = b
			b = a % b
			a = t
		return a
	t = int(input())
	while t != 0:
		t = t - 1
		k = int(input())
		k_ = 100 - k
		h = gcd(k, k_)
		(a, b) = (k // h, k_ // h)
		print(a + b)
f()


import math

def f(n):
	return 100 / math.gcd(100, n)
t = int(input())
while t > 0:
	n = int(input())
	print(int(f(n)))
	t -= 1


import math
for _ in range(int(input())):
	n = int(input())
	m = 100 - n
	while math.gcd(n, m) != 1:
		a = math.gcd(n, m)
		n = n // a
		m = m // a
	print(n + m)


def gcd(a, b):
	while a != b:
		if a > b:
			a = a - b
		else:
			b = b - a
	return a
for i in range(int(input())):
	print(100 // gcd(100, int(input())))


m = int(input())
for i in range(m):
	k = int(input())
	n = 100
	while k != n:
		if n > k:
			n -= k
		else:
			k -= n
	print(int(100 / k))


t = int(input())
for i in range(t):
	k = int(input())
	f = [100, 50, 25, 20, 10, 5, 4, 2, 1]
	for i in range(9):
		if k % f[i] == 0:
			break
	print(int(100 / f[i]))


from math import gcd
for _ in ' ' * int(input()):
	k = int(input())
	n = 100 - k
	x = gcd(n, k)
	print(k // x + n // x)


import sys
import math
import heapq
import bisect
from collections import Counter
from collections import defaultdict
from io import BytesIO, IOBase
import string

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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
		self.BUFSIZE = 8192

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.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 = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.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:
			self.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 get_int():
	return int(input())

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

def get_int_grid(n):
	return [get_ints() for _ in range(n)]

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

def get_strs():
	return get_str().split(' ')

def flat_list(arr):
	return [item for subarr in arr for item in subarr]

def yes_no(b):
	if b:
		return 'YES'
	else:
		return 'NO'

def binary_search(good, left, right, delta=1, right_true=False):
	limits = [left, right]
	while limits[1] - limits[0] > delta:
		if delta == 1:
			mid = sum(limits) // 2
		else:
			mid = sum(limits) / 2
		if good(mid):
			limits[int(right_true)] = mid
		else:
			limits[int(~right_true)] = mid
	if good(limits[int(right_true)]):
		return limits[int(right_true)]
	else:
		return False

def prefix_sums(a):
	p = [0]
	for x in a:
		p.append(p[-1] + x)
	return p

def solve_a():
	k = get_int()
	g = math.gcd(k, 100 - k)
	return k // g + (100 - k) // g
t = get_int()
for _ in range(t):
	print(solve_a())


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
t = int(input())
for _ in range(t):
	k = int(input())
	m = 100 - k
	res = 0
	if m == 0 or k == 0:
		res += 1
	else:
		g = gcd(k, m)
		res += m // g
		res += k // g
	print(res)


from sys import stdout, stdin
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')

def mcd(a, b):
	if b == 0:
		return a
	else:
		return mcd(b, a % b)
_n = inp()
res = [0 for i in range(_n)]
for _ in range(_n):
	e = inp()
	MCD = mcd(100, e)
	res[_] = 100 if MCD == 1 else 100 // MCD
[pr(i) for i in res]


my_value = []
for i in range(int(input())):
	n = int(input())
	b = 100
	while n != b:
		if b > n:
			b = b - n
		else:
			n = n - b
	my_value.append(100 // b)
for i in my_value:
	print(i)


for t in range(int(input())):
	from math import gcd
	s = int(input())
	k = 100 - s

	def reduceFraction(x, y):
		d = gcd(x, y)
		x = x // d
		y = y // d
		print(x + y)
	reduceFraction(s, k)


for i in [*open(0)][1:]:
	k = int(i) / 100
	r = 1
	while True:
		n = round(r / k, 2)
		if str(n)[-1] == '0':
			print(int(n))
			break
		else:
			r += 1