You have an initially empty cauldron, and you want to brew a potion in it. The potion consists of two ingredients: magic essence and water. The potion you want to brew should contain exactly $$$k\ \%$$$ magic essence and $$$(100 - k)\ \%$$$ water.In one step, you can pour either one liter of magic essence or one liter of water into the cauldron. What is the minimum number of steps to brew a potion? You don't care about the total volume of the potion, only about the ratio between magic essence and water in it.A small reminder: if you pour $$$e$$$ liters of essence and $$$w$$$ liters of water ($$$e + w > 0$$$) into the cauldron, then it contains $$$\frac{e}{e + w} \cdot 100\ \%$$$ (without rounding) magic essence and $$$\frac{w}{e + w} \cdot 100\ \%$$$ water.

The first line contains the single $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The first and only line of each test case contains a single integer $$$k$$$ ($$$1 \le k \le 100$$$) — the percentage of essence in a good potion.

For each test case, print the minimum number of steps to brew a good potion. It can be proved that it's always possible to achieve it in a finite number of steps.

NoteIn the first test case, you should pour $$$3$$$ liters of magic essence and $$$97$$$ liters of water into the cauldron to get a potion with $$$3\ \%$$$ of magic essence.In the second test case, you can pour only $$$1$$$ liter of essence to get a potion with $$$100\ \%$$$ of magic essence.In the third test case, you can pour $$$1$$$ liter of magic essence and $$$3$$$ liters of water.

#include <stdio.h>

int main()
{
    int test_cases;
    scanf("%d", &test_cases);

    int output[test_cases];

    for(int i = 0; i < test_cases; i++)
    {
        int percent;
        scanf("%d", &percent);

        int num = 100;

        while(num % percent != 0)
        {
            num += 100;
        }

        output[i] = num/percent;

    }

    for(int i = 0; i < test_cases; i++)
    {
        printf("%d\n", output[i]);
    }

    return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        int k;
        int ans;
        scanf("%d", &k);
        int l = 100-k;
        if (k==100)
        {
          ans = 1;
        }
       else
       {
           int L = gcd(k,l);
           k = k/L;
           l = l/L;
           ans = k+ l;
       }

        printf("%d\n", ans);
    }

    return 0;
}

// Online C compiler to run C program online
#include <stdio.h>

void main() {
    int t;
    scanf("%d",&t);
    while(t-->0){
        int n1,n2;
        scanf("%d",&n1);
        n2=100-n1;
        if(n1==100||n1==0){
            printf("1\n");
        }
        else{
        int gcd=0;
         for(int i=1; i <= n1 && i <= n2; ++i){
        if(n1%i==0 && n2%i==0)
            gcd = i;
    }
    n1=n1/gcd;
    n2=n2/gcd;
    printf("%d\n",n1+n2);
        }
    }
}

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <string.h>
int gcd(int a, int b);
int main()
{
	int n,x;
	scanf("%d", &n);
	while (n--)
	{
		scanf("%d", &x);
		int a = 100/gcd(100, x);
		printf("%d\n", a);
	}
}
int gcd(int a, int b)
{
	int r = 1;
	while (r!=0)
	{
		r = a % b;
		a = b;
		b = r;
	}
	return a;

}

#include <stdio.h>
int main()
{
   int t;
   scanf("%d",&t);
   while (t--)
   {int a,b;
       scanf("%d",&a);
       b=100-a;
       int i=2;
       if(b==0) printf ("1\n");

       else{
       while (i<=a&&i<=b)
       {
           if(a%i==0&&b%i==0) {
               a/=i;
               b/=i;

           }
           else i++;
       }
       printf("%d\n",a+b);
       }

   }

    }

#include<stdio.h>

int gcd(int a, int b)
{
	if(b == 0) return a;
	else return gcd(b, a % b);
}

int main()
{
	int t;
	scanf("%d", &t);

	while(t--)
	{
		int k;
		scanf("%d", &k);
		printf("%d\n", 100 / gcd(100, k));
	}
}

#include <stdio.h>
int main()
{
    int testcases;
    scanf("%d", &testcases);
    //printf("%d", testcases);
    while (testcases > 0)
    {
        int percent;
        scanf("%d", &percent);
        int cpy = percent;
        int ans = 100, lim=2;
        while (cpy % 5 == 0 && lim!=0)
        {
            cpy /= 5;
            ans /= 5;
            lim--;
        }
        lim=2;
        while (cpy % 2 == 0 && lim!=0)
        {
            cpy /= 2;
            ans /= 2;
            lim--;
        }
        printf("%d\n", ans);
        testcases--;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        int me,w,hcf,steps;
        scanf("%d",&me);
        w=100-me;
         for(int i=1 ; i <=me || i <= w; i++) {
   if( me%i == 0 && w%i == 0 )
      hcf = i;
   }
    steps=(me+w)/hcf;
        printf("%d\n",steps);
    }
}

#include<stdio.h>
int hcf(int a,int b)
{
    if(b==0)
    return a;
    return hcf(b,a%b);
}
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,x;
        scanf("%d",&n);
        if(n>50)
         x=hcf(n,100-n);
        else
        x=hcf(100-n,n);
      int res=n/x+(100-n)/x;
      printf("%d\n",res);
    }
}

#include <stdio.h>

int i=0;
int funct()
{
   int b, j, h, c, d;
   scanf("%d", &b);
   h = 100 - b;
   for (j = 100; j > 0; j--)
   {
      if (h % j == 0 && b % j == 0)
      {
         c = h / j;
         d = b / j;
         printf("%d\n", c + d);
         break;
      }

   }
   return 0;
}

int main()
{
   int a;
   scanf("%d", &a);
   for (i = 0; i < a; i++)

   {
      funct();
   }
   return 0;
}

#include <stdio.h>

int gcd(a,b)
{
 if(b==0) return a;
 return gcd(b,a%b);
}

int main(){

int i,t,k,g,ans;

scanf("%i",&t);

for(i-0;i<t;i++){
scanf("%i",&k);
g = gcd(k,100-k);
ans = 100/g;
 printf("%i\n",ans);
}

}

#include<stdio.h>
#include<string.h>
#include<math.h>
int hcf(int x)
{ int k=1;
if(x%2==0)
{
   x=x/2;
   k=k*2;
}
if(x%2==0)
{
     x=x/2;
   k=k*2;
}
if(x%5==0)
{
    x=x/5;
    k=k*5;
}
if(x%5==0)
{
        x=x/5;
    k=k*5;
}
    return(k);
}
int main()
{  int test,p,i,a[110];
scanf("%d",&test);
for( i=0;i<test;i++)
{
    scanf("%d",&a[i]);
}
for(int i=0;i<test;i++)
{
 p=hcf(a[i]);
 printf("%d \n",100/p);
}
}

#include <stdio.h>

int gcd(int a, int b) {

	int remainder = a % b;

    if (remainder == 0) {

        return b;
    }

    return gcd(b, remainder);
}

int main() {

	int numTests = 0, test = 1;

	scanf("%d", &numTests);

	while (test <= numTests) {

		int k = 0, n2 = 100, res = 0;

		scanf("%d", &k);

		res = gcd(n2, k);

		printf("%d\n", 100 / res);

		test++;
	}

	return 0;
}

#include<stdio.h>
int fun(int a,int b)
{
	int t;
	t=a%b;
	while(t!=0)
	{
		a=b;
		b=t;
		t=a%b;
	}
	return b;
}
int main()
{
    int t;
	scanf("%d",&t);
	while(t--)
	{
		int k;
		scanf("%d",&k);
		if(k==100)
		printf("1\n");
		else
		{
			int a=k,b=100-k;
			int c=fun(a,b);
			printf("%d\n",a/c+b/c);
		}
	}
    return 0;
}

