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

int max(int a, int b) {
    return (a > b ? a : b);
}

// void printspaces(int n) {
//     while ((n--) > 0) {
//         printf("\t");
//     }
// }

int DP[200][200];

int maxTime(int a, int b, int level) {

    if (a <= 0 || b <= 0) {
        return (0);
    } else if (a == 1 && b == 1) {
        return (0);
    } else {
        if (DP[a][b] != 0) {
            return (DP[a][b]);
        }
        DP[a][b] = (1 + max(maxTime(a + 1, b - 2, level + 1),
            maxTime(a - 2, b + 1, level + 1)));
        return (DP[a][b]);
    }
}

int main() {
	//code

	int a;
	int b;
	scanf("%d %d", &a, &b);
	printf("%d", maxTime(a, b, 0));
	return 0;
}

#include "stdio.h"

#define BASE "%d"
typedef int Base;

typedef struct UJoystick
{
    Base Charge;
} UJoystick;

int main()
{
    Base GameTime = 0;
    UJoystick FirstJoystick;
    UJoystick SecondJoystick;
    scanf(BASE BASE, &FirstJoystick.Charge, &SecondJoystick.Charge);

    if (FirstJoystick.Charge == (SecondJoystick.Charge == 1))
    {
        printf(BASE"\n", 0);
        return 0;
    }

    while (FirstJoystick.Charge && SecondJoystick.Charge)
    {
        GameTime++;

        if (FirstJoystick.Charge < SecondJoystick.Charge)
        {
            FirstJoystick.Charge++;
            SecondJoystick.Charge -= 2;
        }
        else
        {
            FirstJoystick.Charge -= 2;
            SecondJoystick.Charge++;
        }
    }

    printf(BASE"\n", GameTime);
    return 0;
}

#include<stdio.h>
#include<conio.h>
main()
{
     int a,b;
     scanf("%d %d",&a,&b);
     int count=0;
     while(a>0&&b>0)
     {    if(a==1&&b==1)
          break;
          else if(a<3)
          {a=a+1;
          b=b-2;
          }
          else if(b<3)
          {a=a-2;
           b=b+1;

          }
          else if(a>b)
          {
               a=a+1;
               b=b-2;
          }
          else
          {
               a=a-2;
               b=b+1;
          }
          count++;
     }
     printf("%d",count);
}

#include<stdio.h>
int Calc(int a, int b)
{
    int i,j;
    int static cnt = 1;

    i = ( a >= b ) ? a : b;
    j = ( a <= b ) ? a : b;

    if((j==1&&i==2)||(j==2&&i==2))
    {
        printf("%d",cnt);
        return 0;
    }
    else if(i==1&&j==1)
    {
        printf("0");
        return 0;
    }

    i = i - 2;
    a = i;
    j = j + 1;
    b = j;
    cnt++;

    Calc(a,b);
}

int main()
{
    int a,b,i,j;
    scanf("%d %d",&a,&b);

    Calc(a,b);

    return 0;
}

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

int find(int x, int y) {
	int m = x, n = y, num = 0;
	if(m == 1 && n == 1) {
		return 0;
	}
	while(m > 0 && n > 0) {
		if(m > n) {
			m = m - 2;
			n = n + 1;
			num++;
		}
		else {
			m = m + 1;
			n = n - 2;
			num++;
		}
	}
	return num;
}

int main() {
	int a1, a2, result;
	scanf("%d%d", &a1, &a2);
	result = find(a1, a2);
	printf("%d", result);
	return 0;
}

#include<stdio.h>
int main()
{
    int a,b,ans=0,temp;
    scanf("%d %d",&a,&b);
    if(a<b)
    {
        temp=a;
        a=b;
        b=temp;
    }
    while(a&&b)
    {
        while(a>=3)
        {
            a-=2;
            b++;
            ans++;
        }
        if(b>a)
        {
            temp=a;
            a=b;
            b=temp;
        }
        if(a==1)
            break;
        if(a==2)
        {
            a-=2;
            ans++;
        }
    }
    printf("%d",ans);
    return 0;
}

#include<stdio.h>

	int main ()
{
	int a,b,count=0;
	scanf("%d%d",&a,&b);
	while(a>0  &&  b>0)
	{
		if(a>b)
		{
			b++;
			a=a-2;
			if(a>=0)
			count++;

		}
		else
		{
			a++;
			b=b-2;
			if(b>=0)
			count++;
		}
	}
	printf("%d",count);

}

#include <stdio.h>
#include <string.h>
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
    int num=0,f=0;
	if(m==2&&n<2){
		num++;
	f++;
	}
	else if(n==2&&m<2){
    num++;
	f++;
	}
    else if(n==2&&m==2){
    	num++;
	f++;
	}
	else{
	while(m>2||n>2){
		while(n>2){
			n-=2;
			m+=1;
			num++;
		}
		while(m>2){
			m-=2;
			n+=1;
			num++;
		}
	}
}
	if(num==0){
		printf("%d",num);
	}
	else{
    if(f==0)
	printf("%d",num+1);
else
printf("%d",num);
}
}

#include <stdio.h>
typedef struct Stick{
                        short a1, a2, Max;
                        void (*Inite)(struct Stick*);
                        void (*MaxDurationGame)(struct Stick*);
                        void (*DispalyMs)(struct Stick*);
}Stick;
void Inite(Stick*);
void MaxDurationGame(Stick*);
void DispalyMs(Stick*);
int main()
{
    Stick s;
    s.Inite = Inite, s.Inite(&s), s.MaxDurationGame(&s), s.DispalyMs(&s);

    return 0;
}
void Inite(Stick* s){
    s->DispalyMs = DispalyMs, s->MaxDurationGame = MaxDurationGame, s->Max = 0;
    scanf("%hd%hd", &s->a1, &s->a2);
}
void MaxDurationGame(Stick* s){
    while(s->a1 > 0 && s->a2 > 0){
        if(1 == s->a1 && 1 == s->a2){ break; }
        if(s->a1 > s->a2){ s->a1 -= 2, s->a2 += 1; }
        else{ s->a2 -= 2, s->a1 += 1; }
        s->Max++;
    }
}
void DispalyMs(Stick* s){
    printf("%hd", s->Max);
}

#include <stdio.h>
#include <string.h>
int n,m;
int f[220][220];
int max(int a,int b)
{
	return a>b?a:b;
}
int dp(int x,int y)
{
	if(x<=0||y<=0||x+y<=2) return 0;
	if(f[x][y]>=0) return f[x][y];
	return f[x][y] = max(dp(x-2,y+1),dp(x+1,y-2))+1;
}
int main()
{
	int i,j;
	memset(f,-1,sizeof(f));
	scanf("%d%d",&n,&m);
	printf("%d",dp(n,m));
	return 0;
}

#include<stdio.h>

