1908: 【CSP二维数组】马鞍数▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

求一个 lns="http://www.w3.org/1998/Math/MathML">n×m 数阵中的马鞍数,输出它的位置。所谓马鞍数,是指在行上最小而在列上最大的数。

如下: lns="http://www.w3.org/1998/Math/MathML">n=5 lns="http://www.w3.org/1998/Math/MathML">m=5

5 6 7 8 9
4 5 6 7 8
3 4 5 2 1
2 3 4 9 0
1 2 5 4 8 

则 lns="http://www.w3.org/1998/Math/MathML">1 行 lns="http://www.w3.org/1998/Math/MathML">1 列上的数就是马鞍数。

Input

共 lns="http://www.w3.org/1998/Math/MathML">n+1 行,第一行: lns="http://www.w3.org/1998/Math/MathML">n lns="http://www.w3.org/1998/Math/MathML">m (lns="http://www.w3.org/1998/Math/MathML">n,m<10);

第 lns="http://www.w3.org/1998/Math/MathML">2 到 lns="http://www.w3.org/1998/Math/MathML">n+1 行:每行 lns="http://www.w3.org/1998/Math/MathML">m 个整数;

Output

输出若干行:如果存在马鞍数,则输出所有马鞍数,每行一个,为行和列以及马鞍数,马鞍数按照读入的顺序输出,也就是说,如果有多组马鞍数,先读入的先输出。

如果不存在马鞍数,则输出not exist

Sample Input Copy

2 3
6 5 8
7 2 8

Sample Output Copy

1 2 5