#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> matrix(n, vector<int>(m));
// 读取矩阵元素
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> matrix[i][j];
}
}
vector<int> colSums(m, 0);
// 计算每列的和
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
colSums[j] += matrix[i][j];
}
}
int maxColSum = 0;
int maxColIndex = m - 1;
// 找出最大的列和及最右的列索引
for (int j = m - 1; j >= 0; --j) {
if (colSums[j] >= maxColSum) {
maxColSum = colSums[j];
maxColIndex = j;
}
}
int maxValue = 0;
int count = 0;
// 在第一轮胜出的列中找出最大元素及数量
for (int i = 0; i < n; ++i) {
if (matrix[i][maxColIndex] > maxValue) {
maxValue = matrix[i][maxColIndex];
count = 1;
} else if (matrix[i][maxColIndex] == maxValue) {
count++;
}
}
cout << maxValue << " " << count << endl;
return 0;
}
chatGPT生成的,一点都不一样