using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace maxmat
{
class Program
{
static StreamWriter fout = new StreamWriter("maxmat.out");
static void citire(out int[,] A, out int n, out int m)
{
StreamReader fin = new StreamReader("maxmat.in");
string l = fin.ReadLine();
string[] s = l.Split();
n = int.Parse(s[0]);
m = int.Parse(s[1]);
A = new int[n + 1, m + 1];
for (int i = 1; i <= n; i++)
{
l = fin.ReadLine();
s = l.Split();
for (int j = 1; j <= m; j++)
A[i,j] = int.Parse(s[j - 1]);
}
fin.Close();
}
static void afisare(int[,] A, int n, int m)
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
fout.Write(A[i, j] + " ");
fout.WriteLine();
}
}
static void maxlinie(int[,] A, int m, int i, out int max, out int jmax)
{
max = -1000;
jmax = 0;
for(int j=1;j<=m;j++)
if (A[i, j] > max)
{
max = A[i, j];
jmax = j;
}
}
static void Main(string[] args)
{
int n, m,x,y;
int[,] A;
citire(out A,out n,out m);
//afisare(A, n, m);
for (int i = 1; i <= n; i++)
{
maxlinie(A, m, i, out x, out y);
fout.WriteLine(x + " " + y);
}
fout.Close();
}
}
}
|