Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/matritsa-qatordagi-musbatlar

Positives in each row

Easy 1000 ms 64 MB 24%
Share

A matrix of size $n \times m$ is given. For every row, find how many positive elements it has ($0$ is not positive).

A matrix with the positive cells of each row highlighted and their count on the right

Input

The first line contains two positive integers $n$ and $m$.
Each of the next $n$ lines contains $m$ integers — the matrix.

Output

One line with $n$ space-separated integers.

Note

$1 \le n, m \le 100$
$-1000 \le a_{i,j} \le 1000$

Examples

Input #1
3 4
1 -2 3 0
-1 -1 -1 -1
5 6 7 8
Output #1
2 0 4
Input #2
1 1
0
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.