#include <stdio.h>
#include <stdlib.h>
typedef struct field{
char name[20];
double cm,kg,BMI;
struct field *next;
int x;
}cell;
int main(void){
cell head,*a,*b,*new;
head.next=NULL;
while(1){
new
=(cell
*)malloc(sizeof(cell
)); scanf("%19s", new
->name
);
if(new->name[0]!='0'){
new->BMI=new->kg/(0.0001*new->cm*new->cm);
a=&head;
while(a->next != NULL && new->BMI > a->next->BMI){
a = a->next;
}
new->next = a->next;
a->next = new;
}
else{
break;
}
}
for (a=head.next;a!=NULL;a=b){
printf("%f %f %f %s\n",a
->BMI
,a
->cm
,a
->kg
,a
->name
); b = a->next;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCgp0eXBlZGVmIHN0cnVjdCBmaWVsZHsKICAgIGNoYXIgbmFtZVsyMF07CiAgICBkb3VibGUgY20sa2csQk1JOwogICAgc3RydWN0IGZpZWxkICpuZXh0OwogICAgaW50IHg7Cn1jZWxsOwoKCmludCBtYWluKHZvaWQpewogICAgCiAgICBjZWxsIGhlYWQsKmEsKmIsKm5ldzsKICAgIAogICAgCiAgICBoZWFkLm5leHQ9TlVMTDsKICAgIAogICAgd2hpbGUoMSl7CiAgICAgICAgbmV3PShjZWxsKiltYWxsb2Moc2l6ZW9mKGNlbGwpKTsKICAgICAgICBzY2FuZigiJTE5cyIsIG5ldy0+bmFtZSk7CiAgICAgICAgCiAgICAgICAgaWYobmV3LT5uYW1lWzBdIT0nMCcpewogICAgICAgICAgICAKICAgICAgICAgICAgc2NhbmYoIiVsZiIsJm5ldy0+Y20pOwogICAgICAgICAgICBzY2FuZigiJWxmIiwmbmV3LT5rZyk7CiAgICAgICAgICAgIAogICAgICAgICAgICBuZXctPkJNST1uZXctPmtnLygwLjAwMDEqbmV3LT5jbSpuZXctPmNtKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIGE9JmhlYWQ7CiAgICAgICAgICAgIAogICAgICAgICAgICB3aGlsZShhLT5uZXh0ICE9IE5VTEwgJiYgbmV3LT5CTUkgPiBhLT5uZXh0LT5CTUkpewogICAgICAgICAgICAgICAgYSA9IGEtPm5leHQ7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgCiAgICAgICAgICAgIG5ldy0+bmV4dCA9IGEtPm5leHQ7CiAgICAgICAgICAgIGEtPm5leHQgPSBuZXc7CiAgICAgICAgICAgIAogICAgICAgIH0KICAgICAgICBlbHNlewogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgCiAgICB9CiAgICAKICAgIGZvciAoYT1oZWFkLm5leHQ7YSE9TlVMTDthPWIpewogICAgICAgIHByaW50ZigiJWYgJWYgJWYgJXNcbiIsYS0+Qk1JLGEtPmNtLGEtPmtnLGEtPm5hbWUpOwoJYiA9IGEtPm5leHQ7CglmcmVlKGEpOwogICAgfQogICAgCiAgICByZXR1cm4gMDsKfQo=