Tire Dimensions
Time limit1sMemory limit128 MB
Parse a tire size code and compute its overall circumference from the section width, aspect ratio, and rim diameter.
- Level
Easy2 of 10
- Topics
- String, Implementation, Math
- Solved
- No attempts yet
Problem
Given the tire descriptor typically found on the sidewall of a passenger car or light-truck tire, calculate the tire's overall circumference.

A tire descriptor contains the following items of information, in order:
- One or two uppercase letters giving the tire type:
P(passenger),LT(light truck), orT(temporary spare tire). - The section width of the inflated tire in millimeters, followed by a slash
/. - The aspect ratio: the section height expressed as a percentage of the section width. For example,
75means the section height equals 75% of the section width. - The construction (one uppercase letter):
Rmeans radial andDmeans diagonal. This letter may optionally be preceded by a speed symbol (one uppercase letter, such asH). - The nominal rim diameter in inches. It is called "nominal" because it does not include the rim's flanges.
The overall diameter is the diameter of the inflated tire measured at the outermost surface of the tread; it equals the rim diameter plus twice the section height. The overall circumference (the value you must compute) is times the overall diameter.
Input
The input consists of one or more lines, terminated by end-of-file. Each line contains one tire descriptor as described above. All numeric quantities are positive integers. Exactly one blank space separates consecutive items on a line (including the slash).
Output
For each input line, print exactly one line consisting of the original input line, followed by a colon and a single space, and then the overall circumference in centimeters rounded to the nearest integer.
Note that 1 centimeter equals 10 millimeters and 1 inch equals 2.54 centimeters.