int main(void){
	int a,b,i;

	scanf("%d%d",&a,&b);

	for(i=0; ;i++){

		if(a<=b) {
			a=a+1;
			b=b-2;
		}
		else {
			b=b+1;
			a=a-2;
		}
		if(a<=0||b<=0) break;
	}
	if(a==0||b==0) printf("%d\n",i+1);
	else printf("%d",i);

return 0;
}

#include <stdio.h>
int min(int a,int b){
	if(a<b)
		return 1;
	return 0;
}
int main(void) {
	int a,b,charge,time = 0;
	scanf("%d %d",&a,&b);
	if(a==1 && b==1){
		printf("0\n");
		return 0;
	}
	while(a>0 && b>0){
		charge = min(a,b);
		if(charge == 1){
			a++;
			b-=2;
		} else {
			a-=2;
			b++;
		}
		time++;
	}
	printf("%d\n",time);
	return 0;
}

#include<stdio.h>
int min(int x,int y)
{
    if(x>y)
    return y;
    else
    return x;
}
int max(int x,int y)
{
    if(x<y)
    return y;
    else
    return x;
}
/*int game(int a1,int a2)
{
    if(a1==0||a2==0)
    return 0;
    else
    {
        if(a1>=2&&a2<2)
        return 1+game(min(a1-2,a2+1),max(a1-2,a2+1));
        else if(a2>=2&&a1<2)
        return 1+game(min(a1+1,a2-2),max(a1+1,a2-2));
        else if(a1>=2&&a2>=2)
        {if(1+game(min(a1-2,a2+1),max(a1-2,a2+1))>1+game(min(a1+1,a2-2),max(a1+1,a2-2)))
        return 1+game(min(a1-2,a2+1),max(a1-2,a2+1));
        else
        return 1+game(min(a1+1,a2-2),max(a1+1,a2-2));}
    }
}*/
int game(int a1,int a2)
{
    if(a1==0||a2==0)
    return 0;
    if(a1<2&&a2<2)
    return 0;
    else
    return 1+game(min(a1+1,a2-2),max(a1+1,a2-2));
}
int main()
{
    int a1,a2,a[101][101],i,j;
    scanf("%d %d",&a1,&a2);
    printf("%d",game(min(a1,a2),max(a1,a2)));
}

/*
By Syed Rifat Raiyan
IUT CSE-18
I am a beacon of knowledge blazing out across a black sea of ignorance.
*/
#include<stdio.h>
#define SWAP(a,b) {a=a+b; b=a-b; a=a-b;}
int main()
{
    int a1,a2,i,j,mins=0;
    scanf("%d %d",&a1,&a2);
    if(a1==1 && a2==1)
    {
        printf("0");
        return 0;//weeew -_-
    }
    while(a1>0 && a2>0)
    {
    if(a1>a2)
    {
        SWAP(a1,a2);
    }
        a1++;
        a2-=2;
        mins++;
    }
    printf("%d",mins);
    return  0;
}

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

int main(int argc, char const *argv[])
{
	int a1, a2, t = 0;
	scanf("%d %d",&a1,&a2);

	while(a1 > 0 && a2 > 0)
	{
		if(a1 <= 1 && a2 <= 1)
		{
			break;
		}
		else if(a1 < a2)
		{
			a1 = a1 + 1;
			a2 = a2 - 2;
		}
		else
		{
			a1 = a1 - 2;
			a2 = a2 + 1;
		}
		++t;
	}
	printf("%d\n", t);
	return 0;
}

#include<stdio.h>
int maxx(int a,int b)
{
return (a>b)?a:b;
}
int minn(int a,int b)
{
return (a<b)?a:b;
}
int main()
{
    int a, b,min=0;
    scanf("%d%d",&a,&b);
    if(a==b)
    {
    if(a==1)
    printf("0");
    else
    printf("%d",((a-2)*2)+1);
    }
    else
    {
    int aa=maxx(a,b);
    int bb=minn(a,b);
    int f=0,cnt=0;

    while(f==0)
    {
   // printf("%d %d\n",aa,bb);
    if(aa<=0||bb<=0||(aa==1&&bb==1))
    {
    f=1;
    break;
    }
    else
    {
    if(aa>bb)
    {
    aa-=2;
    bb++;
    cnt++;
    }
    else if(bb>aa)
    {
    bb-=2;
    aa++;
    cnt++;
    }
    else
    {
    cnt+=((aa-2)*2)+1;
    break;
    }
    }
    }
    printf("%d",cnt);
    }
    return 0;
}

#include <stdio.h>

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

int main(){
    int ans = 0, a, b;
    scanf("%d%d", &a, &b);
    while(min(a, b) > 0){
        if(a < b){
            a += 1; b -= 2;
        }
        else{
            b += 1; a -= 2;
        }
        if(min(a, b) < 0) break;
        ans++;
    }
    printf("%d\n", ans);
}

#include<stdio.h>
int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
    int c = 0;
    int count = 0;
    //printf("min is %d\nmax is %d\n",min,max);
    while(1)
    {
       // printf("c\n");
        if (n<=0||m<=0) break;
        if (n==1&&m==1) break;
        if (n>m)
        {
            int temp;
            temp = n;
            n = m;
            m = temp;
        }
        n+=1;
        m-=2;
        count = count + 1;
    }
    printf("%d\n",count);
    return 0;
}

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

#define MAX 10005

typedef long long ll;

char temp[MAX];
int i, j;

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

int max(int a, int b){
    return a > b ? a : b;
}

int a, b, dp[105][105];

int solve(int x, int y, int sum){
    if(y <= 0 || x <= 0) return sum;

    if(dp[x][y] + 1) return dp[x][y];
    dp[x][y] = 0;

    int solve1 = sum, solve2 = sum;

    if(x >= 2) solve1 = solve(x - 2, y + 1, sum + 1);
    if(y >= 2) solve2 = solve(x + 1, y - 2, sum + 1);

    return dp[x][y] = max(solve1, solve2);
}

int main(){

    int a, b; scanf("%d%d", &a, &b);
    memset(dp, -1, sizeof(dp));

    printf("%d", solve(a, b, 0));

    return 0;
}

#include <stdio.h>

int main()
{
    int a,b,i,j,cnt=0,temp,mx,mn;
    scanf("%d %d",&a,&b);

    if(a<2 && b<2) {
        printf("0");
        return 0;
    }

    if(a<b) {
        mx = b;
        mn = a;
    }
    else {
        mx = a;
        mn = b;
    }

    for(i=1; ;i++) {
        cnt++;
        mn = mn+1;
        mx = mx-2;
        if(mx == 1 || mx == 2) {
            temp = mn;
            mn = mx;
            mx = temp;
        }
        if(mx == 0)
            break;

    }

    printf("%d",cnt);

}

#include <stdio.h>
#include <stdlib.h>
int checker(int a1,int a2);
int main()
{
    int a1,a2,maxx=0;
    scanf("%d",&a1);
    scanf("%d",&a2);
    if(a1==1&&a2==1){maxx=0;}
    else {maxx=checker(a1,a2);}
    printf("\n%d",maxx);
    return 0;
}