#include<stdio.h>
int gcd(int a,int 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()
{
        int t;
        scanf("%d",&t);
        while(t--)
        {
                int n;
                scanf("%d",&n);
                if(n%100 == 0){
                        printf("%d\n",100/n);
                }
                else
                {
                        printf("%d\n",100/gcd(n,100));
                }
        }
}

#include<stdio.h>
int main()
{
    int i,t,a,b,n,k;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        a=100;
    scanf("%d",&k);
    while(k!=0)
    {
        b=k;
        k=a%k;
        a=b;
    }
    int result=100/a;
    printf("%d\n",result);

    }

}

#include <stdio.h>

int main ()
{

  int z;
  scanf ("%d", &z);
  while (z > 0)
    {
      int a, b, x, y, t, gcd;

      scanf ("%d", &x);

      y = 100 - x;
      a = x;
      b = y;

      while (b != 0)
	{
	  t = b;
	  b = a % b;
	  a = t;
	}

      gcd = a;

      printf ("%d\n", (x / gcd + y / gcd));
      z--;
    }
  return 0;
}

#include <stdio.h>

int main()
{
    int t,i,min;
    scanf("%d",&t);

    while(t-->0)
    {
        scanf("%d",&i);
        int e=i;
        int w=100-i;
        int gcd;
            if(i==100||i==0)
            {
                min=1;
            }
            else
            {
            for(int i=1;i<=e&&i<=w;i++)
            {
                if(e%i==0&&w%i==0)
                {
                    gcd=i;
                }
            }

            min=w/gcd+e/gcd;
            }

        printf("%d\n",min);

    }

    return 0;
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k;
        scanf("%d",&k);
        int c;
        for(int i=1; i <= 100 && i <= k; ++i)
        {
            if(100%i==0 && k%i==0)
            c = i;
        }
        int g=100/c;

        printf("%d\n",g);

    }
}

#include<stdio.h>
int main(){
	int t,i;
	scanf("%d",&t);
	while(t--){
		int k=0,temp=0,sum=0;
		scanf("%d",&k);
		for(i=1;i<=k;i++){
			if(k%i==0&&100%i==0){
				temp=i;
			}
		}
		sum=100/temp;
		printf("%d\n",sum);
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

void solve(void)
{
    int arr[] = {100, 50, 25, 20, 5, 4, 2};
    int num = 100;
    int essence;
    scanf("%d", &essence);
    /* trim essence */
    for (int i=0; i<7; ++i) {
        if (essence >= arr[i]) {
            if (essence % arr[i] == 0 && num % arr[i] == 0) {
                essence /= arr[i];
                num /= arr[i];
            }
        }
    }
    printf("%d\n", num);
}

int main(void)
{
    int numberOfTestCases;
    scanf("%d", &numberOfTestCases);

    for (int i=0; i<numberOfTestCases; ++i)
        solve();
    return EXIT_SUCCESS;
}

#include<stdio.h>
main()
{
       int n,t,s;
       scanf("%d",&t);
       while(t--)
       {
              scanf("%d",&n);
              s=100;
              while(n!=s)
              {
                     if(n>s)
                     n=n-s;
                     else
                     s=s-n;
              }
              printf("%d\n",100/n);
       }
}

#include<stdio.h>
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int k,n=100;
		scanf("%d",&k);
		while(n && k)
		{
			//printf("1n=%d,k=%d\n",n,k);
			n=n%k;
			if(n==0) break;
			//printf("2n=%d,k=%d\n",n,k);
			k=k%n;
			//printf("3n=%d,k=%d\n",n,k);//原来是除数为0导致输出错误
		}
		printf("%d\n",100/(n+k));
	}
}

#include<stdio.h>

int main() {
    int t;
    scanf("%d", &t);
    while(t--) {
        int me, w, tp;
        scanf("%d", &me);
        w = 100-me;
        int range=(me>w)?me:w;
        for(int i = range;i > 0;i--) {
            if(me%i==0 && w%i==0) {
                // printf("%d ", i);
                me/=i;
                w/=i;
            }
        }
        // printf("\n%d\n", me+w);
        printf("%d\n", me+w);
    }
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long long int ll;
typedef unsigned long long ull;
typedef long double lld;
ll gcd(ll a, ll b) {
    return b ? gcd(b, a % b) : a;
}
void swap(int *a, int *b) {
    int t = *a;
    *a = *b;
    *b = t;
}
typedef struct array {
    int first, second;
} point;
ll  min(ll  a, ll b) {
    return a < b ? a : b;
}
ll max(ll a, ll b) {
    return a > b ? a : b;
}
int cmpfunc (const void * a, const void * b) {
    return ( *(int*)a - * (int*)b );
}
int cmc(const void *a, const void *b) {
    return *(char *)a - *(char *)b;
}
int comp(const void* a, const void* b) {
    long long i = *(long long*)a;
    long long j = *(long long*)b;
    return (int)((i > j) - (i < j));
}
#define pr printf
#define sc scanf
#define re(i,a,b) for(int i=a;i<b;i++)
#define I 1e18
//qsort(a, n, sizeof(int), cmpfunc);
void test();
int main()
{
/*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif*/
    int t;
    scanf(" %d ", &t);
    while (t--)
    {
        test();
    }
}
void test()
{
    int  n = 0, k, i, j;
    sc("%d", &k);
    double h;
    for (i = 0; i <= 100; i++)
    {
        for (j = 0; j <= 100 - k; j++)
        {
            h = i * 100 / (double) (j + i);
            if (h == k)
            {
                n++;
                break;
            }
        }
        if (n > 0)
        {
            break;
        }

    }
    printf("%d\n", j + i);

}

#include<stdio.h>

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n;
		scanf("%d",&n);

		if(n==100)
		{
			printf("1\n");
		}
		else{
			float p1=100-n;
			float p2=n;
			int f1=p1/p2;
			float f2=p1/p2;

				int i,gcd=1;
				for(i=1;i<=(100-n)&&i<=n;i++)
				{
					if((100-n)%i==0 && n%i==0)
					gcd=i;
				}
				if(gcd==1)
				{
					int r=p1+n;
					printf("%d\n",r);
				}
				else{
					int r1=p1/gcd;
					int r2=n/gcd;
					printf("%d\n",r1+r2);
				}
		}

	}
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        int me,w,hcf,steps;
        scanf("%d",&me);
        w=100-me;
         for(int i=1 ; i <=me || i <= w; i++) {
   if( me%i == 0 && w%i == 0 )
      hcf = i;
   }
    steps=(me+w)/hcf;
        printf("%d\n",steps);
    }
}

#include <stdio.h>
int main()
{
   int t;
   scanf("%d",&t);
   while (t--)
   {int a,b;
       scanf("%d",&a);
       b=100-a;
       int i=2;
       if(b==0) printf ("1\n");

       else{
       while (i<=a&&i<=b)
       {
           if(a%i==0&&b%i==0) {
               a/=i;
               b/=i;

           }
           else i++;
       }
       printf("%d\n",a+b);
       }

   }

    }

#include <stdio.h>

int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

