#P8829. [传智杯 #3 练习赛] 单位转换

[传智杯 #3 练习赛] 单位转换

Problem Description

We know that computer storage size units include B, KB, MB, etc. Now please write a calculator to convert between storage size units.

Note that 11 GB = 2102^{10} MB = 2202^{20} KB = 2302^{30} B.

Input Format

Input a string consisting of: an integer between 0 and 1023, a unit name (uppercase letters), an equals sign and a question mark, and a second unit name.

The unit can only be one of GB, MB, KB, B.

Output Format

Output a number, accurate to 6 digits after the decimal point.

128MB=?GB
0.125000
64MB=?KB
65536.000000

Hint

Translated by ChatGPT 5