112. Unit Conversions

Codeforces
IDCF10269112
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Converting from one unit of measurement to another is very useful. Make a program that can convert between, feet, inches, meters, centimeters, miles, and kilometers. Use the following conversions to get the correct answer: .08333 feet in 1 inch, 3.28084 feet in 1 meter, 0.0328084 feet in one centimeter, 5280 feet in 1 mile, and 3280.84 feet in 1 kilometer. One line describing a conversion: Ex: "The road is 1.5 miles, how many kilometers is it." Print the value of the conversion and the unit. The first number and unit will always be right before the ",". after the "," it will always "how many" then the unit you are converting to. ## Input One line describing a conversion: Ex: "The road is 1.5 miles, how many kilometers is it." ## Output Print the value of the conversion and the unit. [samples] ## Note The first number and unit will always be right before the ",". after the "," it will always "how many" then the unit you are converting to.
**Definitions** Let $ U = \{ \text{inch}, \text{foot}, \text{meter}, \text{centimeter}, \text{mile}, \text{kilometer} \} $ be the set of units. Define the conversion factor to feet: - $ c_{\text{inch}} = 0.08333 $ - $ c_{\text{foot}} = 1 $ - $ c_{\text{meter}} = 3.28084 $ - $ c_{\text{centimeter}} = 0.0328084 $ - $ c_{\text{mile}} = 5280 $ - $ c_{\text{kilometer}} = 3280.84 $ **Given** A string of the form: > "The road is $ v $ $ u_1 $, how many $ u_2 $ is it." where: - $ v \in \mathbb{R}^+ $ is the numerical value, - $ u_1, u_2 \in U $, $ u_1 \ne u_2 $, are the source and target units. **Objective** Compute the converted value: $$ v' = v \cdot \frac{c_{u_1}}{c_{u_2}} $$ Output: $ v' $ and $ u_2 $.
API Response (JSON)
{
  "problem": {
    "name": "112. Unit Conversions",
    "description": {
      "content": "Converting from one unit of measurement to another is very useful. Make a program that can convert between, feet, inches, meters, centimeters, miles, and kilometers. Use the following conversions to g",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269112"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Converting from one unit of measurement to another is very useful. Make a program that can convert between, feet, inches, meters, centimeters, miles, and kilometers. Use the following conversions to g...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ U = \\{ \\text{inch}, \\text{foot}, \\text{meter}, \\text{centimeter}, \\text{mile}, \\text{kilometer} \\} $ be the set of units.  \nDefine the conversion factor to feet:  \n- $ c_{\\text...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments