#include<iostream>
using namespace std;
int main()
{
  int n,a,b;
  cin>>n;
  int arr[n];
  for(int j=0;j<n;j++)
  {   int hcf;
      cin>>a;
      b=100-a;
      if(a==100||b==100)
      {
          arr[j]=1;
          continue;
      }
      for (int i = 1; i<=a&& i<=b; ++i) {
        if (a % i == 0 && b % i ==0) {
            hcf = i;
        }}
        a/=hcf;
        b/=hcf;
        arr[j]=a+b;
    }


  for(int i=0;i<n;i++)
  {
      cout<<arr[i]<<endl;

  }


}
