semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	struct book
	{
		int number;
		char author[10];
	};
	struct book a[1000];
	int i,n,j,count[26]={0},temp,max,index=0;
	char c;
	scanf("%d",&n);
	for(i=0;i<n;i++)
    scanf("%d %s",&a[i].number,&a[i].author);
    for(i=0;i<n;i++)
		for(j=0;a[i].author[j]!='\0';j++)
		{	temp=(a[i].author[j])-'A';
		    count[temp]++;
		}
     max=count[0];
	 for(i=1;i<26;i++)
		 if(count[i]>max)
		 {max=count[i];
			 index=i;
		 }
    c=index+'A';
	printf("%c\n%d\n",c,max);
		 for(i=0;i<n;i++)
			 for(j=0;a[i].author[j]!='\0';j++)
				 if(a[i].author[j]==c)
					 printf("%d\n",a[i].number);
}
void main()
{
	char w[999][26];
	char m;
	int a[999],c[26];
	int i,j,n,t,max;
	scanf("%d",&n);
	for(i=0;i<=25;i++){
		c[i]=0;
	}
	for(i=0;i<=n-1;i++){
		scanf("%d",&a[i]);
		scanf("%s",w[i]);
	}
	for(i=0;i<=n-1;i++){
		for(j=0;w[i][j]!='\0';j++){
			c[w[i][j]-65]+=1;
		}
	}
	max=c[0];
	m=65;
	for(i=0;i<=25;i++){
		if(c[i]>max){
			max=c[i];
			m=i+65;
		}
	}
	printf("%c\n",m);
	printf("%d\n",max);
	for(i=0;i<=n-1;i++){
		for(j=0;w[i][j]!='\0';j++){
			if(w[i][j]==m){
				printf("%d\n",a[i]);
			}
		}
	}
}
int pp[26]={0};

struct st
{
	char name[27];
	int num;
	struct st *next;
};

struct st *creat(int m)
{
	struct st *head,*p1,*p2;
	int i,j;
	p1=(struct st *)malloc(sizeof(struct st));
	scanf("%d %s",&p1->num,p1->name);
	for (j=0;;j++)
	{
		if (isupper(p1->name[j])) pp[p1->name[j]-65]++;
			else break;
	}
	p2=p1;
	head=p1;
	for (i=1;i<m;i++)
	{
		p1=(struct st *)malloc(sizeof(struct st));
		scanf("%d %s",&p1->num,p1->name);
		for (j=0;;j++)
		{
			if (isupper(p1->name[j])) pp[p1->name[j]-65]++;
				else break;
		}
		p1->next=NULL;
		p2->next=p1;
		p2=p1;
	}
	return(head);
}


void main()
{
	struct st *creat();
	struct st *head,*p;
	int n,i,max,j;
	scanf("%d",&n);
	head=creat(n);
	p=head;
	max=0;
	for (i=1;i<26;i++)
		if (pp[i]>pp[max]) max=i;
	printf("%c\n%d\n",max+65,pp[max]);
	while(p)
	{
		for (j=0;;j++)
		{
			if (isupper(p->name[j]))
			{
				if (p->name[j]==(max+65)) printf("%d\n",p->num);
			}
			else break;
		}
		p=p->next;
	}


}
int main()
{
	struct books
	{
		int book;
		char writer[20];
	}bk[1000];
	int n,i,j,m,max,k,maxw=0,flag=0,a[26]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %s",&bk[i].book,bk[i].writer);
	}
	for(i=0;i<n;i++)
	{
		m=strlen(bk[i].writer);
		for(j=0;j<m;j++)
		{
			k=bk[i].writer[j];
			a[k-65]++;
		}
	}
	max=a[0];
	for(i=1;i<26;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
			maxw=i;
		}
	}
	printf("%c\n%d\n",maxw+65,max);
	for(i=0;i<n;i++)
	{
		m=strlen(bk[i].writer);
		for(j=0;j<m;j++)
		{
			if(maxw+65==bk[i].writer[j])
				printf("%d\n",bk[i].book);

		}
	}
	return 0;
}
void main()
{
	struct book
	{
		int num;
		char w[27];
	};
	struct book b[1000];
	int n,i,j,k,c[26]={0},max;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&b[i].num,b[i].w);
	}
	for(i='A';i<='Z';i++)
	{
		for(j=0;j<n;j++)
		{
			for(k=0;k<strlen(b[j].w);k++)
			{
				if(i==b[j].w[k])
				{
					c[i-65]++;
				}
			}
		}
	}
	max=0;
	for(i=1;i<26;i++)
	{
		if(c[i]>c[max])
			max=i;
	}
	printf("%c\n",max+65);
	printf("%d\n",c[max]);
	for(i=0;i<n;i++)
	{
		for(j=0;j<strlen(b[i].w);j++)
		{
			if(b[i].w[j]==max+65)
			{
				printf("%d\n",b[i].num);
				break;
			}
		}
	}
}
/*
 * most books.cpp
 * ??:?????????
 *  Created on: 2012-12-30
 *      Author: ???
 */



