zoj 2988
/* zoj 2988 */
# include <stdio.h>
# include <string.h>
int main()
{
int n, i, len;
double m;
char ch[2];
scanf("%d", &n);
i = 0;
while (n > 0)
{
scanf("%lf %s", &m, ch);
len = strlen(ch);
if(len == 2)
{
if (ch[0] == 'k')
printf("%d %.4lf lb\n", ++i, 2.2046*m);
else printf("%d %.4lf kg\n", ++i, 0.4536*m);
}
else if (ch[0] == 'g')
printf("%d %.4lf l\n", ++i, 3.7854*m);
else printf("%d %.4lf g\n", ++i, 0.2642*m);
--n;
}
return 0;
}