#C10816. Draught Indicators
Draught Indicators
Draught Indicators
You are given a collection of songs and their popularity scores over a period of days. For each song, the Draught Indicator is defined as the difference between the maximum and minimum popularity scores it receives. Formally, for each song with scores \( s_1, s_2, \dots, s_d \), the Draught Indicator is given by:
[ DI = \max_{1\le i \le d} s_i - \min_{1\le i \le d} s_i ]
Your task is to compute the Draught Indicator for each song.
Input: The input consists of multiple numbers. The first two integers \( n \) and \( d \) denote the number of songs and the number of days respectively. Then, there are \( n \) lines each containing \( d \) integers, where each integer represents the popularity score of a song on a particular day.
Output: Print a single line containing \( n \) integers separated by spaces. Each integer represents the Draught Indicator of the corresponding song.
Example:
Input: 3 4 3 4 5 6 1 2 2 1 10 5 8 10</p>Output: 3 1 5
inputFormat
The first line contains two integers, \( n \) (the number of songs) and \( d \) (the number of days).
This is followed by \( n \) lines, each containing \( d \) space-separated integers. The \( j \)-th integer on the \( i \)-th line represents the popularity score of the \( i \)-th song on day \( j \).
outputFormat
Output a single line with \( n \) integers separated by a space, where each integer is the Draught Indicator of the corresponding song. The Draught Indicator is calculated as the difference between the maximum and minimum scores for that song.
## sample3 4
3 4 5 6
1 2 2 1
10 5 8 10
3 1 5