int main()
{
    int t;
    scanf("%d",&t);
    while(t-- >0)
    {
        int k;
        scanf("%d",&k);
        if(k==0 || k==100)
        {
            printf("1\n");
            continue;
        }
        if(k==1 || k==99)
        {
            printf("100\n");
            continue;
        }
        if(k==2 || k==98)
        {
            printf("50\n");
            continue;
        }
        if(k==50)
        {
            printf("2\n");
            continue;
        }
        int a=0;
        if(k>50)
           a = gcd(k,100-k);
        else
           a = gcd(100-k,k);
        printf("%d\n",((k/a)+((100-k)/a)));
    }
    return 0;
}

#include <stdio.h>
#include <math.h>

int find_gcd(int k,int w){
    int large,small,temp;
        if(k>=w){
            large=k;
            small=w;
        }
        else{
            large=w;
            small=k;
        }
        while(large%small!=0){
            temp=small;
            small=large%small;
            large=temp;;
        }
        return small;
}
int main(){
    int t,k,i,move,gcd,w,large,small;

    scanf("%d",&t);
    while(t--){
        scanf("%d",&k);
        w=100-k;
        if(k==100){
            move=1;
        }
        else{
            gcd=find_gcd(k,w);
            move=(k/gcd)+(w/gcd);
        }
        printf("%d\n",move);

    }
return 0;
}

#include<stdio.h>
int gcd(int a,int b){
if(a==0) return b;
else return gcd(b%a,a);
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int a;
scanf("%d",&a);
printf("%d\n",100/gcd(a,100-a));
}
}

#include <stdio.h>
#include <math.h>

#define max(a, b) ((a) > (b) ? (a) : (b))
int isWhole(float num)
{
    return num == round(num);
}

int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        int k;
        int loop = 1;
        int n = 100;
        scanf("%d", &k);
        while (loop)
        {
            loop = 0;
            for (int i = 100; i > 1; i--)
            {
                float f1 = (float)k / (float)i;
                float f2 = (float)n / (float)i;
                loop = isWhole(f1) && isWhole(f2);
                if (loop)
                {
                    k /= i;
                    n /= i;
                    break;
                }
            }
        }
        printf("%d\n", (int)max(k, n));
    }
}

#include <stdio.h>
#include<math.h>
int gcd(int k)
{

  for(int i=k;i>1;i--)
  {
      if(k%i==0 && 100%i==0)
      return i;
  }
  return 1;
}
int potionMaking(int k)
{   int l=gcd(k);
    int z=100/l;
    printf("%d\n",z);
    return 0;
}
int main()
{
   int t;
   scanf("%d",&t);
   for(int i=0;i<t;i++)
   {
       int k;
       scanf("%d",&k);
       potionMaking(k);
   }
    return 0;
}

/* Starting ... Code by Red_RanGer*/
#include "stdio.h"
int divisible(int n,int arr[]){
    int count =0;
    for (int i = 2; i <= n; i++)
    {
        if (n%i==0)
        {
            arr[count]=i;
            count++;
        }
    }
    return count ;
}
int main(){
    int testcases;
    scanf("%d",&testcases);
    for (int i = 0; i <testcases; ++i){
        // max k =100;
        int arr[100];
        int min = 100000 ;
        int k;
        scanf("%d",&k);
        if (k==100)
        {
            printf("1\n");
            continue;
        }

        if ((100-k)>k && (100-k)%k==0)
        {
            printf("%d\n",((100-k)/k)+1);
            continue ;
        }
        if ((100-k)<=k && k%(100-k)==0)
        {
            printf("%d\n",(k/(100-k))+1);
            continue ;
        }
        else
        {
            int len , e;
            len =divisible(100-k,arr);
            for (int i = 0; i <len; i++)
            {
                e =(k*arr[i]) / (100-k);
                if ((k*arr[i]) % (100-k) ==0)
                {
                    if (e+arr[i] < min)
                    {
                        min = e+arr[i];
                    }
                }
            }
        }
        printf("%d\n",min);

    }
    return 0;
}

#include<stdio.h>
int main()
{
    int i,t;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
      int j,count=0,e;
      scanf("%d",&e);
      for(j=1;j<=e;j++)
      {
          if(e%j==0 && 100%j==0)
          {
              count=j;
          }
      }
      printf("%d\n",100/count);
    }
    return 0;
}

#include <stdio.h>

