726. Temperature Conversion (Fahrenheit to Celsius)
0
Medium
Given the following inputs:
Minimum Fahrenheit value
Maximum Fahrenheit value
Step
Convert the Fahrenheit values to Celsius using the formula C = (5/9)(F - 32). For example, if the input is 0, 100, and 20, the output should be:
0 -17
20 -6
40 4
60 15
80 26
100 37
Input Format
The input consists of three lines:
The first line contains an integer representing the Minimum Fahrenheit value.
The second line contains an integer representing the Maximum Fahrenheit value.
The third line contains an integer representing the Step.
Output Format
Print the Fahrenheit and Celsius values separated by a tab. Each step should be printed on a new line.
Example
Input
0
100
20
Output
0 -17
20 -6
40 4
60 15
80 26
100 37
Constraints
0 < Min < 100
Min < Max < 500
0 < Step<150
Min < Max < 500
0 < Step<150
Loading...
View Submissions
Console