시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 581 405 354 72.393%

문제

싸이가 강남 스타일로 2012년 10월 4일 현재 빌보드 핫100 차트 2위에 2주 연속 랭크되고 있다. 싸이는 곧 다시 미국으로 가서 해외 활동할 예정이라고 한다.

하지만 미국은 한국과 사용하는 단위 체계가 다르다. 한국은 미터법을 사용하지만, 미국은 미국 단위계를 사용한다. 싸이를 위해 단위를 바꾸어 주는 프로그램을 작성하시오.

아래 표를 참고해서 계산하면 되고, 킬로그램 <-> 파운드, 리터 <-> 갤런만 변환하면 된다.

종류 미터법 미국 단위계
무게 1.000 킬로그램 2.2046 파운드
  0.4536 킬로그램 1.0000 파운드
부피 1.0000 리터 0.2642 갤런
  3.7854 리터 1.0000 갤런

입력

첫째 줄에 테스트 케이스의 개수 T(1<=T<=1,000)가 주어진다. 각 테스트 케이스는 한 줄로 이루어져 있다. 첫 번째 숫자는 값이고, 두 번째 등장하는 문자는 단위이다. 값은 소수일 수도 있고, 이 경우 소수점 아래 최대 넷째 자리까지 주어진다. 단위는 kg, lb, l, g 중 하나이며, 순서대로 킬로그램, 파운드, 리터, 갤런이다.

출력

각 테스트 케이스에 대해서 바꾼 값과 단위를 출력한다. 값은 반올림해서 소수점 4째자리까지 출력한다. 단위는 kg, lb, l, g중 하나이며, 설명은 입력 설명에 있다.

예제 입력 1

5
1 kg
2 l
7 lb
3.5 g
0 l

예제 출력 1

2.2046 lb
0.5284 g
3.1752 kg
13.2489 l
0.0000 g
W3sicHJvYmxlbV9pZCI6IjI3MTIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJiZjhcdWFkNmQgXHVjMmE0XHVkMGMwXHVjNzdjIiwiZGVzY3JpcHRpb24iOiI8cCBzdHlsZT1cInRleHQtYWxpZ246IGNlbnRlcjtcIj48aWZyYW1lIGFsbG93ZnVsbHNjcmVlbj1cIlwiIGZyYW1lYm9yZGVyPVwiMFwiIGhlaWdodD1cIjMxNVwiIHNy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F0IGZvbGxvdy4mbmJzcDs8XC9wPlxyXG5cclxuPHA+RWFjaCBkYXRhc2V0IGNvbnNpc3RzIG9mIGEgc2luZ2xlIGxpbmUgb2YgaW5wdXQgY29udGFpbmluZyBhIGZsb2F0aW5nIHBvaW50IChkb3VibGUgcHJlY2lzaW9uKSBudW1iZXIsIGEgc3BhY2UgYW5kIHRoZSB1bml0IHNwZWNpZmljYXRpb24gZm9yIHRoZSBtZWFzdXJlbWVudCB0byBiZSBjb252ZXJ0ZWQuIFRoZSB1bml0IHNwZWNpZmljYXRpb24gaXMgb25lIG9mIGtnLCBsYiwgbCwgb3IgZyByZWZlcnJpbmcgdG8ga2lsb2dyYW1zLCBwb3VuZHMsIGxpdGVycyBhbmQgZ2FsbG9ucyByZXNwZWN0aXZlbHkuJm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+Rm9yIGVhY2ggZGF0YXNldCwgeW91IHNob3VsZCBnZW5lcmF0ZSBvbmUgbGluZSBvZiBvdXRwdXQgd2l0aCB0aGUgZm9sbG93aW5nIHZhbHVlczogVGhlIGRhdGFzZXQgbnVtYmVyIGFzIGEgZGVjaW1hbCBpbnRlZ2VyIChzdGFydCBjb3VudGluZyBhdCBvbmUpLCBhIHNwYWNlLCBhbmQgdGhlIGFwcHJvcHJpYXRlbHkgY29udmVydGVkIHZhbHVlIHJvdW5kZWQgdG8gNCBkZWNpbWFsIHBsYWNlcywgYSBzcGFjZSBhbmQgdGhlIHVuaXQgc3BlY2lmaWNhdGlvbiBmb3IgdGhlIGNvbnZlcnRlZCB2YWx1ZS4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

ACM-ICPC > Regionals > North America > Greater New York Region > 2007 Greater New York Programming Contest B번