#C1889. Compute Marmot Population Net Changes
Compute Marmot Population Net Changes
Compute Marmot Population Net Changes
During a study period, each village experiences daily fluctuations in its marmot population due to migrations. Given the number of villages V and the number of days D, together with the migration data represented as a matrix, your task is to calculate the net change in the marmot population for each village over the entire period.
For each village i (1 ≤ i ≤ V), the net change is given by:
\( netChange_i = \sum_{d=1}^{D} migration_{d,i} \)
Where migrationd,i
is the migration value of village i on day d. Provide the net changes as space-separated integers in one line.
inputFormat
The input is read from stdin and has the following format:
- The first line contains two integers
V
andD
separated by a space, representing the number of villages and the number of days respectively. - The next
D
lines each containV
space-separated integers. The j-th number in the i-th line represents the migration change for village j on day i.
outputFormat
Output a single line to stdout containing V
integers separated by spaces. Each integer represents the net change in population for the corresponding village over the entire study period.
1 1
10
10
</p>