/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/acm-icpc-team * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include using namespace std; int main() { // Brute force! O(N^2*M). int n,m; scanf("%d %d",&n,&m); char k[500][501]; for (int i=0;imaxn) { maxn = cnt; maxcnt = 1; } else if (cnt==maxn) maxcnt++; } printf("%d\n%d\n",maxn,maxcnt); return 0; }