int main(void) {
    int t, k;
    int min, max;
    scanf("%d", &t);
    int answers[t];
    for(int i = 0; i < t; i++) {
        scanf("%d", &k);
        if((100 - k) > k) {
            min = k;
            max = 100 - k;
        }
        else {
            max= k;
            min = 100 - k;
        }
            if(k == 100 || k == 0) {
                answers[i] = 1;
            }
            else if(max % min== 0) {
                answers[i] = 100 / min;
            }
            else {
                for(int j = min / 2;j >= 1;j--) {
                    if(max % j == 0 && min % j == 0) {
                        answers[i] = 100 / j;
                        break;
                    }
                }
            }
    }

    for(int i = 0; i < t; i++) {
        printf("%d\n",answers[i]);
    }
	return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int min(int a, int b) { return a < b ? a : b; }

int main()
{
     int x, y, z, i, j, k, a, b, c, n, m, t;
     scanf("%d",&t);
     while(t--)
     {
          c = 100 * 100;
          scanf("%d", &n);
          for(x = 1; x <= 100; x++)
            for(y = 0; y <= 100; y++)
            {
                  if(100 * x == n * (x + y))
                     c = min(c, x + y);
            }

          printf("%d\n", c);
     }
     return 0;
}

#include <stdio.h>
int func(int a, int b)
{
    if (a == 0)
    {
        return b;
    }
    return func(b % a, a);
}
int main()
{
    int t = 0;
    scanf("%d", &t);
    while (t--)
    {
        int k = 0;
        scanf("%d", &k);
        int result = (100 / func(k, 100));
        printf("\t\t\t%d\n", result);
    }

    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<math.h>
void input(int ar[],int n)
{
    for(int i=0;i<n;i++)
        scanf("%d",&ar[i]);
}
int small(int a,int b)
{
    if(a<b)
        return a;
    return b;
}
int great(int a,int b)
{
    if(a>b)
        return a;
    return b;
}
int gcd(int a,int b)
{
    for(int i=small(a,b);i>=1;i--)
        if(great(a,b)%i==0 && small(a,b)%i==0)
            return i;
    return 1;
}
int main()
{
    int t;
    scanf("%d",&t);
    for(int l=0;l<t;l++)
    {
        int n;
        scanf("%d",&n);
        printf("%d\n",100/gcd(100,n));
    }
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

int main(){
	int tt;
	scanf("%d", &tt);
	while(tt--){
		int n;
		scanf("%d", &n);
		int a = n, b = 100-n, l = 1;
		while(a != b && b != 0){
			if(a > b) a -= b;
			else b -= a;
		}
		l = a;
		int ans = 0, tt = 0;
		while(tt != 100){
			tt += l;
			ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

#include<stdio.h>
#include<string.h>
int GCD(int n)
{
    int i, gcd;
    for(i=1; i <= n && i <= 100; i++)
    {

        if(n%i==0 && 100%i==0)
            gcd = i;
    }
    return gcd;
}

int main()
{
    int t, n;
    double div;
    scanf("%d", &t);
    while(t--)
    {
        scanf("%d", &n);
        if(GCD(n) == 1){
            printf("100\n");
        }
        else{
            printf("%d\n", 100/GCD(n));
        }

    }

}

#include <stdio.h>
#include <math.h>
int hcf(int a, int b)
{
    // Everything divides 0
    if (a == 0)
       return b;
    if (b == 0)
       return a;

    // base case
    if (a == b)
        return a;

    // a is greater
    if (a > b)
        return hcf(a-b, b);
    return hcf(a, b-a);
}
int main()
{
    int t;
    scanf("%d",&t);
    while (t--)
    {
        int n;
        scanf("%d",&n);
        if (n==0)
        {
            printf("1\n");
            continue;
        }
        int h=hcf(100,n);
        if (h!=1)
            printf("%d\n",(100/h));
        else
            printf("100\n");
    }
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long double LD;
typedef long long ll;
#define int ll
#define pb push_back
#define mp make_pair
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
// -----<SCANF>-----
#define sfi(x) scanf("%d",&x);
#define sfi2(x,y) scanf("%d%d",&x,&y);
#define sfi3(x,y,z) scanf("%d%d%d",&x,&y,&z);

#define sfl(x) scanf("%lld",&x);
#define sfl2(x,y) scanf("%lld%lld",&x,&y);
#define sfl3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z);
#define sfl4(x,y,z,x1) scanf("%lld%lld%lld%lld",&x,&y,&z,&x1);
#define sfl5(x,y,z,x1,y1) scanf("%lld%lld%lld%lld%lld",&x,&y,&z,&x1,&y1);
#define sfl6(x,y,z,x1,y1,z1) scanf("%lld%lld%lld%lld%lld%lld",&x,&y,&z,&x1,&y1,&z1);

#define sfs(x) scanf("%s",x);
#define sfs2(x,y) scanf("%s%s",x,y);
#define sfs3(x,y,z) scanf("%s%s%s",x,y,z);
// ----</SCANF>-----

// ----<PRINTF>-----
#define pfi(x) printf("%d\n",x);
#define pfi2(x,y) printf("%d %d\n",x,y);
#define pfi3(x,y,z) printf("%d %d %d\n",x,y,z);

#define pfl(x) printf("%lld\n",x);
#define pfl2(x,y) printf("%lld %lld\n",x,y);
#define pfl3(x,y,z) printf("%lld %lld %lld\n",x,y,z);

#define pfs(x) printf("%s\n",x);
#define pfs2(x,y) printf("%s %s\n",x,y);
#define pfs3(x,y,z) printf("%s %s %s\n",x,y,z);

#define pwe(x) printf("%lld ",x); // print without end
// ----</PRINTF>----
long long a,b,c,d,e,t,i,j,n,m,row,col,change,x;
long long gcd(long long k,long long l)
{
    if(k%l==0)
    {
        return l;
    }
    else
    {
        gcd(l,k%l);
    }
}

int main()
{

        sfl(t);
        while(t--)
        {
            sfl(n);
            a=gcd(100,n);
            pfl(100/a);
        }

}

#include <stdio.h>

static int gcd(int a, int b) {
	int swap, c;

	if (0 == a)
		return b;
	if (0 == b)
		return a;
	if (a > b) {
		swap = a;
		a = b;
		b = swap;
	}
	for (c = a % b; c > 0; c = a % b) {
		a = b;
		b = c;
	}
	return b;
}

int main() {
	int t, k;

	scanf("%d", &t);
	while (t--) {
		scanf("%d", &k);
		printf("%d\n", 100/gcd(k, 100));
	}
	return 0;
}

#include<stdio.h>

int gcd(int a, int b)
{
    // Everything divides 0
    if (a == 0)
       return b;
    if (b == 0)
       return a;

    // base case
    if (a == b)
        return a;

    // a is greater
    if (a > b)
        return gcd(a-b, b);
    return gcd(a, b-a);
}

int main()
{
    int q;
    scanf("%d",&q);

    while(q--)
    {
        int potion;
        // float check;
        scanf("%d",&potion);

        if(100%potion==0)
        {
            printf("%d\n",100/potion);
            // continue;
        }

        else if(100%potion!=0)
        {
            printf("%d\n",100/gcd(100,potion));
        }

        // else
        // {
        //     printf("%d\n",100);
        // }
    }
}

#include <stdio.h>
int gcd(int a,int b)
{
    int t;
    while (b!=0)
    {
        t=b;
        b=a%b;
        a=t;
    }
    return a;
}
int main()
{
   int t;
   scanf("%d",&t);
   while (t--)
   {
       int r,t;
       scanf("%d",&r);
       if (r>50)
       t=gcd(r,100-r);

       else
       t=gcd(100-r,r);

       printf("%d\n",100/t);
   }
   return 0;
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        int me,w,hcf,steps;
        scanf("%d",&me);
        w=100-me;
         for(int i=1 ; i <=me || i <= w; i++) {
   if( me%i == 0 && w%i == 0 )
      hcf = i;
   }
    steps=(me+w)/hcf;
        printf("%d\n",steps);
    }
}

#include<stdio.h>
int Gcd(int n1,int n2)
{

    int i, gcd;
    for(i=1; i <= n1 && i <= n2; ++i)
    {
        if(n1%i==0 && n2%i==0)
            gcd = i;
    }
    return gcd;
}
int main()
{
    int t,i,k,o;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&k);
        if(k == 100)
        {
            printf("1\n");
        }
        else{
        o = Gcd(100-k,k);
        printf("%d\n",100/o);
        }
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int test;

    scanf("%d\n",&test);

    while(test>0)
        {
            int kper;
                      scanf("%d\n",&kper);
            int maximumv=0;
            int water=100-kper;
            for(int i=1;i<=100;i++)
            {
                if(kper%i==0 && water%i==0)
                {
                    if(i>maximumv)
                    {
                        maximumv=i;
                    }
                }
            }
            int leastcount=(water/maximumv)+(kper/maximumv);
            printf("%d\n",leastcount);
            test--;
        }
}

#include <stdio.h>
#include <stdlib.h>

int gcd(int a, int b);

int main() {
    int t, n, e, w, i, divisor;

    scanf("%d", &t);
    while (t--) {
        scanf("%d", &n);

        if (n==100) {
            printf("1\n");
            continue;
        } else {
            e = n;
            w = 100 - e;
            divisor = gcd(e, w);
            while (gcd(e, w)!=1) {
                e /= divisor;
                w /= divisor;
            }

            printf("%d\n", e+w);
        }
    }
    return 0;
}

int gcd(int a, int b) {
    if (b==0) {
        return a;
    } else {
        return gcd(b, a%b);
    }
}

#include<stdio.h>
int gcd(int i,int j){
    if (j == 0)
       return i;
   else if (i == 0)
       return j;
       else if (j == i)
        return j;
  else if (j > i)
        return gcd(j-i, i);
    return gcd(j, i-j);
}
int main()
{
    int t,i,j,a;
    scanf("%d",&t);
    int A[t];
    for (int b=0;b<t;b++){
        scanf("%d",&i);
        j=100;
        a = gcd(i,j);
        A[b] = 100/a;
            }
            for (int k= 0;k<t;k++)
                printf("%d\n",A[k]);
}

#include<stdio.h>
int main()
{
    int t,i;
    scanf("%d",&t);
    for(i=0;i<t;i++){
        int k,l,a,b;
        scanf("%d",&k);
        if(k==100){
            printf("1\n");
        }
        else{
        l=100-k;
        a=k;
        b=l;
        while((a-b)!=0){
            if(a>b){
                a=a-b;
            }
            else{
                b=b-a;
            }
        }
        k=k/b;
        l=l/b;
        printf("%d\n",k+l);
        }
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d\n",&t);
        while(t>0)
        {
            int k;
            scanf("%d\n",&k);
            int i,max=0;
            int w=100-k;
            for(i=1;i<=100;i++)
            {
                if(k%i==0 && w%i==0)
                {
                    if(i>max)
                    {
                        max=i;
                    }
                }
            }
            int res=(k/max)+(w/max);
            printf("%d\n",res);
            t--;
        }
}

#include<stdio.h>
#include<math.h>
#include<string.h>

int min(int x, int y) {
    return x < y ? x : y;
}

int main() {
    int t;
    scanf("%d", &t);
    while(t--) {
        int n;
        scanf("%d", &n);
        int p = n, w = 100 - n;
        int mini = min(p, w);
        if(w == 0) {
            printf("1\n");
        }
        else {
            for(int i = mini; i >= 1; i--) {
            if(p % i == 0 && w % i == 0) {
                p /= i;
                w /= i;
            }
        }
        printf("%d\n", p + w);
        }

    }

    return 0;
}

#include <stdio.h>
//#include <string.h>
#include <stdlib.h>
#include <ctype.h>

typedef long long int LL;
//const int M = 200005;
const int N = 52;
const int A = 26;

//LL max(LL a, LL b){if(a>b) return a; else return b;}
//LL min(LL a, LL b){if(a<b) return a; else return b;}
int max(const int a, const int b){ if(a>b) return a; else return b;}
int min(const int a, const int b){ if(a<b) return a; else return b;}
int cm(const int *a, const int *b){return *(int *)a - *(int *)b;}

int rd(){
    int a = 0;
    int flag = 1;
    char c = getchar();
    while(c == ' ' || c == '\n' || c == '\t' )
        c = getchar();
    if(c == '-'){
        flag = -1;
        c = getchar();
    }
    while(isdigit(c)){
        a = a * 10 + c - '0';
        c = getchar();
    }
    return a * flag;
}
//int *b = calloc(n+1,sizeof(int));

int main(){
    int t = 1;
    scanf("%i",&t);
    while(t--){
        int n,s = 100;
        scanf("%i",&n);
        if(n % 2 == 0){
            n /= 2;
            s /= 2;
        }
        if(n % 2 == 0){
            n /= 2;
            s /= 2;
        }
        if(n % 5 == 0){
            n /= 5;
            s /= 5;
        }
        if(n % 5 == 0){
            n /= 5;
            s /= 5;
        }

            printf("%i\n", s);
    }
    return 0-0;
}

#include<stdio.h>
int gcd(int a,int b){
if(a==0) return b;
else return gcd(b%a,a);
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int a;
scanf("%d",&a);
printf("%d\n",100/gcd(a,100-a));
}
}

#include<stdio.h>
#include<stdlib.h>

int gcd(int a, int b)
{
    // Everything divides 0
    if (a == 0)
       return b;
    if (b == 0)
       return a;

    // base case
    if (a == b)
        return a;

    // a is greater
    if (a > b)
        return gcd(a-b, b);
    return gcd(a, b-a);
}

int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
         int k;
         scanf("%d",&k);
         int e,w;
         e = k;
         w = 100 - k;
         int a;
         a= gcd (e,w);
         int result;
         e =e/a;
         w = w/a;
         result = e+w;
         printf("%d\n",result);
    }
}

#include <stdio.h>
#include <math.h>

int gcd(int n1)
{
    int rem;
    int n2 = 100;
    while(n2 != 0)
    {
        rem = n1 % n2;
        n1 = n2;
        n2 = rem;
    }
    return n1;
}

int main()
{
    int T, essence, remainder;
    scanf("%d", &T);

    while(T--)
    {
        scanf("%d", &essence);
        remainder = gcd(essence);
        printf("%d\n", 100/remainder);
    }
    return 0;
}

#include <stdio.h>
#include <math.h>

//https://codeforces.com/problemset/problem/1525/A
int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        int k;
        scanf("%d", &k);
        printf("%d\n", 100 / gcd(100, k));
    }
}

#include<stdio.h>

int main() {
    int t;
    scanf("%d", &t);
    while(t--) {
        int me, w, tp;
        scanf("%d", &me);
        w = 100-me;
        int range=(me>w)?me:w;
        for(int i = range;i > 0;i--) {
            if(me%i==0 && w%i==0) {
                // printf("%d ", i);
                me/=i;
                w/=i;
            }
        }
        // printf("\n%d\n", me+w);
        printf("%d\n", me+w);
    }
}

#include <stdio.h>

typedef long long ll;

ll FindGCD(ll n1, ll n2)
{
    // if user enters negative number, sign of the number is changed to positive
    n1 = ( n1 > 0) ? n1 : -n1;
    n2 = ( n2 > 0) ? n2 : -n2;

 if(n1==100||n2==100)
 {
     return 100;
 }

    while(n1!=n2)
    {
        if(n1 > n2)
            n1 -= n2;
        else
            n2 -= n1;
    }
    return n1;
}

int main()
{
    ll T, k, kc;

    scanf("%lld",&T);

    while(T>0)
    {
        scanf("%lld",&k);
        kc=FindGCD(k,100-k);
        printf("%lld\n",((k/kc)+((100-k)/kc)));

        T--;
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    scanf("%d", &n);
    while(n--) {
        int p,t = 100;
        int i;
        scanf("%d", &p);
        for(i = 100; i >= 2; i--) {
            if(p%i == 0 && t%i == 0) {
                p = p/i;
                t = t/i;
            }
        }
        printf("%d\n", t);
    }
    return 0;
}

#include<stdio.h>
int gcd(int a,int b)
{
    if(b==0)return a;
    else return (a%b,a);
}
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k;
        scanf("%d",&k);
        printf("%d\n",100/gcd(k,100));
    }
}