int main()
{
	int m=0,num=0,wnum=0,max=0,i=0,j=0;       //??????,??,????,?????
	int books[26][30];                        //??26??????????
	char writer[26],name;                     //????????
	memset(books,0,sizeof(books));            //???
	cin>>m;
	for(i=0;i<m;i++)                          //???????????
	{
		cin>>num>>writer;
		wnum=strlen(writer);
		for(j=0;j<wnum;j++)                   //??????????,?????
			{
			books[writer[j]-65][0]++;
			books[writer[j]-65][books[writer[j]-65][0]]=num;
			}
	}
	for(j=0;j<26;j++)                         //??
		if(max<books[j][0])
			{
			max=books[j][0];
			name=j+65;
			}
	cout<<name<<endl;
	cout<<max<<endl;
	for(j=1;j<=max;j++)
	cout<<books[name-65][j]<<endl;
	return 0;
}
main()
{
  struct book
  {
    int num;
    char name[26];
  }b[1000];
  
  int m,i,j,n[26]={0},max=0,t;
  scanf("%d",&m);
  for(i=0;i<m;i++)
  {  scanf("%d %s",&b[i].num,b[i].name);
  }
  for(i=0;i<m;i++)
  {  
     for(j=0;j<strlen(b[i].name);j++)
     { ++n[b[i].name[j]-65];
     }
  }
  for(i=0;i<26;i++)
  {
    if(n[i]>max)
    { max=n[i];
      t=i+65;
     }
  }
  printf("%c\n",t);
  printf("%d\n",max);
  for(i=0;i<m;i++)
  {
    for(j=0;j<strlen(b[i].name);j++)
    {  if(b[i].name[j]==t)
       printf("%d\n",b[i].num);
    }
  }
}
struct book
{
	int order;
	int num;
	char writer[26];
}b[1000];
int main()
{
	int n,i,j,k,p,q[1000];
	scanf("%d",&n);
	for(i=0;i<=(n-1);i++)
	{
		scanf("%d %s",&b[i].num,b[i].writer);
		b[i].order=i;
	}
	char a[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
	int c[26];
	char d[26]; 
	for(j=0;j<=25;j++)
	{
	   d[j]=0;
	   c[j]=0;
	}
    for(k=0;k<=25;k++)
	{
		for(i=0;i<=(n-1);i++)
		{
           p=strlen(b[i].writer);
		   strcpy(d,b[i].writer);
	       for(j=0;j<=(p-1);j++)
		   {
			   if(d[j]==a[k])
			   {
				   c[k]=c[k]+1;
			   }
		   }
		   for(j=0;j<=25;j++)
		   {
			   d[j]=0;
		   }
		}
	}
	int max=c[0];
	for(i=0;i<=25;i++)
	{
		if(c[i]>max)
		{
			max=c[i];
		}
	}
	char x;
    for(i=0;i<=25;i++)
	{
		if(c[i]==max)
		{
			x=a[i];
			printf("%c\n",a[i]);
			printf("%d\n",c[i]);
		}
	}

	for(i=0;i<=999;i++)
	{
		q[i]=0;
	}
    int r=0;
	char e[26];
	for(i=0;i<=25;i++)
	{
		e[i]=0;
	}
	for(i=0;i<=(n-1);i++)
	{
		p=strlen(b[i].writer);
		strcpy(e,b[i].writer);
		for(j=0;j<=(p-1);j++)
		{
			if(e[j]==x)
			{
                q[r]=b[i].num;
				r=r+1;
			}
		}
		for(j=0;j<=25;j++)
		{
		   e[j]=0;
		}
	}
    int s=0;
	for(i=0;i<=999;i++)
	{
		if(q[i]!=0)
		{
			s=s+1;
		}
	}
	for(i=0;i<=(s-2);i++)
	{
		printf("%d\n",q[i]);
	}
	printf("%d",q[s-1]);

	return 0;
}
int main()
{
	int m,i,j;
	scanf("%d",&m);

	struct Bookinfo
	{
		int number;
		char auther[27];
	};

	struct Bookinfo a[1000];
	for (i=0;i<m;i++)
		scanf("%d %s",&a[i].number,a[i].auther);

	int count[26]={0},max,record;

	for (i=0;i<m;i++)
	{
		int k;
		k=strlen(a[i].auther);
		for (j=0;j<k;j++)
		{
			count[a[i].auther[j]-'A']++;
		}
	}

	max=count[0];
	for (i=0;i<26;i++)
		if (count[i]>=max) 
		{
			max=count[i];
			record=i;
		}

	printf("%c\n%d\n",record+'A',max);

	for (i=0;i<m;i++)
	{
		int n;
		n=strlen(a[i].auther);
		for (j=0;j<n;j++)
			if (a[i].auther[j]==record+'A')
			{
				printf("%d\n",a[i].number);
				break;
			}
	}



	return 0;
}
int main(int argc, char* argv[])
{
	int N;
	int a[26]={0};

	struct book{
		int x;
		char y[27];
	}A[1000];

	scanf("%d",&N);
	int i,j;
	for(i=0;i<N;i++)
	{
		scanf("%d%s",&A[i].x,A[i].y);
		for(j=0;A[i].y[j]!='\0';j++)
		{
			if(A[i].y[j]=='A')
			{
				a[0]++;
			}
			
			else if(A[i].y[j]=='B')
			{
				a[1]++;
			}
			else if(A[i].y[j]=='C')
			{
				a[2]++;
			}
			else if(A[i].y[j]=='D')
			{
				a[3]++;
			}
			else if(A[i].y[j]=='E')
			{
				a[4]++;
			}
			else if(A[i].y[j]=='F')
			{
				a[5]++;
			}
			else if(A[i].y[j]=='G')
			{
				a[6]++;
			}
			else if(A[i].y[j]=='H')
			{
				a[7]++;
			}
			else if(A[i].y[j]=='I')
			{
				a[8]++;
			}else if(A[i].y[j]=='J')
			{
				a[9]++;
			}
			else if(A[i].y[j]=='K')
			{
				a[10]++;
			}
			else if(A[i].y[j]=='L')
			{
				a[11]++;
			}
			else if(A[i].y[j]=='M')
			{
				a[12]++;
			}
			else if(A[i].y[j]=='N')
			{
				a[13]++;
			}
			else if(A[i].y[j]=='O')
			{
				a[14]++;
			}
			else if(A[i].y[j]=='P')
			{
				a[15]++;
			}
			else if(A[i].y[j]=='Q')
			{
				a[16]++;
			}
			else if(A[i].y[j]=='R')
			{
				a[17]++;
			}
			else if(A[i].y[j]=='S')
			{
				a[18]++;
			}
			else if(A[i].y[j]=='T')
			{
				a[19]++;
			}
			else if(A[i].y[j]=='U')
			{
				a[20]++;
			}
			else if(A[i].y[j]=='V')
			{
				a[21]++;
			}
			else if(A[i].y[j]=='W')
			{
				a[22]++;
			}
			else if(A[i].y[j]=='X')
			{
				a[23]++;
			}
			else if(A[i].y[j]=='Y')
			{
				a[24]++;
			}
			else if(A[i].y[j]=='Z')
			{
				a[25]++;
			}
		}
	}

	int p;
	int max;
    p=0;
	max=a[0];
	for (i=0;i<26;i++)
	{
		if (a[i]>max)
		{
			p=i;
			max=a[i];
		}
	}
	char d;
	d=('A'+p);
	printf ("%c\n%d\n",d,max);
	for (i=0;i<N;i++)
	{
		for (j=0;A[i].y[j]!='\0';j++)
		{
			if (A[i].y[j]==(p+'A'))
				printf("%d\n",A[i].x);
		}
	}

		
	


	return 0;
}
void main()
{
	struct book{int num;char author[26];}b[999];
	int a[26]={0},n,i,j,k,max=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d %s",&b[i].num,b[i].author);
	for(i=0;i<26;i++)
	{
		for(j=0;j<n;j++)
		{
			k=0;
			while(b[j].author[k]!='\0')
			{if(b[j].author[k]==i+65)a[i]++;
			k++;}
		}
	}
	for(i=0;i<26;i++)if(max<a[i])max=a[i];
	i=0;
	while(max!=a[i])i++;
	printf("%c\n%d\n",i+65,a[i]);
	for(j=0;j<n;j++)
	{k=0;
	while(b[j].author[k]!=i+65&&b[j].author[k]!='\0')k++;
	if(b[j].author[k]==i+65)printf("%d\n",b[j].num);
	}
}
struct book
{	
   int num;
   char aut[26];
}b[999];
void main()
{
	int i,j,m,n,k,max,p;
	int a[26]={0},q[999]={0};
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d %s",&b[i].num,b[i].aut);
	for(i=0;i<m;i++)
	{
		n=strlen(b[i].aut);
		for(j=0;j<n;j++)
		{
			k=b[i].aut[j];
			a[k-65]++;
		}

	}
	for(i=1,max=a[0],p=0;i<26;i++)
	{
		if(a[i]>max)
		{
			p=i;
			max=a[i];
		}
	}
	printf("%c\n%d",p+65,max);
	for(i=0;i<m;i++)
	{
		n=strlen(b[i].aut);
		for(j=0;j<n;j++)
			if(b[i].aut[j]==(p+65))
				q[i]=1;			
	}
	for(i=0;i<m;i++)
		if(q[i]==1)
			printf("\n%d",b[i].num);	
}
int main()
{
	int bkn,m=1,n,i,j;
	char bka[30];

	struct author
	{
		int num;
		int p[200];
	}
	a[30];
	scanf("%d",&n);
	for(i=1;i<27;i++)
		a[i].num=0;
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&bkn,bka);
		for(j=0;j<strlen(bka);j++)
		{
			a[bka[j]-64].num++;
			a[bka[j]-64].p[a[bka[j]-64].num-1]=bkn;
		}
	}
	for(i=2;i<27;i++)
		if(a[i].num>a[m].num)
			m=i;
	printf("%c\n%d\n",m+64,a[m].num);
	for(i=0;i<a[m].num;i++)
		printf("%d\n",a[m].p[i]);

	
	return 0;
}
struct shu
{
	int hao;
	char zuo[26];
	struct shu*next;
};
int main()
{
	int m,a[26]={0},i,j,b[26][1000],k,max;
	struct shu*p1,*p2,*head=NULL,*p;
	scanf("%d",&m);
    p1=p2=(struct shu*)malloc(len);
	scanf("%d %s",&p1->hao,p1->zuo);
	head=p1;
	for(i=2;i<=m;i++)
	{
		p1=(struct shu*)malloc(len);
		scanf("%d %s",&p1->hao,p1->zuo);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	for(i=0,max=0;i<=25;i++)
	{
		for(p=head,k=1;p!=NULL;p=p->next)
		{
			for(j=0;j<=25;j++)
				if(p->zuo[j]=='A'+i)
				{
					a[i]++;
					b[i][k]=p->hao;
					k++;
				}
		}
		if(a[i]>max)
			max=a[i];
	}
	for(i=0;i<=25;i++)
	{
		if(a[i]==max)
		{
			printf("%c\n%d\n",'A'+i,max);
			for(k=1;k<=max;k++)
				printf("%d\n",b[i][k]);
			break;
		}
	}
	return 0;
}
struct worker
{
	int nm;
	char name1[26];
	struct worker *next;
};
struct zuozhe
{
	char nam;
	int counts;
	int  name[1000];
	struct zuozhe *next;
};
struct worker *creat1(int n)
{
	struct worker *head,*p1,*p2;
	int i;
	head=(struct worker *)malloc(sizeof(struct worker));
	p1=p2=head;
	for(i=0;i<n;i++)
	{
		p2=p1;
		p1=(struct worker *)malloc(sizeof(struct worker));
		scanf("%d %s",&p2->nm,p2->name1);
		p2->next=p1;
	}
	p2->next=0;
	return head;
}
struct zuozhe *creat2()
{
	struct zuozhe *head,*p1,*p2;
	int i;
	head=(struct zuozhe *)malloc(sizeof(struct zuozhe));
	p1=p2=head;
	for(i=0;i<26;i++)
	{
		p2=p1;
		p1=(struct zuozhe *)malloc(sizeof(struct zuozhe));
		p2->counts=0;
		p2->nam='A'+i;
		p2->next=p1;
	}
	p2->next=0;
	return head;
}
void main()
{
	int big=0;
	char zz;
	int i,j;
	char c;
	int m,n;
	int a[26]={0};
	struct worker *head1,*p1,*p2;
	struct zuozhe *head2,*q1,*q2;
	scanf("%d",&n);
	head1=creat1(n);
	p1=p2=head1;
	head2=creat2();
	q1=q2=head2;
	while(p1!=0)
	{
		i=0;
		while(p1->name1[i]!='\0')
		{
			q1=head2;
			while(1)
			{
				if(q1->nam==p1->name1[i])
				{
					q1->name[q1->counts]=p1->nm;
					q1->counts++;
					i++;
					break;
				}
				q1=q1->next;
			}
		}
		p1=p1->next;
	}
	q1=head2;
	while(q1!=0)
	{
		if(q1->counts>big)
		{
			zz=q1->nam;
			big=q1->counts;
		}
		q1=q1->next;
	}
	q1=head2;
	while(1)
	{
		if(q1->nam==zz)
		{
			printf("%c\n%d\n",q1->nam,q1->counts);
			for(i=0;i<q1->counts;i++)
			{
				printf("%d\n",q1->name[i]);
			}
			break;
		}
		q1=q1->next;
	}
}
void main()
{
	int m,a[1000],l[1000],i,j,k,t,time[26]={0},max,q=0;
	char name[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
	char b[1000][26];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d %s",&a[i],b[i]);
		l[i]=strlen(b[i]);
	}
	for(i=0;i<m;i++)
	{
		for(j=0;j<l[i];j++)
		{
			for(k=0;k<26;k++)
			{
				if(b[i][j]==name[k]) time[k]++;
			}
		}
	}
	max=time[0];
	for(i=1;i<26;i++)
	{
		if(time[i]>max) 
		{
			max=time[i];
			t=i;
		}
	}
	printf("%c\n",name[t]);
	printf("%d\n",max);
	for(i=0;i<m;i++)
	{
		for(j=0;j<l[i];j++)
		{
			if(b[i][j]==name[t])
			{
				printf("%d\n",a[i]);
			}
		}
	}
}
struct Book
{
	int id;
	char author[26];
	int flag;
}book[1000];
int main()
{
	int n, i, j, l, max, maxnum;
	int num = 0;
	int a[26] = {0};
	scanf("%d", &n);
	for(i = 0; i < n; i++)
	{
		scanf("%d %s", &book[i].id, book[i].author);
		l = strlen(book[i].author);
		for(j = 0; j < l; j++)
			a[book[i].author[j] - 65]++;
		
	}
	max = 0;
	maxnum = 0; 
	for(i = 0; i < 26; i++)
	{
		if(a[i] > max)
		{
			max = a[i];
			maxnum = i;
		}
	}
	printf("%c\n", maxnum+65);
	for(i = 0; i < n; i++)
	{
		book[i].flag = 0;
		l = strlen(book[i].author);
		for(j = 0; j < l; j++)
			if(book[i].author[j] == maxnum+65)
			{
				num++;
				book[i].flag = 1;
				break;
			}
	}
	printf("%d\n", num);
	for(i = 0; i < n; i++)
		if(book[i].flag == 1)
			printf("%d\n", book[i].id);
	return 0;
}
struct shu
{
	char xh[100];                      /*??*/
	char zz[100];
	struct shu * next;
};

int num[26]={0},m;
struct shu *creat(int n)
{
	int i=0;
	struct shu *p1,*p2,*head;
	p1=p2=(struct shu *)malloc(sizeof(struct shu ));
    head=0;
    while(i<n)
	{
		i++;
		if(i==1)
		{
			p1->next=0;
			head=p1;
		}
		else
		{
			p2=p1;
			p1=(struct shu *)malloc(sizeof(struct shu ));
			p1->next=p2->next;
			p2->next=p1;
		}
		scanf("%s %s",p1->xh,p1->zz);
	}
	return head;
}
void max(struct shu *head)
{
	struct shu *p;
	char *f;
	int i,zd=0;
	for(p=head;p!=0;p=p->next)     /*??p++*/
	{
		for(f=p->zz;*f!='\0';f++)
		{
			num[*f-65]++;
		}
	}
	for(i=0;i<26;i++)
	{
		if(num[i]>zd)
		{
			zd=num[i];
			m=i;
		}
	}
	printf("%c\n",65+m);
	printf("%d\n",zd);            /*???????*/
}

void print(head)
{
	struct shu *p;
	char *f;
	for(p=head;p!=0;p=p->next)                 /*????p++*/
	{
		for(f=p->zz;*f!='\0';f++)
		{
			if(*f==65+m)
			{
				printf("%s\n",p->xh);
				break;
			}
		}
	}
}

	


void main()
{
	int n;
	struct shu *head;
	scanf("%d",&n);
	head=creat(n);
	max(head);
    print(head);
}
struct book
{
	int num;
	char writer[30];
	struct book *next;
};
int n;
struct book *creat(void)
{
	struct book *head;
	struct book *p1,*p2;
	int m=0;
	p1=p2=(struct book*)malloc(len);
	scanf("%d %s",&p1->num,p1->writer);
	head=NULL;
	while(m<n-1)
	{
		m++;
		if(m==1) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct book*)malloc(len);
		scanf("%d %s",&p1->num,p1->writer);
	}
	p2->next=p1;
	p2=p1;
	p2->next=NULL;
	return (head);
}
void main()
{   
	scanf("%d",&n);
	struct book * head,*p1;
	head=creat();
	struct book *p;
	p=head;
	int i;
	int sum[27];
	memset(sum,0,sizeof(sum));
	char m;
    for(p=head;p!=NULL;p=p->next)
	{int x;
		for(i=0;i<strlen(p->writer);i++)
		{
			x=p->writer[i]-'A';
			sum[x]++;
		}
	}
	int max=sum[0];
	for(i=0;i<27;i++)
	{
		if(max<sum[i]) max=sum[i];
	}
	for(i=0;i<27;i++)
	{
		if(sum[i]==max) {printf("%c\n%d\n",'A'+i,sum[i]);m='A'+i;}
	}
	for(p=head;p!=NULL;p=p->next)
	{
		for(i=0;i<strlen(p->writer);i++)
		{
			if(p->writer[i]==m) {printf("%d\n",p->num);break;}
		}
	}

	



		






}
int main(){
	int n,k,i,a[1000],b[1000],c;
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int j=0;
	for(i=0;i<n;i++){
		b[j]=a[i];
		j++;
	}
	for(i=0;i<n;i++){
	for(j=0;j<n;j++){
		if(i!=j){
			c=a[i]+b[j];
			if(c==k){
				printf("yes");
				break;
			}else{
				if(i==n-1&&j==n-2){
					printf("no");
					break;
				}
			}
		}
	}
	if(c==k){
		break;
	}else{
		if(i==n-1&&j==n-2){
			break;
		}
	}
	}
	return 0;
}
int main(){
  int a[1000],b[500000];
  int i,m,n,k,d=0,c;
   scanf("%d",&n);
   scanf("%d",&k);
  for(i=1;i<=n;i++){
    scanf("%d",&(a[i]));
  }
  for(m=1;m<n;m++){
   for(i=1;i<=n-m;i++){
    c=a[m]+a[i+m];
    d=d+1;
    b[d]=c;
   }
  }
  for(i=1;i<=d;i++){
    if(b[i]==k){
     printf("yes");
     break;
   }else if(i==d){
    printf("no");
   }  
 }
 return 0; 
}
int main()
{
	int n,k,a[1000],b[1001],i,q;
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		b[i+1]=a[i];
	}
	for(i=0;i<n;i++)
	{
		for(q=1;q<n+1;q++)
		{
			if(a[i]+b[q]==k){
				printf("yes\n");
				if(q==n){
					q--;
				}
				break;
			}
		}
		if(q<n)
			break;
		if(i==n-1)
		{
			printf("no\n");
		}
		
	}
}
int main(int argc, char* argv[])
{
	int a[1000],n,k,i,j,x;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d ",&a[i]);
	}
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			if(a[i]+a[j]==k){
				x++;
			}
		}
	}
	if(x!=0){
		printf("yes");
	}
	else{
		printf("no");
	}
	return 0;
}
int main(int argc, char *argv[])
{
  int n,k,i=0,j,x=0;
  scanf("%d%d",&n,&k);
  int a[n];
  for(;i<=n-1;i++)
  {scanf("%d",a+i);
  for(j=0;j<=i-1;j++)
  if(a[i]+a[j]==k) {x=1;break;}
  if(x==1) {printf("yes");break;}
  }
  if(x==0) printf("no");
  return 0;
}
/*
 * qujianl.cpp
 *
 *  Created on: 2013-1-17
 *      Author: lenovo
 */


