#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;		typedef vector<int> vi;
typedef vector<vl> vvl;	  	typedef vector<vi> vvi;
typedef pair<ll, ll> pll;	typedef pair<int, int> pii;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define endl '\n'
#define inf 1e9
const ll mod = (ll)1e9 + 7;

int gcd(int n, int m){
	if(n<m){
        	int temp=m;
        	m=n;
        	n=temp;
        }
	if(n==1 || m==1){
		return 1;
	}
	if(n==m){
		return n;
	}
	return gcd(m,n-m);
}

int main(){
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int T;
	cin>>T;
	while(T--){
        int k;
        cin>>k;
        int n=k,m=100-k;
        if(k==100 || k==0){
        	cout<<1<<endl;
        	continue;
        }
        int x=gcd(n,m);
        int ans=100/x;
        cout<<ans<<endl;
    }
}
