• 1
    Input and Output Data
    • Tasks
  • 2
    Conditions
    • Tasks
  • 3
    For Loop
    • Tasks
  • 4
    Strings
    • Tasks
  • 5
    While Loop
    • Tasks
  • 6
    Lists
    • Tasks
  • 7
    Two-Dimensional Arrays
    • Tasks
  • 8
    Dictionaries
    • Tasks
  • 9
    Sets
    • Tasks
  • 10
    Functions and Recursion
    • Tasks
  • к

Занятие 7. Two -dimensional arrays

Difficulty level:

Task«Search for a unique line»

you have a rectangular plot of land in size & nbsp; m & times; N . Each cell has a price (may be negative). Find the subjection of the & nbsp; the maximum price of the prices .

Input format

First, two whole are introduced The numbers & nbsp; m & nbsp; and & nbsp; n & nbsp; (1 & le; & nbsp; m , & nbsp; n & nbsp; & le; 100), indicating the number of lines and columns in the matrix, respectively. Style = "Text-align: justify;"> then they are introduced & nbsp; m & nbsp; lines, each of which contains & nbsp; n numbers separated by spaces. These numbers are the prices of each site

Output format

take one whole number-the maximum income that can be obtained from the sale of the rectangular area of ​​the plots

Example

Input

3 4
1 2 -1 3
4 -2 5 -1
-3 1 2 4

Output

18

Hint

There will be no clue here, decide for yourself!

main.py
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Test 7
Test 8
Test 9
Test 10
Developer’s solution

🎉 Congratulations! 🎉

You did an excellent job with the task! It was a challenging problem, but you found the correct solution. You are one step closer to mastering programming! Keep up the good work, because every stage you pass makes you even stronger.

AD

Advertisement

red-snake blue-snake green-snake

Running your code...

Помощник ИИ

Привет! Я твой помощник по программированию. Задавай любые вопросы по Python, я могу рассказать о функциях, методах, обьяснить то, что тебе не понятно, а так же о текущей задаче!