Sum of positive elements in odd rows
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a two-dimensional array with dimensions n x m, your task is to calculate the sum of all positive elements located in the odd-numbered rows of this array.
Input Data
The first line of input consists of two integers, n and m (1 ⩽ n, m ⩽ 100), representing the number of rows and columns, respectively. Following this, there are n lines, each containing m integers, which represent the elements of the array. Note that row numbering starts at 1.
Output Data
Output a single integer, which is the sum of the positive elements in the odd-numbered rows.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 44%