int main(){
	int a[100000]={0},n,k,x,i;
	int ifind=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d",&x);
		if(x>k)
			continue;
		if(a[x]==1){
			ifind=1;
			break;
		}
		a[k-x]=1;
	}
	if(ifind)
		printf("yes");
	else
		printf("no");
	return 0;
}
int main()
{
	int n,k,i,m,p;
	int sz[1000];
	scanf("%d%d\n",&n,&k);
	p=0;
	sz[n]=k;
	for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	
	for(i=0;i<n;i++){
		for(m=n-1;m>i;m--){
			if(sz[i]+sz[m]==sz[n]){
			p=1;
			}
		}
	}
	if(p==1)
		printf("yes");
	if(p==0)
		printf("no");
	return 0;
}
int sz[1010];
int main()
{
	int n,i,a,b,c,h=0,k=0,j=0;
	scanf("%d %d\n",&n,&k);
    scanf("%d",&sz[0]);
    for(i=1;i<n;i++)
	{
		scanf(" %d",&sz[i]);
	}
    for(i=0;i<n;i++)
	{
		
		for(j=n-1;j>i;j--)
		{
			if(sz[i]+sz[j]==k)
			{
				printf("yes");
				h=1;
				break;
			}
		}
		if(h==1)
		{
			break;
		}
	}
	if(h==0)
	{
		printf("no");
	}
	return 0;
}
int main()
{
	int n,k,t,i,a[1000];
	int s=0;
	scanf("%d %d",&n,&k);
	for(i=0;i<=n-1;i++){
		scanf("%d ",&a[i]);
	}
	for(i=0;i<=n-1;i++){
		for(t=i+1;t<=n-1;t++){
			if((a[i]+a[t])==k){
				s+=1;
			}else{
				s+=0;
			}
		}
	}
	if(s==0){
		printf("no");
	}else{
		printf("yes");
	}
	return 0;
}
int main(){
	int sz[1100];
	int n,k,i,j,x;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(i!=j)x=sz[i]+sz[j];
			 if (x==k) break;
		}
		if(x==k)break;
	}
	
	   if(x==k) printf("yes\n");
	
	if(x!=k)
		printf("no\n");
	return 0;

}
int main(){
int n,k;
int sz[1000];
int a,b,c=0;
scanf("%d %d",&n,&k);
for(int i=0;i<n;i++){
        scanf("%d",&sz[i]);
        }
for(int p=0;p<n;p++){
        for(int i=1;i<=n;i++){
                a=sz[p];
                b=sz[i];
                if(a+b==k){c+=1;
                }
                }
                }
if(c==0){printf("no");}
else printf("yes");
return 0;
    }
