#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define asc(v) sort(v.begin(),v.end())
#define dsc(v) sort(v.begin(),v.end(),greater<int>())
#define mp make_pair
#define ff first
#define ss second
#define setBits(x) _builtin_popcount(x)
#define parity(x) _builtin_parity(x)
#define leadZero(x) __builtin_clz(x)
#define trailZero(x) __builtin_ctz(x)
const double PI = acos(-1);
#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define endl "\n"
typedef complex<double> point;
# define xc real()
# define yc imag()
#define PI 3.1415926535897932384626433832
#define iter(s) for(auto it:s)

#define forl(i,n) for(int i=0;i<n;i++)
#define fore(i,n) for(int i=1;i<=n;i++)
#define forn(i,n) for(int i=n-1;i>=0;i--)
#define forls(i,l,r) for(int i=l;i<r;i++)
#define forns(i,l,r) for(int i=r-1;i>=l;i--)
#define all(v) v.begin(),v.end()
#define inc(ar,n) sort(ar,ar+n)
#define rall(v) v.rbegin(),v.rend()
#define RSORT(ar,n) sort(ar,ar+n,greater<int>())
void chmax(double& a, double b){ if(a < b) a = b; }
 
#define pat int n;cin>>n;
#define wq int q;cin>>q;fore(_,q)
#define tak(s) string s;cin>>s;int n=s.LEN;
#define nf if(f) cout<<"YES\n";else cout<<"NO\n";
#define pat1 int n;cin>>n;int a[n];forl(i,n) cin>>a[i];
#define pat2 int n,k;cin>>n>>k;int a[n];forl(i,n) cin>>a[i];
//#pragma GCC optimize "trapv"
bool sortinrev(const pair<int,int> &a,  
               const pair<int,int> &b) 
{ 
       return (a.first > b.first); 
}
unsigned int fac(unsigned int n,int x) 
{ 
    int res = 1, i; 
    for (i = 2; i <= n; i++) 
    {
        res *= i; 
        res%=x;
    }
        
    return res%x; 
}
int powM(int x,int y,int m)
{
    int ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
bool isSubseq(vector<int>v,vector<int>w){
    int x=v.size(),y=w.size();
    int j,i;
    for (j=0,i=0 ; i<x && j<y ; i++) {
        if (w[j] == v[i]){
            j++;
        }
    }
    if(j<y){
        return 0;
    }
    else{
        return 1;
    }
}
bool opp(int x, int y)
{
    return ((x ^ y) < 0);
} 
bool isPowerOfTwo(int x)
    {
    return (x && !(x & (x - 1)));
    }
bool isPrime(int n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
 
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
 
    return true;
}
int gcd(int v, int b)
{
    if (b == 0)
        return v;
    return gcd(b, v % b);
 
}
int maxSubArraySum(int v[], int size) 
{ 
   int max_so_far = v[0]; 
   int curr_max = v[0]; 
  
   for (int i = 1; i < size; i++) 
   { 
        curr_max = max(v[i], curr_max+v[i]); 
        max_so_far = max(max_so_far, curr_max); 
   } 
   return max_so_far; 
} 
int sum(int n){
    int v=0;
    while(n!=0){
        v+=(n%10);
        n/=10;
    }
    return v;
}
int findSubarraySum(int arr[], int n, int sum) 
{ 
    // STL map to store number of subarrays 
    // starting from index zero having  
    // particular value of sum. 
    unordered_map<int, int> prevSum; 
  
    int res = 0; 
  
    // Sum of elements so far. 
    int currsum = 0; 
  
    for (int i = 0; i < n; i++) { 
  
        // Add current element to sum so far. 
        currsum += arr[i];  
        // If currsum is equal to desired sum, 
        // then a new subarray is found. So 
        // increase count of subarrays. 
        if (currsum == sum)  
            res++;         
  
        // currsum exceeds given sum by currsum  
        //  - sum. Find number of subarrays having  
        // this sum and exclude those subarrays 
        // from currsum by increasing count by  
        // same amount. 
        if (prevSum.find(currsum - sum) !=  
                                  prevSum.end())  
            res += (prevSum[currsum - sum]); 
          
  
        // Add currsum value to count of  
        // different values of sum. 
        prevSum[currsum]++;
    } 
    return res; 
}
/*vector<int>a[200001];
int vis[1000001]={0};
int dis[1000001]={0};
int col[1000001]={0};
int cc=0;
void dfs(int x){
    vis[x]=1;
    col[x]=cc;
    for(int y:a[x]){
        if(!vis[y]){
            dis[y]=dis[x]+1;
            dfs(y);
        }
    }
}
bool bprt(int x, int c){
    vis[x]=1;
    col[x]=c;
    for(int y:a[x]){
        if(!vis[y]){
            if(!(bprt(y,c^1))){
                return false;
            }
        }
        else{
            if(col[x]==col[y]){
                return false;
            }
        }
    }
    return true;
}
void bfs(int x){
    queue<int>q;
    q.push(x);
    vis[x]=1;dis[x]=0;
    while(!q.empty()){
        int z=q.front();
        q.pop();
        for(int y:a[z]){
            if(!vis[y]){
                q.push(y);
                dis[y]=dis[z]+1;vis[y]=1;
            }
        }
    }
}
*/
void ans(){
    int t;cin>>t;
    while(t--){
        int k;cin>>k;
        int x=gcd(k,100-k);
        cout<<(k/x)+((100-k)/x)<<endl;
    }
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ans();
    return 0;
}