#include <stdio.h>
int main() {
    int t;
    scanf("%d", &t);
    int k, out, divisor, kWater;
    const int one = 1;
    while (t > 0){
        t--;
        scanf("%d", &k);
        if (k == 0 || k == 100){
            printf("%d\n", one);
        }
        else {
            kWater = 100 - k;
            if (k > kWater){
                divisor = kWater;
            }
            else {
                divisor = k;
            }
            while (k % divisor != 0 && kWater % divisor != 0){
                divisor--;
            }

            out = k/divisor + kWater/divisor;
            printf("%d\n", out);
        }
    }
    return 0;
};

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

int main(){
	int tt;
	scanf("%d", &tt);
	while(tt--){
		int n, ans = 0;
		scanf("%d", &n);
		int a = n;
		if(100 % a != 0 || a < 11) ans = 100;
		else{
			int a1 = a;
			ans = 1;
			while(a != 100){
				a += a1;
				ans++;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}

#include <stdio.h>
int main()
{
   int t,n;
   scanf("%d",&t);
   while (t--)
   {
       scanf("%d",&n);
       if(100%n==0) printf("%d\n",100/n);
       else printf("100\n");
   }

    }

#include <stdio.h>

int main()
{
    int t,i,k,ans;
    scanf("%d",&t);
    for(i=0;i<t;++i)
    {
        scanf("%d",&k);
        if(100%k==0)
            ans=100/k;
        else
            ans=100;
        printf("%d\n",ans);
    }

    return 0;
}

#include<stdio.h>
main()
{
       int n,t,s;
       scanf("%d",&t);
       while(t--)
       {
              scanf("%d",&n);
              s=100;
              while(n!=s)
              {
                     if(n>s)
                     n=n-s;
                     else
                     s=s-n;
              }
              printf("%d",100/n);
       }
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{  int test,i,a[110];
scanf("%d",&test);
for( i=0;i<test;i++)
{
    scanf("%d",&a[i]);
}
for(int i=0;i<test;i++)
{
if(100%a[i]==0)
{
    printf("%d \n",100/a[i]);
}
else
{
    if(a[i]%4==0)
    {
        printf("25\n");
    }
    else{
        if(a[i]%2==0)
        {
            printf("50\n");
        }
        else{
            printf("100\n");
        }
    }
}

}
}

#include<stdio.h>
#include<math.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n,k;
scanf("%d",&n);
if(100%n==0)
{
printf("%d\n",100/n);
}
if(100%n!=0)
{
printf("%d\n",100);
}
}

    return 0;
}

#include <stdio.h>

// Function that checks whether a passed floating point value is actaully a MATHEMATICAL INT Form: !2.00000
int isInteger(float value){
    int truncated = (int)value;
    if(truncated==value){
        return 1;
    }
    else{
        return 0;
    }
}

int main()
{
    int t;
    int k[100];

    // Input For Number Of Test Cases
    scanf("%d", &t);

    // Inputs of the Magic Essence Content
    for(int i=0; i<t; i++){
    scanf("%d", &k[i]);
    }

    // Printing of the number of minimum steps required in order to make that percent of magic essence potion.
    for(int i=0; i<t; i++){
        float percent = (float)100/k[i];
        int check = isInteger(percent);

        if(check){
            printf("%d\n", (int)percent);
        }
        else{
            printf("%d\n", 100);
        }
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>

void calc(int k)
{
    int x = 100 % k;
    int answer;

    if (x == 0)
    {
        answer = 100 / k;
    }
    else
    {
        answer = 100;
    }
    printf("%d\n", answer);
}

int main()
{
    int t;
    int k;
    scanf("%d", &t);
    for (int i = 0; i < t; i++)
    {
        scanf("%d",&k);
        calc(k);
    }
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>

int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        int k;
        int ans;
        scanf("%d", &k);
        int l = 100 - k;
        if (k == 100 || l==100)
        {
            ans = 1;
        }
        if (k!=0 && l!=0 && k > l && k % l == 0)
        {
            ans = k / l + 1;
        }
        if (k!=0 && l!=0 && k < l && l % k == 0)
        {
            ans = l / k + 1;
        }
        else
        {
            ans = 100;
        }
        printf("%d\n", ans);
    }

    return 0;
}

int find(int x,int y){
	if(x<y) {
		int t=y;y=x;x=t;
	}
	return x%y==0?y:find(y,x%y);
}

main(){
      int k,t;
      scanf("%d",&t);
      while(t--){
            scanf("%d",&k);
			printf("%d",100/find(100,k));
      }
}

#include <stdio.h>
int solution(int n);
int main()
{
    int t;
    scanf("%d",&t);
    while (t--)
    {
        int n;
        scanf("%d",&n);
        solution(n);
    }
    return 0;
}
int solution(int n)
{
    if (100%n==0)
    {
        printf("%d\n",(100/n));
        return 0;
    }
    else
    {
        int k1=n;
        int k2=(100-n);
        while (k1%2==0 && k2%2==0)
        {
            k1=k1/2;
            k2=k2/2;
        }
        printf("%d\n",(k1+k2));
        return 0;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int t,n,k;
    scanf("%d",&t);
    int i;
    for(i=1;i<=t;i++)
    {
        scanf("%d",&n);
        if(100%n==0)
        {
            k=100/n;
            printf("%d\n",k);
        }
        else
        {
            printf("100\n");
        }
    }
    return 0;
}

#include<stdio.h>

int main()
{
	int t;
	scanf("%d", &t);

	while(t--)
	{
		int k;
		scanf("%d", &k);
		if(100 % k == 0) printf("%d\n", 100/k);
		else printf("100\n");
	}
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k,p,cnt=1,m;
        int q;
        scanf("%d",&k);
        if(k==100)
        {
            printf("1\n");
            continue;
        }
        int n=100-k;
        if(n<=k)
        {
           p=k;
           k=n;
           n=p;
        }

        if(n%k==0)
        {
            q=n/k;
            printf("%d\n",q+1);
            continue;
        }
        if((n%k!=0) && (k%2==0))
        {
            while(k%2==0)
            {
                k=k/2;
                cnt=cnt*2;
            }
            m=n/cnt;
            printf("%d\n",m+k);
            continue;
        }
        printf("100\n");

    }
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k,a;
        scanf("%d",&k);
        if(100%k==0&&k>0)
        {
            a=100/k;
            printf("%d\n",a);
        }
        else{
            a=100;
            printf("%d\n",a);
        }
    }
}

#include<stdio.h>
int main()
{
    int t,i,n,k;
    scanf("%d",&t);

    for(i=1;i<=t;i++)
    {
        scanf("%d",&n);
        if(100%n==0) printf("%d\n",100/n);
        else printf("100\n");
    }

    return 0;
}

#include <stdio.h>
int gcd(int a, int b) {
	return a % b == 0 ? b : gcd(b, a % b);
}
int t, k;
int main(void){

	scanf("%d", &t);

		while(t--){
			scanf("%d", &k);
			int a = 100 - k;
			int b = k;
			if(k % 2 == 0) {
				printf("%d\n", 100 / gcd(100, k));
			} else {
				printf("%d\n", 100);
			}
		}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

int main(){
	int t;
	scanf("%d", &t);
	while(t--){
		int n;
		scanf("%d", &n);
		double a, b;
		a = n;
		b = 100 - n;
		a /= 100;
		b /= 100;
		double temp1 = a, temp2 = b;
		int ans = 1;
		while((a-(int)a != 0) && (b-(int)b != 0)){
			++ans;
			if(ans == 100) break;
			a += temp1;
			b += temp2;
		}
		printf("%d\n", ans);
	}
	return 0;
}

#include <stdio.h>
int main() {
    int t, k, kWater, out, divisor;
    scanf("%d", &t);
    while (t > 0){
        scanf("%d", &k);
        kWater = 100 - k;
        if (k == 0 || kWater == 0){
            printf("%d", 1);
        }
        else {
            if (k > kWater){
                divisor = kWater;
            }
            else {
                divisor = k;
            }
            while (k % divisor !=0 || kWater % divisor !=0){
                divisor--;
            }
            out = k/divisor + kWater/divisor;
        }
        printf("%d\n", out);
        t--;
    }
    return 0;
};

#include <stdio.h>
int solution(int n);
int main()
{
    int t;
    scanf("%d",&t);
    while (t--)
    {
        int n;
        scanf("%d",&n);
        solution(n);
    }
    return 0;
}
int solution(int n)
{
    if (100%n==0)
    {
        printf("%d\n",(100/n));
        return 0;
    }
    else if (100%n!=0)
    {
        printf("%d\n",100);
        return 0;
    }
    return 0;
}

#include <stdio.h>
#include <math.h>

int main(){
    int t,k,i,move;
    double ratio,x;
    scanf("%d",&t);
    while(t--){
        scanf("%d",&k);
        if(k==50){
            move=2;
        }
        else if(k==100){
            move=1;
        }
        else if(k<50){
            ratio=(100.0/k)-1;
            if((int)ratio==ratio){
               move=ratio+1;
            }
            else{
                i=2;
                x=ratio;
                //printf("%lf\n",x);
                while((int)x!=x){
                    x=ratio*i;
                    i=i+1;
                }
                //printf("%d\n",i);
                move=x+i-1;
            }
            //printf("%d\n",move);
        }
        else{
            ratio=(k*1.0)/(100-k);
            if((int)ratio==ratio){
               move=ratio+1;
            }
            else{
                i=2;
                x=ratio;
                while((int)x!=x){
                    x=ratio*i;
                    i=i+1;
                }
                move=x+i-1;
            }
        }
        printf("%d\n",move);
    }
return 0;
}

#include<stdio.h>
int gcd(int k, int water)
{
    if (k == 0)
        return water;
    return gcd(water%k, k);
}
void calculate()
{
    int k,water,g,steps;
    scanf("%d",&k);
    water = 100-k;
    g = gcd(k,water);
    k = k/g;
    water = water/g;
    steps = k+water;
    printf("%d",steps);
}
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=1; i<=t;i++)
    calculate();
    return 0;
}

#include <stdio.h>

typedef long long ll;

ll FindGCD(ll n1, ll n2)
{
    // if user enters negative number, sign of the number is changed to positive
    n1 = ( n1 > 0) ? n1 : -n1;
    n2 = ( n2 > 0) ? n2 : -n2;

 if(n1==100||n2==100)
 {
     return 100;
 }

    while(n1!=n2)
    {
        if(n1 > n2)
            n1 -= n2;
        else
            n2 -= n1;
    }
    return n1;
}

int main()
{
    ll T, k, kc;

    scanf("%lld",&T);

    while(T>0)
    {
        scanf("%lld",&k);
        kc=FindGCD(k,100-k);
        printf("%lld",((k/kc)+((100-k)/kc)));

        T--;
    }
    return 0;
}

#include <stdio.h>
int main()
{
   int t,n;
   scanf("%d",&t);
   while (t--)
   {
       scanf("%d",&n);
       if(100%n==0) printf("%d\n",100/n);
       else printf("100\n");
   }

    }

#include<stdio.h>
int main()
{
    int t, k;
    scanf("%d", &t);
    while (t--)
    {
        scanf("%d", &k);
        if(100%k==0) printf("%d\n",100/k);
        else printf("100\n");
    }
    return 0;
}

#include<stdio.h>

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n;
		scanf("%d",&n);

		if(n==100)
		{
			printf("1\n");
		}
		else{
			float p1=100-n;
			float p2=n;
			int f1=p1/p2;
			float f2=p1/p2;
			if(f1==f2)
			{
				int r=f1+1;
				printf("%d\n",r);
			}
			else
			{
				int r=p1+n;
				printf("%d\n",r);
			}
		}

	}
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

