Category

Similar Problems

0138. Matritsa9

Time limit : 1000 ms
Memory limit : 64 mb

Kvadrat matritsani asosiy dioganal elementlaridan eng kattasi va yordamchi dioganal elementlaridan eng kichigi topilsin.


Kiruvchi ma`lumotlar: Birinchi satrda $n$ ($1\le n \le 50$). Keyingi $n$ ta satrda $n$ ta butun son matritsa elementlari ($-100\le a[i][j] \le 100$).


Chiquvchi ma`lumotlar: Masala yechimlari probel bilan ajratilgan xolda.

Input
5
14 0 -46 45 13
81 -25 47 -10 7
84 54 -67 57 55
53 -37 28 -73 41
76 46 -14 31 46
Output
46 -67
Input
9
86 92 -20 14 87 -92 7 25 -52
52 -40 38 -95 77 -91 64 -55 18
26 20 -9 82 30 -37 86 91 -56
82 -36 56 -56 18 -74 60 -53 46
38 34 -34 48 51 -77 83 22 0
26 -85 85 -3 17 -84 81 -70 36
19 9 -8 80 0 -78 40 85 -13
98 -16 25 -59 99 -54 45 -53 40
32 39 -65 27 37 -9 91 8 -36
Output
86 -74