int checker(int a1,int a2){
    int max,min,x,maxxx=0;

if(a1>a2){

        max=a1; min=a2;
    }
     else {max=a2; min=a1;}
    for(;;){
      if(max<min){
          x=max;
          max=min;
          min=x;
      }
        maxxx++;
        min++;
        max=max-2;
       if(max==0){break;}
    }
    return(maxxx);
}

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

int cmp(const void *a , const void *b)
{
	return *(int *)a - *(int *)b;
}

int max(int a,int b)
{
	if(a>b)
		return a;
	else
		return b;
}

int main()
{
	int a,b,ans=0;
	scanf("%d%d",&a,&b);
	while(1)
	{
		if(a<=0||b<=0)
			break;

		if(a<=b)
		{
			a+=1;
			b-=2;
		}
		else
		{
			a-=2;
			b+=1;

		}
		ans++;
	}
	if(a<0 || b<0)
		ans--;
	printf("%d\n",ans );
	return 0;
}

#include<stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int count=0;
    if(a==1&&b==1){printf("%d",count); return 0;}

    for(;;)
    {
       // printf("%d %d\n",a,b);
        if(a<=b){a=a+1;b=b-2;if(b<1){break;} count=count+1;continue;}
        if(b<=a){b=b+1;a=a-2;if(a<1){break;}  count=count+1;continue;}

    }
    printf("%d",count+1);
    return 0;
}

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

int main(){
	int a,b,i,count = 0;
	scanf("%d %d",&a,&b);
	while(a>0 && b>0){
		if(a==1 && b==1){
			break;
		}

		if(a<b)
		{
			a++;
			b -= 2;
			count++;
		}
		else if(a>=b){
			b++;
			a-=2;
			count++;
		}
	}
	printf("%d\n",count);

	return 0 ;
}

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {

	int a1, a2;
	int res = 0;
	int d;
	int *pc, *pf, *t;

	scanf("%d%d", &a1, &a2);

	pf = &a1; pc = &a2;
	while (a1 > 2 || a2 > 2) {
		d = (*pf - 1) / 2;
		res += d;
		*pf -= 2 * d;
		*pc += d;
		t = pc; pc = pf; pf = t;
	}

	if (a1 == 2 || a2 == 2)
		res++;
	printf("%d", res);

}

/*  AUTHOR:AKASH JAIN
*   USERNAME:akash19jain
*   DATE:27/07/2019
*/
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#define SC1(x)          scanf("%lld",&x)
#define SC2(x,y)        scanf("%lld%lld",&x,&y)
#define SC3(x,y,z)      scanf("%lld%lld%lld",&x,&y,&z)
#define SCS(x)          scanf("\n%s", x)
#define PF1(x)          printf("%lld\n",x)
#define PF2(x,y)        printf("%lld %lld\n",x,y)
#define PF3(x,y,z)      printf("%lld %lld %lld\n",x,y,z)
#define REP(i,n)        for(long long i=0;i<(n);i++)
#define FOR(i,a,b)      for(long long i=(a);i<=(b);i++)
#define FORD(i,a,b)     for(long long i=(a);i>=(b);i--)
#define WHILE(n)		while(n--)
#define MEM(a, b)       memset(a, (b), sizeof(a))
#define ITOC(c)         ((char)(((int)'0')+c))
#define MID(s,e)        (s+(e-s)/2)
#define SZ(a)		    strlen(a)
#define MOD             1000000007
#define MAX             10000000005
#define MIN             -10000000005
#define PI              3.1415926535897932384626433832795
#define DEB(x)          printf("The value of \"%s\" is: %d\n",#x,x)
#define CASES           ll t;SC1(t);while(t--)
#define ABS(a)          ((a>0)?a:-(a))

const int INF = 1<<29;
typedef long long ll;
typedef unsigned long long ull;
#define FILEIO(name) \  freopen(name".in", "r", stdin); \   freopen(name".out", "w", stdout);
int cmp(const void * a,const void * b);
long long maxv(long long a,long long b);
long long minv(long long a,long long b);
long long gcd(long long u,long long v);

int main()
{
    ll a,b,ans=0;
    SC2(a,b);
    while(a>0 && b>0)
    {
        if(a<b && b>=2)
        {
            a++;
            b-=2;
        }
        else if(a>=2)
        {
            b++;
            a-=2;
        }
        else
        {
            break;
        }
        ans++;
    }
    PF1(ans);
}

//qsort(arr,n,sizeof(arr[0]),cmp);
int cmp (const void * a, const void * b)
{
    if( *(ll*)a - *(ll*)b < 0 ) return -1;
    if( *(ll*)a - *(ll*)b > 0 ) return 1;
        return 0;
}
long long maxv(long long a,long long b)
{
    if(a>b) return a;
        return b;
}
long long minv(long long a,long long b)
{
    if(a<b) return a;
        return b;
}
long long gcd(long long u,long long v)
{
    if (v == 0) return u;
       return gcd(v, u%v);
}

#include <stdio.h>
int abs(int a) {
  return a>0?a:-a;
}
int min(int a, int b) {
  return a<b?a:b;
}
int main(void) {
  int a,b;
  scanf("%d%d",&a,&b);
  if (a+b==2) printf("0\n");
  else if ((a-b)%3==0)
    printf("%d\n",(min(a,b)+abs(a-b)/3-2)*2+1+abs(a-b)/3);
  else printf("%d\n",abs(a-b)/3+abs(a-b)%3+(min(a,b)+abs(a-b)/3-1)*2);
  return 0;
}

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

int main(void)
{
  int a[2];
  int i, j, k;
  int count;

  scanf("%d %d", &a[0], &a[1]);

  count = 0;
  i = (a[0] < a[1]) ? 0 : 1;
  j = (i == 0) ? 1 : 0;
  if (a[i] == 1 && a[j] == 1) goto out;
  while (a[0] >= 1 && a[1] >= 1) {
    a[i] += 1;
    a[j] -= 2;
    if (a[j] <= 2) {
      k = i;
      i = j;
      j = k;
    }
    count++;
   // printf("%d %d\n", a[i], a[j]);
  }
out:
  printf("%d\n", count);

  return 0;
}

#include<stdio.h>
int main()
{
    int n,m,count=0,t;
    scanf("%d %d",&n,&m);
    if(n>m)
    {
        t=n;
        n=m;
        m=t;

    }
    while(1)
    {
        if(n==1 && m==1)
            break;

        n=n+1;
        m=m-2;
        count++;
        if(m==0)
            break;
       else if(m<=2)
        {
            while(1)
            {
                n=n-2;
                m=m+1;
                count++;
                if(n<=2)
                    break;
            }
            if(n==0)
                break;
        }

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

#include<stdio.h>
int main()
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF){
		int num=0;
		while(a!=0&&b!=0){
			if(a==1&&b==1)
			break;
			if(a>=b){
				a=a-2;
				b=b+1;
				num++;
			}
			else{
				b=b-2;
				a=a+1;
				num++;
			}
		}
		printf("%d\n",num);
	}
	return 0;
}

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

