Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
650 B
23
Indexable
Never
#include<stdio.h>
int chiahet(int n, int k)
{
	int a[100];
	int b[100];
	int i,c;
	for(i = 0;i<n;i++)
	{
		a[i] = i+1;
	}
	
	for(i = 0;i<k;i++)
	{
		b[i] = 2;
	}
	
	c = 0;
	
    for(i = 0;i<n;i++)
    {
    	
    	if(a[i] % 2 == 0)
    	{
    		a[i] = a[i] / 2;
    		a[i+1] = a[i] * a[i+1];
    		b[c] = 1;
    		c++;
    		if(c == k)
    		{
    			break;
			}
		}
		else
		{
			a[i+1] = a[i] * a[i+1];
		}
	}
	
	
	for(i = 0;i<k;i++)
	{
		if(b[i] == 2)
		{
			return 0;
		}
	}
	return 1;
}


int main()
{   
    int n,k;
    scanf("%d %d",&n,&k);
    if(chiahet(n,k) == 1)
    {
    	printf("Yes\n");
	  }
	else
	{
		printf("No\n");
	}
	return 0;
}