Increasing Matrix Row X41891


Statement
 

pdf   zip

thehtml

Write a program that finds out whether a given matrix has an increasing row; that is, a row where each element (except the first) is strictly larger than the preceding one.

Input

The input presents first the dimensions of the matrix, non-negative integers m and n, both in the same line; then m lines follow, each containing n integers: each line is a matrix row.

Output

The first row of the matrix where all elements, except the first, are strictly larger than the preceding element, if some such row exists; the text "No increasing row found." otherwise.

Public test cases
  • Input

    4 3
    3 2 1
    2 2 2
    1 2 3
    4 3 2

    Output

    1 2 3
    
  • Input

    6 3
    3 2 1
    3 3 3
    3 4 3
    -1 1 0
    0 0 0
    20000 0 50000 

    Output

    No increasing row found.
    
  • Information
    Author
    Language
    English
    Official solutions
    Python
    User solutions
    Python