int num=0;

void dian(int a,int b)
{
	num++;
	if(a*b==2||a==2&&b==2)
	{
		return;
	}
	if(a==1&&b==1)
	{
		num--;
		return;
	}
	dian(a>b?(a-2):(a+1),a>b?(b+1):(b-2));

}

int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	dian(a,b);
	printf("%d",num);
	return 0;
}

#include <stdio.h>
#define max(a,b) (a>b?a:b)

int f[200][200];

int res(int a, int b){
    if (f[a][b] > 0 && a > 0 && b > 0)
        return f[a][b];
    if (a <= 0) return 0;
    if (b <= 0) return 0;
    if (a <= 1 && b <= 1) return 0;
    f[a][b] = max(res(a-2,b+1), res(a+1,b-2))+1;
    return f[a][b];
}

int main(){
    int a,b;
    int i, j;
    scanf("%d %d", &a, &b);
    for (i = 0; i <= 200; i++)
        for (j = 0; j <= 200; j++)
            f[i][j] = 0;
    printf("%d", res(a,b));
    return 0;
}

#include<stdio.h>

int main()
{
    int a,b;
    int c=0;
    scanf("%d",&a);
    scanf("%d",&b);
    if(a+b==2){
            printf("%d\n",0);
    }
    else{
    if((a-b)%3==0){
        c=1;
    }

    printf("%d\n",a+b-2-c);
    }
    return 0;
}

#include<stdio.h>
int main(){
	int a,b,plug;
	long long int time;
	scanf("%d%*c%d",&a,&b);
	plug=(a<b?1:2);
	time=0;
	while((a>0) && (b>0)){
	//	printf("%d %d \n",a,b);
	if(a==1 && b==1){
		break;
	}
		if(plug==1){
			a++;
			b=b-2;
		}
		else if(plug==2){
			b++;
			a=a-2;
		}
		time++;
		if(a<=2){
			plug=1;
		}
		else if(b<=2){
			plug=2;
		}
	}
	printf("%64Id",(time));
	return 0;
}

#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	int count=1;

	while(a>0 && b>0)
	{
		if(a==1 && b==1)
			break;
		if(a>b)
		{
			b+=1;a-=2;
		}
		else
		{
			a+=1;b-=2;}
		count++;
	}
	printf("%d\n",count-1);
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int t1,t2,i,j,temp,ct=0;
scanf("%d %d",&t1,&t2);
if(t1<=t2){
i=t1;j=t2;}
else{
i=t2;j=t1;}
if(i<2&&j<2)
    printf("0");
else{
while(j>0)
{
ct++;
i++;j=j-2;
if(j==1||j==2||i==100){

temp=j;j=i;
i=temp;}}
printf("%d",ct);}
return 0;
}

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

int main(void)
{
	int a1, a2, count = 0;
	scanf("%d %d", &a1, &a2);
	while(a1 > 0 && a2 > 0)
	{
		if(a1 > a2) { a2 += 1; a1 -=2; }
		else { a1 += 1; a2 -= 2; }
		count += 1;
	}
	if(a1 < 0 || a2 < 0)  count -= 1;
	printf("%d\n", count);
	return 0;
}

#include <stdio.h>

