#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll gcd(ll a, ll 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);
}
int main(){
  ll t;
  cin>>t;
  while(t--){
    ll k;
    cin>>k;
    ll k_ = 100-k;
    ll g = gcd(k,k_);
    ll a = k/g;
    ll b = k_/g;
    cout<<a+b<<endl;
  }
  
}