int main(){
	int n,s[A],k,m,e,i;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++){
	scanf("%d",&s[i]);
	}
	for(i=0;i<n;i++){
		for(m=i+1;m<n;m++){
			e=0;
			e=s[i]+s[m];
			if(s[i]+s[m]==k){
				printf("yes");
				return 0;
			}
		}
	}
	printf("no");
	return 0;
}
int main(){
	int a[1000],n,k,i,j;
	scanf("%d %d",&n,&k);
	for(i=0;i<=n-1;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n-1;i++){
		for(j=1+i;j<=n-1;j++){
				if(a[i]+a[j]==k){
					printf("yes");
					return 0;}
		if(i==n-2&&j==n-1){
		printf("no");
		return 0;}}}

	}
// ???K?????
// ?????????
// ???2012.10.24 
int main()  //??? 
{
	int n,k,i,j,s,t=0,a[1000];   //?????s????t??? 
	cin>>n>>k;   //??n?k 
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}        //??????? 
	for(i=0;i<n-1;i++)
	{
		for(j=1;j<n;j++)
		{
			s=a[i]+a[j];
			if (s==k) t=t+1;
		}
	}    //????????k??? 
	if (t==0) cout<<"no"<<endl;
	else cout<<"yes"<<endl;   //???? 
	return 0;
}
int main()
{
	int n,m,x=0;
	cin>>n>>m;
	int a[n];
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int k=0;k<n-1;k++)
	{
		for(int j=k+1;j<n;j++)
		{
			if(a[j]+a[k]==m)
			{
				x=1;
			}
		}
	}
	if(x==1) cout<<"yes";
	else if(x==0) cout<<"no";
	return 0;
}
void main()
{
	int n,k;
	int a[1000];
	int i,j;
	int num=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
			if(a[i]+a[j]==k)
				num=num+1;
			if(num==0)
				printf("no\n");
			else
				printf("yes\n");
}
int main(){
    int i,j,n,k;
    int s;
    int sz[1000];
    scanf("%d %d",&n,&k);
    for(i=0;i<n;i++){
                     scanf("%d",&sz[i]);
                     }
    for(i=0;i<n-1;i++){
                       for(j=i+1;j<=n-1;j++){
                                            if(sz[i]+sz[j]==k){
                                                  s=1;
                                                  break;
                                                  }
                                            else
                                                   s=0;
                                                   }
                       if(s==1){
                                  printf("yes");
                                  break;
                                  }
                       if(i==n-2&&s==0)  
                                printf("no");
                                }
                               
                                return 0;
}
int main()
{
	int n,k;
	int a[1000];
	cin >>n>>k;
	int i,j;
	for (i=0;i<n;i++)
	{
		cin >>a[i];
		for (j=0;j<i;j++)//?????????????????????????
			if (a[i]+a[j]==k)
			{
				cout <<"yes";
				return 0;//?????????
			}
	}
	cout <<"no";//???????????
	
	return 0;
}
int main (){
int m,e,n,i,j,k,s[1000];
int t=0;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++){
scanf("%d",&(s[i]));
}
for(k=1;k<n;k++){
	for(i=0;i<n-k;i++){
		e = s[i+1];
		s[i+1] = s[i];
		s[i] = e;
}}
for(i=0;i<n;i++){
	for(j=i+1;j<n;j++){
		if((s[i]+s[j])==m){
			t=1;
		}
}}
if(t==1){
printf("yes");
}else{
printf("no");
}