int main(void)
{
		int arr[2], conn, count = 0;
		scanf("%d %d ", &arr[0], &arr[1]);

		conn = (arr[1] < arr[0]);

		while (arr[0] > 0 && arr[1] > 0 && (arr[0] > 1 || arr[1] > 1)){
				arr[conn] += 1;
				arr[1-conn] -= 2;
				count++;
				conn = (arr[1] < arr[0]);
		}

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

#include<stdio.h>
int compute(int, int, int (*)[200]);
int main(void){

	int count[200][200]={0};

	int a, b;
	scanf("%d%d",&a,&b);
    printf("%d\n",compute(a,b,count));

	return 0;
}

int compute(int a, int b, int (*count)[200]){
   int t = a>b?a:b;
   b = a+b-t;
   a = t;
   if( a < 0 || b < 0)
	   return 0;
   if(a <=2 && b <=2){
	   if ( a < 2 && b < 2)
		   return 0;
	   else
		   return count[a][b]=1;
   }

   if(count[a][b])
	   return count[a][b];
   int m = compute(a+1, b-2, count);
   int l = compute(a-2,b+1, count);

	return count[a][b] = 1+(m>l?m:l);
}

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

int main() {

	int first_joystick, second_joystick, result;

	scanf("%i %i", &first_joystick, &second_joystick);

	if ( (first_joystick-second_joystick)%3 == 0)
		result = first_joystick+second_joystick-3;
	else
		result = first_joystick+second_joystick-2;

	if(result < 0)
		result = 0;

	printf("%i\n", result);

	return 0;
}

#include<stdio.h>
int main(void)
{
	int a,b,t,i=0;
	scanf("%d%d",&a,&b);
	int max,min;
	max=a>b?a:b;
	min=a<b?a:b;
	while(min>=1&&max>1)
	{
		i++;
		max=max-2;
		min=min+1;
		t=max;
	max=max>min?max:min;
	min=t>min?min:t;

	}
	printf("%d",i);
 }

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

int main()
{
	  int stick1, stick2, i;
	  int count = 0;
	  int control = 1;
	  scanf("%d%d",&stick1, &stick2);
	  if(stick1 > stick2)
	  {
		  control = 0;
	  }
	  for(;;)
	  {
		  if(stick1 <= 0 || stick2 <= 0)break;
		  if(1 == control)
		  {
			  stick1++;
			  stick2 -= 2;
		  }
		  else
		  {
			  stick2++;
			  stick1 -= 2;
		  }
		  if(0 == control && stick1 < stick2 &&stick1 -2 <= 0 )
		  {
			  control = 1;
		  }
		  else if(1 == control && stick2 < stick1 &&stick2 - 2 <= 0)
	      {
			  control = 0;
		  }
		  if(stick1 >= 0 && stick2 >= 0)count++;

	  }
	   printf("%d\n",count);
      return EXIT_SUCCESS;
}

#include<stdio.h>
int main()
{
    int a1,a2,x=0;          //有两个操纵杆，只有一个充电器一次能充1%的电，不充电的操纵杆掉2%的电
    scanf("%d%d",&a1,&a2); //输入起始电源
    while(a1>0&&a2>0)
    {
        if(a1==1&&a2==1)           //等于1的时候游戏一分钟也不能玩下去
        {
            break;
        }
        if(a1<a2)
        {
            a2-=2;
            a1+=1;
            x++;
        }
        else
        {
            a1-=2;
            a2+=1;
            x++;
        }

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

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a;
    int b;
    scanf("%d %d",&a,&b);
    int c=0;
    int min=0;
    if(a==1 && b==1)
    {
        printf("0");
        exit(0);
    }
    else if(a==2 && b==2)
    {
        printf("1");
        exit(0);
    }
    if(a<b)
    {
        c=0;
    }
    else
    {
        c=1;
    }
    while(a>0 && b>0)
    {
        if(c==0)
        {
            min++;
            a+=1;
            b-=2;
            if(b==1 || b==2)
            {
                c=1;
                continue;
            }
            else
            {
                continue;
            }
        }
        else if(c==1)
        {
            min++;
            a-=2;
            b+=1;
            if(a==1 || a==2)
            {
                c=0;
                continue;
            }
            else
            {
                continue;
            }
        }
    }
    printf("%d",min);
}

#include <stdio.h>

int main(void) {
  long a,b,count=0;
  scanf("%ld%ld",&a,&b);
  while(a>1 || b>1){
    if(a>b && b>0){
      b++;
      a -=2;
    }
    else if(a<=b && a>0){
      a++;
      b -=2;
    }
    else break;
    //printf("%ld %ld\n",a,b);
    count++;
  }
  printf("%ld\n",count);
  return 0;
}

#include<stdio.h>
char min_char(int a,int b){
	if(a>b)
		return 'b';
	else
		return 'a';
}
int main(){
	int a,b,min=0;
	char ch = 'a';
	scanf("%d%d",&a,&b);

	if(a>b)
		ch = 'b';
	else
		ch = 'a';

	while(a>=1 && b>=1){
		ch = min_char(a,b);
		if(a==1 && b==1)
			break;

		if(a==1){
			a += 1;
			b -= 2;
			ch = 'a';
		}else if(b==1){
			a -= 2;
			b += 1;
			ch = 'b';
		}else if(ch=='a'){
			a += 1;
			b -= 2;
		}else if(ch=='b'){
			a -= 2;
			b += 1;
		}
		//printf("%d %d\n",a,b);
		min++;
	}
	printf("%d",min);
	return 0;
}

#include <stdio.h>
int main(){
  int ch1,ch2;
  scanf("%d%d",&ch1,&ch2);
  int count=0;
  while(ch1>0 && ch2>0){
    if(ch1>ch2){
      ch2++;
      ch1=ch1-2;
    }
    else{
      ch1++;
      ch2=ch2-2;
    }
   if(ch1>=0 && ch2>=0) count++;
  }
  printf("%d",count);

}

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

#define pf printf
#define sf scanf

int main(void){
 //   int n;
//  sf("%d", &n);
 //   int arr[n];
//    for(int i=0;i<n; i++) sf("%d", &arr[i]);

    int a1, a2;
    sf("%d %d", &a1, &a2);
    int mins = 0;
    char c = a1<=2 ? 0 : 1;
    while(a1 > 0 && a2 > 0){
        if(c == 0){
            a1 += 1;
            a2 -=2;
            if(a2 <=2 ) c=1;
        }
        else {
            a2 +=1;
            a1-=2;
            if(a1<=2) c=0;
        }
        mins++;
    }// while
    pf("%d\n", mins);
    return 0;
} //main

#include <stdio.h>
#include <stdlib.h>
int main(void) {
	int p,q,M,N,AIDE,t=0;
	scanf("%d %d",&p,&q);
	if(p<q){
		N = p;
		M = q;
	}else{
		N = q;
		M = p;
	}
	while(M > 0 ){
		M -= 2;
		N += 1;
		if(M==1 || M==2){
			AIDE=M;
			M = N;
			N = AIDE;
		}
		t++;
	}
	printf("%d", t );
	return 0;

}

#include <stdio.h>

int main()
{
	int i,j,a1,a2,c,nc,*min,*max,*temp,t=0;
	scanf("%d %d",&a1,&a2);
	if(a1<=a2)
	{
		min=&a1;
		max=&a2;
	}
	else
	{
		min=&a2;
		max=&a1;
	}
	//printf("%d %d\n",*min,*max);
	if(a1==a2 && a1==2)
	{
		printf("1\n");
		return 0;
	}
	while(*min>0 && *max>0)
	{
		t++;
		(*min)=(*min)+1;
		(*max)=(*max)-2;
		//printf("%d %d\n",a1,a2);

		if((*max)==1 || (*max)==2)
		{
			temp=min;
			min=max;
			max=temp;
		}
	}
	printf("%d\n",t);
	return 0;
}

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

int find(int x, int y) {
	int m = x, n = y, num = 0;
	if(m == 1 && n == 1) {
		return 0;
	}
	if(m == 100 && n == 100) {
		num--;
	}
	while(m > 0 && n > 0) {
		if(m > n) {
			m = m - 2;
			n = n + 1;
			num++;
		}
		else {
			m = m + 1;
			n = n - 2;
			num++;
		}
	}
	return num;
}

int main() {
	int a1, a2, result;
	scanf("%d%d", &a1, &a2);
	result = find(a1, a2);
	printf("%d", result);
	return 0;
}

#include<stdio.h>

	int main ()
{
	int a,b,count=0;
	scanf("%d%d",&a,&b);
	while(a!=0  &&  b!=0)
	{
		if(a>b)
		{
			b++;
			a=a-2;
			count++;

		}
		else
		{
			a++;
			b=b-2;
			count++;
		}
	}
	printf("%d",count);

}

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

int main(void) {
	int a1, a2, ukupno = 0;
	scanf("%d%d", &a1, &a2);
	while (a1 != 0 && a2 != 0){
	 	if (a1 == 1 && a2 == 1) {
			a1++;
			a2++;
		}
		else {
			if (a1 > a2) {
				a2++;
				a1 -= 2;
			}
			else {
				a1++;
				a2 -= 2;
			}
		}
		ukupno++;
	}
	printf("%d", ukupno);

	return 0;
}

#include<stdio.h>
int main()
{
    int p,q,sum=0;
    scanf("%d %d",&p,&q);
    while(p!=0&&q!=0)
    {
        if(p>q)
        {
            p=p-2;
            q=++q;
        }
        else
        {
            q=q-2;
            p=++p;
        }
        ++sum;
    }
    printf("\n%d",sum);
    return 0;
}

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

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {

	int a1, a2;
	int res = 0;
	int d;
	int *pc, *pf, *t;

	scanf("%d%d", &a1, &a2);

	pf = &a1; pc = &a2;
	while (a1 > 2 || a2 > 2) {
		d = (*pf - 1) / 2;
		res += d;
		*pf -= 2 * d;
		*pc += d;
		t = pc; pc = pf; pf = t;
	}

	if (a1 >= 2 && a2 >= 2)
		res++;
	printf("%d", res);

}

#include<stdio.h>

int main(void)
{
    int count = 0, j1, j2;

    scanf("%d %d", &j1, &j2);

    while( (j1 > 0) && (j2 >0) ) {
        if( j1 > j2 ) j1-=2, ++j2;
        else ++j1, j2-=2;
        ++count;
    }

    printf("%d", count);

    return 0;
}

#include<stdio.h>
/*int max_time=0,dp[200][200];
void init()
{
	int i,j;
	for(i=0;i<=100;i++)
	{
		for(j=0;j<=100;j++)
		{
			dp[i][j]=-1;
		}
	}
}
int calc_time(int x,int y,int t)
{
	if(x<=0 || y<=0)
	{
		if(max_time<t)
		{
			max_time=t;
		}
		return max_time;
	}
	if(dp[x][y]!=-1)
	{
		return dp[x][y];
	}
	int y1 = calc_time(x+1,y-2,t+1);
	int z1 = calc_time(x-2,y+1,t+1);
	if(y1>z1)

	{
	return y1;
}
else
{
	return z1;
}
}*/
int main()
{
	int a1,a2,x;
	scanf("%d %d",&a1,&a2);
	//init();
	//int x=calc_time(a1,a2,0);
	if(a1!=a2)
	{
		x=(a1+a2)-2;
	}
	else
	{
		x=(a1+a2)-3;
	}
	printf("%d",x);
	return 0;
}

#include <stdio.h>

int Min(int n, int m)
{
    if(n<=m)
    return n;
    else
    return m;
};

int main()
{
    int n,m, count=0;
    scanf("%d %d", &n, &m);
    while(n>0 && m>0)
    {
        int temp=Min(n,m);
        if(temp==n)
        {
            n+=1;
            m-=2;
        }
        else
        {
            n-=2;
            m++;
        }
        count++;
    }
    printf("%d", count);
    return 0;
}

#include<stdio.h>
int main(){
	int a,b,plug;
	long long int time;
	scanf("%d%*c%d",&a,&b);
	plug=(a<b?1:2);
	time=0;
	while((a>0) && (b>0)){
	//	printf("%d %d \n",a,b);
		if(a<=2){
			plug=1;
		}
		else if(b<=2){
			plug=2;
		}
		if(plug==1){
			a++;
			b=b-2;
		}
		else if(plug==2){
			b++;
			a=a-2;
		}
		time++;
	}
	printf("%64Id",(time));
	return 0;
}

#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	int count=0;
	while(1>0)
	{
		if(a<=b)
		{
			a+=1;
			b-=2;
		}
		else if(a>b)
		{
			a-=2;
			b+=1;
		}
		count++;
		if(a==0||b==0)
			break;
	}
	printf("%d\n",count);
	return 0;
}

/*hks3*/
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a1,a2,charge,i = 0;
    scanf("%d%d",&a1,&a2);
    charge = 1;
    while(a1 >= 1 && a2 >= 1)
    {
        if (a1 <= 2)
        {
            charge = 1;
        }
        else if (a2 <= 2)
        {
            charge = 0;
        }
        else if (a1 <= a2)
        {
            charge = 1;
        }
        if (charge)
        {
            a1 += 1;
            a2 -= 2;
        }
        else
        {
            a1 -= 2;
            a2 += 1;
        }
        i++;
    };
    printf("%d",i);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a;
    int b;
    scanf("%d %d",&a,&b);
    int c=0;
    int min=0;
    if(a<b)
    {
        c=0;
    }
    else
    {
        c=1;
    }
    while(a>0 && b>0)
    {
        if(c==0)
        {
            min++;
            a+=1;
            b-=2;
            if(b==1 || b==2)
            {
                c=1;
                continue;
            }
            else
            {
                continue;
            }
        }
        else if(c==1)
        {
            min++;
            a-=2;
            b+=1;
            if(a==1 || a==2)
            {
                c=0;
                continue;
            }
            else
            {
                continue;
            }
        }
    }
    printf("%d",min);
}

