#include <iostream>
int cas, k;
using namespace std;
int gcd(int a, int b)
{
	if (a == 0) return 0;
	if (a > b) return gcd(b, a);
	if (b % a == 0) return a;
	return gcd(b%a, a);
}
int main()
{
	cin >> cas;
	while (cas--)
	{
		cin >> k;

		int divior = gcd(k, 100 - k);
		if (divior == 0) cout << 1 << endl;
		else cout << 100 / divior << endl;
	}
	return 0;
}