|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||68||41||36||58.065%|
"How do you say 'two kilos' in English? -- Dudu, 2015
Dudu always had trouble with measurements and unit conversions. Can you help him?
The input will begin with a line containing 2 numbers x and y meaning that "x of unit A" is equal to "y of unit B". For instance, if A is "kilos" and B is "pounds" one possibility is x = 3.25 and y = 7.165024.
The next line will contain a single integer N, containing the number of conversions to be performed.
Each of the next N lines will be of the form "z q" where z is a number and q is either 'A' or 'B'.
Output N lines with a number each. See the sample input/output for further details.
3.25 7.165024 5 3.25 A 1 A 0 B 2.1 B 0 A
7.165024 2.20462277 0.000000000000000 0.952543913321 0.000000000000000
Errors smaller than 10-4 will be considered correct.