#include<stdio.h>
int main(){
    int a,b,c,d;
    scanf("%d%d",&a,&b);

    int max,min;
    max=a;
    if(b>a)
    {
        max=b; min =a;
    }
    else{
            max=a; min=b;}

    int breaker=-1;
    int ind=1;
    int cnt=0;
    while(max!=0 && min !=0 && max!=100 && min!=100){
    if(max<=2 && min<=2)
    {
        breaker=1;
        break;
    }
    if(ind==1){
        while(min>2){
                max++;
                min-=2;
                cnt++;
        }
        ind=2;
    }
    else{
        while(max>2){
                min++;
                max-=2;
                cnt++;
        }
        ind=1;

    }

    }
    if(breaker==1)
        cnt++;
    printf("%d",cnt);

}

#include<stdio.h>
int main()
{
    int a,b,ans;
    scanf("%d %d",&a,&b);
    if(a==b||a%2==0||b%2==0)
    {
        ans=a+b-3;
        if(ans<0)
            ans=0;
        printf("%d",ans);
    }
    else
    {
        ans=a+b-2;
        printf("%d",ans);
    }
    return 0;
}

#include<stdio.h>
int main(){
	int a,b,plug;
	long long int time;
	scanf("%d%*c%d",&a,&b);
	plug=(a<b?1:2);
	time=0;
	while((a>0) && (b>0)){
	//	printf("%d %d \n",a,b);
		if(plug==1){
			a++;
			b=b-2;
		}
		else if(plug==2){
			b++;
			a=a-2;
		}
		time++;
		if(a<=2){
			plug=1;
		}
		else if(b<=2){
			plug=2;
		}
	}
	printf("%64Id",(time));
	return 0;
}

#include <stdio.h>
int main()
{
	int a,b,flag=0,count=0;
	scanf("%d %d",&a,&b);
	if(a>b)
	{
		flag=1;
	}
	while(a>0&&b>0)
	{

		if(flag==1)
		{
			a=a-2;
			b=b+1;
			if(a<=3)
			{
				flag=0;
			}
		}
		else
		{
			b=b-2;
			a=a+1;
			if(b<=3)
			{
				flag=1;
			}
		}
		count++;
	}
	printf("%d\n",count);
	return 0;
}

#include <stdio.h>

int main() {
	// your code goes here
	int a[2],time=1,min=0;
	scanf("%d",&a[0]);
	scanf("%d",&a[1]);

	if(a[0]<=a[1])
		min=0;
	else min=1;

	while(a[(min+1)%2]>2){
		a[min]=a[min]+1;
		a[(min+1)%2]=a[(min+1)%2]-2;
		time=time+1;
		if(a[(min+1)%2] <= 2)
			min=(min+1)%2;

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

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

int num=0;

void dian(int a,int b)
{
	num++;
	if(a==1&&b==1||a*b==2||a==2&&b==2)
	{
		return;
	}
	dian(a>b?(a-2):(a+1),a>b?(b+1):(b-2));

}

int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	dian(a,b);
	printf("%d",num);
	return 0;
}

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

int main(int argc, char const *argv[])
{
	int a1, a2, t = 0;
	scanf("%d %d",&a1,&a2);

	while(a1 > 0 && a2 > 0)
	{
		if(a1 < a2)
		{
			a1 = a1 + 1;
			a2 = a2 - 2;
		}
		else
		{
			a1 = a1 - 2;
			a2 = a2 + 1;
		}
		++t;
	}
	printf("%d\n", t);
	return 0;
}

#include<stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int count=0;
    for(;;)
    {
       // printf("%d %d\n",a,b);
        if(a<=b){a=a+1;b=b-2;if(b<1){break;} count=count+1;continue;}
        if(b<=a){b=b+1;a=a-2;if(a<1){break;}  count=count+1;continue;}

    }
    printf("%d",count+1);
    return 0;
}