int main(){
	int tt;
	scanf("%d", &tt);
	while(tt--){
		int k, ans = 0, tt = 0;
		scanf("%d", &k);
		int l;
		if(100 % k == 0){
			l = k;
		}else{
			l = 1;
		}
		while(tt != 100){
			ans++;
			tt += l;
		}
		printf("%d\n", ans);
	}
	return 0;
}

#include<stdio.h>
int gcd(int a,int b){
if(a==0) return b;
else return gcd(b%a,a);
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&i);
printf("%d\n",100/gcd(i,100-i));
}
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<math.h>
void input(int ar[],int n)
{
    for(int i=0;i<n;i++)
        scanf("%d",&ar[i]);
}
int small(int a,int b)
{
    if(a<b)
        return a;
    return b;
}
int great(int a,int b)
{
    if(a>b)
        return a;
    return b;
}
int gcd(int a,int b)
{
    for(int i=small(a,b);i>=1;i--)
        if(great(a,b)%i==0)
            return i;
    return 1;
}
int main()
{
    int t;
    scanf("%d",&t);
    for(int l=0;l<t;l++)
    {
        int n;
        scanf("%d",&n);
        printf("%d\n",gcd(100,n));
    }
}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k;
        scanf("%d",&k);
        if(100%k==0)
        {
            printf("%d\n",100/k);
        }
        else
        {
            printf("%d\n",100);
        }
    }
}

