Due to historical reasons people measure temperature in different scales, such as Fahrenheit and Celsius. Your task is to convert a temperature from one scale to another. It is known that both scales are linear with respect to each other (i.e.,
there are real numbers a and b such that temperature t presented in the first scale can be converted to the second by the law t'=a*t+b).
You are given 5 ints: f1, the freezing point of water in the first scale; b1, the boiling point of water in the first scale; f2, the freezing point of water in the second scale; b2, the boiling point of water in the second scale; and t, the temperature in the first scale. Return t converted into the second scale.
|