#C3676. Sum of Minimum Values: Even or Odd?
Sum of Minimum Values: Even or Odd?
Sum of Minimum Values: Even or Odd?
You are given a grid of integers with n rows and m columns. Your task is to compute the sum of the minimum value from each row. Formally, if the grid is represented as \(a_{ij}\) where \(1 \leq i \leq n\) and \(1 \leq j \leq m\), then you need to calculate:
\(S = \sum_{i=1}^{n}\min_{1 \leq j \leq m}\{a_{ij}\}\)
After obtaining \(S\), determine whether \(S\) is even or odd. Print Even
if \(S\) is even, and Odd
if \(S\) is odd.
Input/Output must be handled via standard input and standard output.
inputFormat
The first line of input contains two space-separated integers, n and m, representing the number of rows and columns in the grid.
The next n lines each contain m space-separated integers, representing the rows of the grid.
outputFormat
Output a single line containing the word Even
if the sum of the minimum values of each row is even, or Odd
if the sum is odd.
3 3
1 2 3
4 5 6
7 8 9
Even