Type: Default 1000ms 256MiB

二维数组压缩

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

输入一个二维数组,有大量的零存在,将其转换为k×3 k\times 3 的二维数组存储,在k×3 k\times 3 的二维数组中,每一行的第一个数为行号,第二个数为列,第三个数为非零元素的值。

Input Format

第一行 m,n表示二维数组 m行,n列 <=500 接下来 m行,n列的数,a[i,j]<=10000

Output Format

若干行:每行三个数,分别是 i, j,a[i,j]. 要求 按照 行标从小到大,如果行标相等,列标从小到大的顺序输出。

Sample

input

3 5
0 0 1 0 0
2 0 0 0 0
0 0 0 0 3

output

1 3 1
2 1 2
3 5 3

Hint

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20200818二维数组练习

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
11
Start at
2020-8-18 8:25
End at
2020-8-21 8:25
Duration
72 hour(s)
Host
Partic.
23