#include<stdio.h>
int main(){
    int a,b,c,d;
    scanf("%d%d",&a,&b);
    if(a==100 && b==100){
    --b;}
    int max,min;
    max=a;
    if(b>a)
    {
        max=b; min =a;
    }
    else{
            max=a; min=b;}

    int breaker=-1;
    int ind=1;
    int cnt=0;
    while(max!=0 && min !=0){
    if(max<=2 && min<=2)
    {
        breaker=1;
        break;
    }
    if(ind==1){
        while(min>2 && max!=100){
                max++;
                min-=2;
                cnt++;
        }
        ind=2;
    }
    else{
        while(max>2 && min!=100){
                min++;
                max-=2;
                cnt++;
        }
        ind=1;

    }

    }
    if(breaker==1)
        cnt++;
    printf("%d",cnt);

}

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {

	int a1, a2;
	int res = 0;
	int d;
	int *pc, *pf, *t;

	scanf("%d%d", &a1, &a2);

	pf = &a1; pc = &a2;
	while (a1 > 2 || a2 > 2) {
		d = (*pf - 1) / 2;
		res += d;
		*pf -= 2 * d;
		*pc += d;
		t = pc; pc = pf; pf = t;
	}

	printf("%d", res + 1);

}

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

int main(void) {
	int a1, a2;
	scanf("%d %d", &a1, &a2);
	int ukupno = 0;
	while (1){
		if (a1 == 0 || a2 == 0) break;
		else if (a1 == 1) {
			a1 ++;
			a2 -= 2;
		}
		else if (a1 == 1 && a2 == 1) {
			a1 = a2 = 2;
		}
		else if (a2 == 1){
			a2++;
			a1 -= 2;
		}
		else {
			if (a1 > a2) {
				a2++;
				a1 -= 2;
			}
			else {
				a1++;
				a2 -= 2;
			}
		}
		ukupno++;

	}
	printf("%d", ukupno);

	return 0;
}

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

int main(void) {
	int a1, a2;
	scanf("%d %d", &a1, &a2);
	int ukupno = 0;
	while (1){
		if (a1 == 0 || a2 == 0) break;
		else if (a1 == 1 && a2 == 1) {
			a1++;
			a2++;
		}
		else if (a1 == 1) {
			a1 ++;
			a2 -= 2;
		}
		else if (a2 == 1){
			a2++;
			a1 -= 2;
		}
		else {
			if (a1 > a2) {
				a2++;
				a1 -= 2;
			}
			else {
				a1++;
				a2 -= 2;
			}
		}
		ukupno++;

	}
	printf("%d", ukupno);

	return 0;
}

#include<stdio.h>

int main()
{
	int a,b,n=0;
	scanf("%d",&a);
	scanf("%d",&b);
	while(a>0 && b>0)
	{
		n++;
		if(a>b)
		{
			a=a-2;
			b++;
		}
		else
		{
			a++;
			b=b-2;
		}
	}
	printf("%d\n",n);
	return 0;
}

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

// int cmpfunc (const void * a, const void * b)
// {
//    return ( *(int*)a - *(int*)b );
// }

int main()
{
    int counter=0,chargeA,chargeB,i;
    scanf("%i%i",&chargeA,&chargeB);

    while(chargeA>0 && chargeB>0)
    {
        if(chargeA<=chargeB)
        {
            chargeA += 1;
            chargeB -= 2;
            ++counter;
        }

        else
        {
            chargeB += 1;
            chargeA -= 2;
            ++counter;
        }
    }

    printf("%i\n",counter);

    return 0;
}

#include<stdio.h>

int main()
{

    int c, nc, t = 0, ch;
    scanf("%d %d", &c, &nc);
    while(c > 0 || nc > 0)
    {

        if(nc < c)
        {

            ch = nc;
            nc = c;
            c = ch;
        }
        nc = nc - 2;
        c = c + 1;
        t = t + 1;
    }
    printf("%d\n", t - 3);
    return 0;
}

#include<stdio.h>
int main()
{
	int a, b, c;
	scanf("%d %d", &a, &b);
	if (a == 1 && b == 1)
	{
		printf ("0");
		return 0;
	}
	if (a == 1 || b == 1)
	{
		printf ("%d", a + b - 3);
		return 0;
	}
	if (a - b == 0) printf("%d", a + b - 3);
	if (a - b != 0) printf("%d", a + b - 2);
	return 0;
}

#include<stdio.h>
int xx(int a,int b)
{
if(a<0||b<=0)
return 0;
else
{
if(a>=b)
{
b+=1;
a-=2;
}
else
{
a+=1;
b-=2;
}
return 1+xx(a,b);
}

}

int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",xx(a,b));
return 0;
}

#include <stdio.h>
#include <math.h>
int max(int a,int b)
{
	if (a>b)return a;
	return b;
}
int min(int a,int b)
{
	if (a>b)return b;
	return a;
}
int main ()
{
	int a,b,c,d,x;
	scanf ("%d%d",&a,&b);
	c=max(a,b);
	d=min(a,b);
	x=(c-d)/3;
	c=c-2*x;
	d=d+x;
	if (c==d)
		x+=2*c-3;
	else if (fabs(a-b)==2)
		x+=2*min(c,d);
	else if (fabs(a-b)==1)
		x+=2*min (a,b)-1;
	printf ("%d\n",x);
}

#include <stdio.h>
int main()
{
    int x,y,c=0;
    scanf("%d%d",&x,&y);
    while(x!=0 && y!=0)
    {
        if(x>y)
        {
            y++;
            x=x-2;
        }
        else if (y>x)
        {
            x++;
            y=y-2;
        }
        else if (x==y)
        {
            x=x-2;
        }
        c++;
    }
    printf("%d",c);
    return 0;
}

/**
* I'm sorry I was an Idiot
*/
#include<stdio.h>

int main(){
	int a,b;
	scanf( "%d %d",&a,&b);
	if(b < a){
		int temp = a;
		a = b;
		b = temp;
	}
	int totalMin = 0;
	//int m = 0;
	while(1){
		if(a <= 2 && b <= 2){
			++totalMin;
			break;
		}
		int max = b >> 1;
		if(b % 2 == 0)
			--max;
		//printf("max es %d\n",max);
		totalMin += max;
		a += max;
		b -= (max) << 1;
		//printf("%d %d\n",a,b);
		int temp = a;
		a = b;
		b = temp;
		//++m;
	}
	printf("%d\n",totalMin);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    int a,b,i;
    scanf("%d%d",&a,&b);
    for(i=1;a>0 && b>0;i++)
    {
        if(a>b)
        {
            a=a-2;
            b=b+1;
        }
        else
        {
            a=a++;
            b=b-2;
        }
    }
    printf("%d",i-1);
    return 0;
}

