#K57312. Predicting Next Day Sales
Predicting Next Day Sales
Predicting Next Day Sales
You are provided with the sales data for N different items over D days. Your task is to predict the expected number of sales for each item on the next day. The expected sales are calculated as the floor of the average sales over the past D days.
In mathematical terms, for each item, if the sales over the past D days are given by \(a_1, a_2, \dots, a_D\), then the expected sales are computed as:
[ \text{expected_sales} = \left\lfloor \frac{a_1 + a_2 + \cdots + a_D}{D} \right\rfloor ]
Note: Use integer division to get the floor of the average.
inputFormat
The first line contains two integers N and D separated by a space, where N is the number of items and D is the number of days of recorded sales.
This is followed by N lines, each containing D integers that represent the sales data for each item over the past D days.
outputFormat
Output a single line with N integers separated by spaces. Each integer represents the expected sales for the corresponding item on the next day.
## sample3 4
10 20 15 25
5 6 7 8
12 14 13 11
17 6 12