#include <stdio.h>
#include <math.h>
int main()
{
    int essence, T, remainder;
    scanf("%d", &T);

    while(T--)
    {
        scanf("%d", &essence);
        if(100 % essence == 0)
        {
            remainder = 100/essence;
            printf("%d\n", remainder);
        }
        else
        {
            printf("100\n");
        }
    }
    return 0;
}

#include <stdio.h>
int main()
{
   int t;
   scanf("%d",&t);
   while (t--)
   {int a,b;
       scanf("%d",&a);
       b=100-a;
       int i=2;
       if(b==0) printf ("1\n");

       else{
       while (i<a&&i<b)
       {
           if(a%i==0&&b%i==0) {
               a/=i;
               b/=i;

           }
           else i++;
       }
       printf("%d\n",a+b);
       }

   }

    }

#include<stdio.h>
int gcd(int a,int b)
{
    if(b==0)return a;
    else return (a%b,a);
}
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k;
        scanf("%d",&k);
        printf("%d\n",100/gcd(k,100));
    }
}

#include <stdio.h>

int main()
{
    int t,i,k,ans;
    scanf("%d",&t);
    for(i=0;i<t;++i)
    {
        scanf("%d",&k);
        if(100%k==0)
            ans=100/k;
        else
            ans=100;
        printf("%d\n",ans);
    }

    return 0;
}

#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int k,p;
scanf("%d",&k);
if((100-k)%k==0)
 p=1+(100-k)/k;
else
 p=100;
printf("%d\n",p);
}
return 0;
}

#include <stdio.h>
int main()
{
    int testcases;
    scanf("%d", &testcases);
    //printf("%d", testcases);
    while (testcases > 0)
    {
        int percent;
        scanf("%d", &percent);
        int cpy = percent;
        int ans = 100;
        while (cpy % 5 == 0)
        {
            cpy /= 5;
            ans /= 5;
        }
        while (cpy % 2 == 0)
        {
            cpy /= 2;
            ans /= 2;
        }
        printf("%d\n", ans);
        testcases--;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n;
    scanf("%d", &n);
    while (n--)
    {
        int m;
        scanf("%d", &m);
        if(100%m == 0)
        {
            printf("%d\n", 100/m);
        }
        else printf("100\n");
    }
    return 0;
}

#include <stdio.h>
int potionMaking(int k)
{   int l;
    if(100%k==0)l=100/k;
    else l=100;
    printf("%d\n",l);
    return 0;
}
int main()
{
   int t;
   scanf("%d",&t);
   for(int i=0;i<t;i++)
   {
       int k;
       scanf("%d",&k);
       potionMaking(k);
   }
    return 0;
}

#include <stdio.h>
int gcd(int a, int b) {
	return a % b == 0 ? b : gcd(b, a % b);
}
int t, k;
int main(void){

	scanf("%d", &t);

		while(t--){
			scanf("%d", &k);
			int a = 100 - k;
			int b = k;
			if(k % 2 == 0) {
				printf("%d\n", 100 / gcd(100, k));
			} else {
				printf("%d\n", 100);
			}
		}
	return 0;
}

#include <stdio.h>
//using namespace std;

int main() {
	// your code goes here
	int t;
	scanf("%d",&t);
	while(t--)
	{
	    int k;
	    scanf("%d",&k);
	    if(100%k==0)
	    {
	        printf("%d\n",(100/k));
	    }
	    else
	    {
	        printf("%d\n",(100));
	    }
	}
	return 0;
}

#include <stdio.h>

int gcd(a,b)
{
 if(b==0) return a;
 return gcd(b,a%b);
}

int main(){

int i,t,k,g,ans;

scanf("%i",&t);

for(i-0;i<t;i++){
scanf("%i",&k);
g = gcd(k,100-k);
ans = 100/g;
 printf("%i",ans);
}

}

#include<stdio.h>
#include<string.h>
#include<math.h>

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int k,sum=0;
        scanf("%d",&k);
        if(100%k==0)
            sum=100/k;
        else
            sum=100;
        printf("%d\n",sum);

    }
    return 0;
}

