0
点赞
收藏
分享

微信扫一扫

codeforces 471A MUH and Sticks

慎壹 2022-09-07 阅读 125


​​点击打开链接​​


A. MUH and Sticks



time limit per test



memory limit per test



input



output


Two polar bears Menshykov and Uslada from the St.Petersburg zoo and elephant Horace from the Kiev zoo got six sticks to play with and assess the animals' creativity. Menshykov, Uslada and Horace decided to make either an elephant or a bear from those sticks. They can make an animal from sticks in the following way:

  • Four sticks represent the animal's legs, these sticks should have the same length.
  • Two remaining sticks represent the animal's head and body. The bear's head stick must be shorter than the body stick. The elephant, however, has a long trunk, so his head stick must be as long as the body stick. Note that there are no limits on the relations between the leg sticks and the head and body sticks.

Your task is to find out which animal can be made from the given stick set. The zoo keeper wants the sticks back after the game, so they must never be broken, even bears understand it.


Input



li (1 ≤ li) — the lengths of the six sticks. It is guaranteed that the input is such that you cannot make both animals from the sticks.


Output



Bear" (without the quotes). If you can make an elephant, print string "Elephant" (wıthout the quotes). If you can make neither a bear nor an elephant, print string "Alien" (without the quotes).


Examples



input



4 2 5 4 4 4



output



Bear



input



4 4 5 4 4 5



output



Elephant



input



1 2 3 4 5 6



output



Alien


Note



If you're out of creative ideas, see instructions below which show how to make a bear and an elephant in the first two samples. The stick of length 2 is in red, the sticks of length 4 are in green, the sticks of length 5 are in blue.



codeforces 471A MUH and Sticks_#include

题意:给6个筷子,长短给出来,判断能组成什么动物。

#include<stdio.h>
#include<string.h>
int main()
{
int a[10],k=1,x,b[10];
memset(b,0,sizeof(b));
b[0]=1;
scanf("%d",&a[0]);
for(int i=1; i<6; i++)
{
scanf("%d",&x);
int flag=0;
for(int j=0; j<k; j++)
{
if(a[j]==x)
{
b[j]++;
flag=1;
break;
}
}
if(flag==0)
{
a[k++]=x;
b[k-1]++;
}
}
if(b[0]>=4||b[1]>=4||b[2]>=4)
{
if(b[0]==6)
{
printf("Elephant\n");
return 0;
}
if((b[0]==4&&b[1]==2)||(b[0]==2&&b[1]==4))
printf("Elephant\n");
else
printf("Bear\n");
}
else
printf("Alien\n");
return 0;
}






举报

相关推荐

0 条评论