Problem list
Log in
#r03090 · Online Judge > GoldOJ

Matrix Sum, Max, Min

Bronze III 2.0 s 1024 MB

An $n \times m$ matrix of integers is given. Print the sum of all values, the maximum, and the minimum, one per line.

Input

Line 1: $n$ $m$. Next $n$ lines: the matrix ($1 \le n, m \le 10$).

Output

Print the total sum, the max, then the min.

Example 1

Input
2 3
3 1 4
1 5 9
Output
23
9
1
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code