← 返回 cisco 的题目列表Find Largest Number in Matrix and Smallest in Row, Column
类型:online_judge
Given a matrix, find the largest number in each row and the smallest number in each column that is not 1. The input consists of two space-separated lists of numbers, where the first list represents the matrix rows and the second the columns. Output the largest number in each row and the smallest number in each column that isn’t 1.
Input: Matrix: N space-separated integers for rows
Output: Largest number in each row and smallest number in each column that isn’t 1, separated by a space.
Sample Input: 2 4 5 4
Sample Output: 4 5
Example
Input
2
3 5 1
4 1 2