return 0;
}
void main(){
	int n,k,i,j,p,q;
	int a[1000],b[1000];
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
                   b[i]=a[i];
	}
	for(j=0;j<n;j++){
		for(p=0;p<n;p++){
			if(p!=j){
				if(a[j]+b[p]==k){
					q=1;
				}
			}
		}
	}
	if(q==1){
		printf("yes\n");
	}else{
		printf("no\n");
	}
}
int main()
{
	
	int i,j,a,c,e,x,b,d,h;
    int k,n;
	int m[1000],t;
	scanf("%d%d",&n,&x);
	for(i=1;i<=n;i++){
	   scanf("%d",&m[i]);
	}
	for(i=1;i<=n;i++){
		for(j=i+1;j<=n;j++){
			if(m[i]+m[j]==x)
				goto A;	
			}
		}
	A:
	if(i==n+1) printf("no");
	else printf("yes");
	

	return 0;
}
int main(){
	int n,m,i,k,s;
	m=0;
	int sz[LEN],p[LEN];
	scanf("%d%d",&n,&k);
	for(i=0; i<n; i++){
		scanf("%d",&sz[i]);
		p[m]=sz[i];
		m++;
	}
    for(i=0;i<n;i++){
	for(m=0;m<n;m++){
	   s=sz[i]+p[m];
	   if(s==k){
	   break;
	   }
	   }
       if(s==k){
	   break;
	   }
	}
    if(i==n){
		printf("no");
	}
	else{
        printf("yes");
		}
    return 0;
}
void main()
{
	int n,a[1000],i,j,k,jud=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++)scanf("%d",&a[i]);
	for(i=0;i<n;i++){
		for(j=i;j<n;j++)if(a[i]+a[j]==k){jud=1;break;}
		if(jud)break;
	}
	if(jud)printf("yes");
	else printf("no");
}