Absolutely
Time limit1sMemory limit1024 MB
Given pairs of numbers on a line, the task is to print the distance between each pair with exactly one decimal place.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
We will call the distance between any two values on the number line the absolute line distance. Given two values, find the absolute line distance and output it, rounded and formatted to one place of precision.
Input
The first line contains a single positive integer, n, the number of data sets. Each data set is on a separate line and contains two values on the number line, separated by a single space.
Output
Output the absolute line distance between the two points, rounded to the nearest tenth. Print exactly one digit after the decimal point.