#include<stdio.h>
int main(void){
	int lista[220][2],listb[220][2];
	scanf("%d %d",&lista[0][0],&listb[0][0]);
	int time=0;
	int num[2]={1,0};
	int flag=0;
	for (;num[flag];time++){
		int oppo=1-flag;
		num[oppo]=0;
		for (int i=0;i<num[flag];i++){
			int x=lista[i][flag];
			int y=listb[i][flag];
			if (y-2>0){
				int appear=0;
				for (int j=0;j<num[oppo];j++){
					if (lista[j][oppo]==x+1&&listb[j][oppo]==y-2){
						appear=1;
						break;
					}
				}
				if (!appear){
					lista[num[oppo]][oppo]=x+1;
					listb[num[oppo]++][oppo]=y-2;
				}
			}
			if (x-2>0){
				int appear=0;
				for (int j=0;j<num[oppo];j++){
					if (lista[j][oppo]==x-2&&listb[j][oppo]==y+1){
						appear=1;
						break;
					}
				}
				if (!appear){
					lista[num[oppo]][oppo]=x-2;
					listb[num[oppo]++][oppo]=y+1;
				}
			}
		}
		flag=oppo;
	}
	printf("%d",time);
}

#include<stdio.h>
int main()
{
    int a , b , min , max ;

    scanf("%d%d",&a,&b);

    min = a > b ? b : a ;

    max = a+b-min ;
    b = 0 ;
    while(min > 0 && max > 0)
    {
        max -= 2;
        min++ ;
        if(max <= 0)break;
        b++;
        if(min > max){
            a = min ;
            min = max ;
            max = a ;
        }
    }
    printf("%d",b);
    return 0 ;

}

#include <stdio.h>
int n,m,ans;
int main()
{
	scanf("%d%d",&n,&m);
	for(ans=1;;ans++)
	{
		if(n<=2) { n++; m-=2;}
		else if(m<=2) { m++; n-=2;}
		else if(n>m) { n++; m-=2;}
		else { m++; n-=2;}
		if(n<=0||m<=0) break;
	}
	printf("%d",ans);
	return 0;
}

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

    int a,b;
    long long min = 0;

    scanf("%d %d",&a,&b);
    if(a == 1 && b == 1)
        printf("0");
    else
    while(a > 0 && b > 0){
        if(a == 1 || a == 2){
            a = a + 1;
            b = b - 2;
        }
        else{
            b = b + 1;
            a = a - 2;
        }

        min = (long long)(min + 1);

    printf("%I64d",min);
    }
}

#include <stdio.h>
#include <stdlib.h>
int memo[101][101];
void init(){
	int i=0,j=0;
	for(i=0;i<101;i++){
		for(j=0;j<101;j++){
			memo[i][j] = -1;
		}
	}
}
int max(int a,int b){ return (a>b)?a:b; }
int count(int a,int b){
	if(a<=0||b<=0) return 0;
	if(memo[a][b] != -1) return memo[a][b];
	memo[a][b] = 1+max(count(a+1,b-2),count(a-2,b+1));
	return memo[a][b];
}
int main(){
	int a,b;
	init();
	scanf("%d%d",&a,&b);
	int rez = count(a,b);
	printf("%d\n",rez);
	return 0;
}

#include <stdio.h>
int abs(int a) {
  return a>0?a:-a;
}
int min(int a, int b) {
  return a<b?a:b;
}
int main(void) {
  int a,b;
  scanf("%d%d",&a,&b);
  if (a+b<4) printf("0\n");
  else if ((a-b)%3==0)
    printf("%d\n",(min(a,b)+abs(a-b)/3-2)*2+1+abs(a-b)/3);
  else printf("%d\n",abs(a-b)/3+abs(a-b)%3+(min(a,b)+abs(a-b)/3-1)*2);
  return 0;
}

#include <stdio.h>

int main(){

	int p1, p2, total;

	scanf("%d %d",&p1,&p2);
	total = 1;
	while(p1-2 >= 1 || p2-2 >= 1){
		if(p1 <= p2){
			p1++;
			p2 -= 2;
			total++;
		}
		else if(p1 > p2){
			p2++;
			p1 -= 2;
			total++;
		}
	}
	printf("%d", total);

	return 0;
}

#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	int count=1;
	while(a!=0 && b!=0)
	{
		if(a>b)
		{
			b+=1;a-=2;
		}
		else
		{
			a+=1;b-=2;}
		count++;
	}
	printf("%d\n",count-1);
}

#include <stdio.h>
#include <string.h>
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
    int num=0,f=0;
	if(m==2){
		num++;
	f++;
	}
	else if(n==2){
    num++;
	f++;
	}
    else if(n==2&&m==2){
    	num+=2;
	f++;
	}
	else{
	while(m>2||n>2){
		while(n>2){
			n-=2;
			m+=1;
			num++;
		}
		while(m>2){
			m-=2;
			n+=1;
			num++;
		}
	}
}
	if(num==0){
		printf("%d",num);
	}
	else{
    if(f==0)
	printf("%d",num+1);
else
printf("%d",num);
}
}

#include <stdio.h>

int main(void) {
	int r[2],conn=0,min=-1;
	scanf("%d%d",&r[0],&r[1]);
	while(1){
		if(r[0]>r[1]) conn=1;
		else conn=0;
		r[conn]++;
		r[!conn]-=2;
		if(r[0] < 0 || r[1] < 0) break;
		min++;
	}
	printf("%d",min);

	return 0;
}

#include<stdio.h>
int main()
{
    int a , b , min , max ;

    scanf("%d%d",&a,&b);
    if(a-2 <=0 && b-2 <=0){
        printf("0");
        return 0 ;
    }
    min = a > b ? b : a ;

    max = a+b-min ;
    b = 0 ;
    while(min > 0 && max > 0)
    {
        max -= 2;
        min++ ;
        b++;
        if(min > max){
            a = min ;
            min = max ;
            max = a ;
        }

    }
    printf("%d",b);
    return 0 ;

}

#include<stdio.h>
int main()
{
    int x,y,i,k,j,z;
    scanf("%d %d",&x,&y);
    for(i=1;;i++)
    {
       if(x>=y)
       {
           x=x-2;
           y=y+1;
       }
       else
       {
           y=y-2;
           x=x+1;
       }
       if(x<=0||y<=0)
       {
           break;
       }
    }
    printf("%d\n",i);
    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>
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>
#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 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>
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 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<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;
}

#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>
#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 <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 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,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>

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 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 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>

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>
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 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 <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<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>
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>
#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>
#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 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>
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>
#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;
}

#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>
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>
#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 <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 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 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>
#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>
#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>
#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 <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(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>

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>

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>
#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>

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>
#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;
}

#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>
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 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>
#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>

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>
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>
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>

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\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>
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 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 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 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);
    }
}

/* 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;
}

// 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);
        }
    }
}

#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 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>
//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;
}