#include<stdio.h>
int main()
{
    int t,n,k;
    scanf("%d",&t);
    int i;
    for(i=1;i<=t;i++)
    {
        scanf("%d",&n);
        if(100%n==0)
        {
            k=100/n;
            printf("%d\n",k);
        }
        else
        {
            printf("100\n");
        }
    }
    return 0;
}

#include <stdio.h>
int main()
{
   int t,n;
   scanf("%d",&t);
   while (t--)
   {
       scanf("%d",&n);
       if(100%n==0) printf("%d\n",100/n);
       else printf("100\n");
   }

    }

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long double LD;
typedef long long ll;
#define int ll
#define pb push_back
#define mp make_pair
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
// -----<SCANF>-----
#define sfi(x) scanf("%d",&x);
#define sfi2(x,y) scanf("%d%d",&x,&y);
#define sfi3(x,y,z) scanf("%d%d%d",&x,&y,&z);

#define sfl(x) scanf("%lld",&x);
#define sfl2(x,y) scanf("%lld%lld",&x,&y);
#define sfl3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z);
#define sfl4(x,y,z,x1) scanf("%lld%lld%lld%lld",&x,&y,&z,&x1);
#define sfl5(x,y,z,x1,y1) scanf("%lld%lld%lld%lld%lld",&x,&y,&z,&x1,&y1);
#define sfl6(x,y,z,x1,y1,z1) scanf("%lld%lld%lld%lld%lld%lld",&x,&y,&z,&x1,&y1,&z1);

#define sfs(x) scanf("%s",x);
#define sfs2(x,y) scanf("%s%s",x,y);
#define sfs3(x,y,z) scanf("%s%s%s",x,y,z);
// ----</SCANF>-----

// ----<PRINTF>-----
#define pfi(x) printf("%d\n",x);
#define pfi2(x,y) printf("%d %d\n",x,y);
#define pfi3(x,y,z) printf("%d %d %d\n",x,y,z);

#define pfl(x) printf("%lld\n",x);
#define pfl2(x,y) printf("%lld %lld\n",x,y);
#define pfl3(x,y,z) printf("%lld %lld %lld\n",x,y,z);

#define pfs(x) printf("%s\n",x);
#define pfs2(x,y) printf("%s %s\n",x,y);
#define pfs3(x,y,z) printf("%s %s %s\n",x,y,z);

#define pwe(x) printf("%lld ",x); // print without end
// ----</PRINTF>----
long long a,b,c,d,e,t,i,j,n,m,row,col,change,x;

int main()
{

        sfl(t);
        while(t--)
        {
            sfl(n);
            if(n>50 && n!=100 )
            {
                if(100%(n-50)==0)
                {pfl(100/(n-50));

                }
                else
                    pfi(100);
            }
            else
            {
                if(100%n==0)
                {
                    pfl(100/n);
                }

                else
                {
                    pfi(100);
                }
            }
        }

}

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k;
        scanf("%d",&k);
        if((k%2!=0) && (100%k!=0))
        {
            printf("100\n");
            continue;
        }
        int l=100/k;
        printf("%d\n",l);
    }
}

#include<stdio.h>
int gcd(int a,int b){
if(a==0) return b;
else return gcd(b%a,a);
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&i);
printf("%d\n",100/gcd(i,100-i));
}
}

#include <stdio.h>
int main()
{
    int N, x;
    scanf("%d", &N);
    for(int i=0;i<N;i++)
    {
        scanf("%d", &x);
        if(100%x)
            printf("100\n");
        else
            printf("%d\n",100/x);
    }
    return 0;
}

#include <stdio.h>

int main() {
    int t;
    scanf("%d", &t);

    int i = 0;
    while (i < t) {
        int k;
        scanf("%d", &k);

        int water = 100 - k;

        if (water % k == 0) {
            water = water / k;
            k = k / k;
        }

        int steps = water + k;
        printf("%d\n", steps);
        i++;
    }

    return 0;
}

#include<stdio.h>
main()
{
       int n,t,s;
       scanf("%d",&t);
       while(t--)
       {
              scanf("%d",&n);
              s=100;
              while(n!=s)
              {
                     if(n>s)
                     n=n-s;
                     else
                     s=s-n;
              }
              printf("%d",100/n);
       }
}

#include <stdio.h>
int main(){
	int ti;
	scanf("%d",&ti);
	while(ti--){
		int n=0;
		scanf("%d",&n);
		int time;
		if(100%n==0){
			time=100/n;
		}else{
			//找最大公因数
			//判断基数
			int gong=1;
			for(int i=n;i>1;i--){
				if((n%i==0&&100%i==0)){
					gong=i;
					break;
				}
			}
			int ti = n;
			int b=100;
			if(gong!=1){
				while(n%gong==0){
				n=n/gong;
				b=b/gong;
			}
			time=b;
			} else{
				time=100;
			}

		}

		printf("%d\n",time);
	}
	return 0;
}

int find(int x,int y){
	if(x<y) {
		int t=y;y=x;x=t;
	}
	return x%y==0?y:find(y,x%y);
}

main(){
      int k,t;
      scanf("%d",&t);
      while(t--){
            scanf("%d",&k);
			printf("%d",100/find(100,k));
      }
}

#include<stdio.h>
#include<math.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n,k;
scanf("%d",&n);
if(100%n==0)
{
printf("%d\n",100/n);
}
if(100%n!=0)
{
printf("%d\n",100);
}
}

    return 0;
}

#include <stdio.h>
//using namespace std;

int main() {
	// your code goes here
	int t;
	scanf("%d",&t);
	while(t--)
	{
	    int k;
	    scanf("%d",&k);
	    if(100%k==0)
	    {
	        printf("%d\n",(100/k));
	    }
	    else
	    {
	        printf("%d\n",(100));
	    }
	}
	return 0;
}

#include<stdio.h>
int gcd(int a,int b)
{
    if(b==0)return a;
    else return (a%b,a);
}
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int k;
        scanf("%d",&k);
        printf("%d\n",100/gcd(k,100));
    }
}

#include<stdio.h>
int main()
{
	int p;
	scanf("%d",&p);
	while(p>0)
	{
		int i,k,a,b,min,max,c=0,d,flag=0,f;
		scanf("%d",&k);
		a=k;b=100-k;
		if(b==0)
		{
			printf("1");
			flag=1;
		}
		if(a>=b)
		{
			max=a;min=b;
		}
		else
		{
			max=b;min=a;
		}
		for(i=2;i<=min;i=i+1)
		{
			if(max%i==0  && min%i==0)
			{
				c=i;
				//printf("%d",c);
			}
		}
		if(c==0)
		{
			d=100;
		}
		else
		{
			f=max/c;
		    d=min/c;
		    d=d+f;
		    c=0;
		}
		if(flag==0)
		{
			printf("%d\n",d);
		}
		p--;
	}

}

#include <stdio.h>
#include <math.h>
int main()
{
    int essence, T, remainder;
    scanf("%d", &T);

    while(T--)
    {
        scanf("%d", &essence);
        if(100 % essence == 0)
        {
            remainder = 100/essence;
            printf("%d\n", remainder);
        }
        else if(essence % 100 == 0)
        {
            remainder = ceil(essence / 100);
            printf("%d\n", remainder);
        }
        else
        {
            printf("100\n");
        }
    }
    return 0;
}