题目描述
Manager of Salt n Pepper restaurant was fed up with the bizarre waiters of the large dining hall.The dining hall was arranged in form of a matrix of size m x n each position denoting a table.
The waiters had a unique rule. They would serve on row at a time. And in that row they would serve food to the empty table and take away food from the already served table. Now the manager knew that the only way to make customers happy was to serve whole column at once.So now you need to help the manager and tell him what is the maximum number of columns of the customer that it can serve at a time and and to serve those columns what is the number of services of rows the waiters have to make. If there are more than one ways to maximize the columns served, then minimize the number of services of rows to be made.
Note : A column is served when all the tables in that column are served.
Input
First line on input contains two integers m and n denoting the size of matrix.
0<m ≤ 1000 0<n ≤ 1000
Next m lines contain n digits either 0 or 1. 0 denotes that the particular table has not been served or is empty and 1 denotes that the table has already been served.
Output
You need to print two integers a and b separated by a space. ‘a’ is the maximum number of columns that can be served and ‘b’ is the minimum number of services of rows the waiter has to make to serve ‘a’ columns.
Author : Parth Panchal and Utsav Vyas
SAMPLE INPUT
3 3
1 0 1
1 0 1
1 0 1
SAMPLE OUTPUT
1 3
输入格式
见题面
输出格式
见题面