Dr. Vanik is well known professor of Mathematics. The class is special in which there are 2N rows and 2N columns. There are some students in his class who have complained about his teaching to Dean. So Dean has send a group of Inspectors to his class, They are about to reach anytime.
eg.
@ @ @ # # #
@ @ @ # # #
@ @ @ # # #
-
-
- & & &
-
-
-
- & & &
-
-
-
- & & &
-
This is 2N x 2N class. N = 3
There are four corners in above class with representation (@,#,+,&)
Top-left corner is represented by ‘@’ (size = N x N)
Dr. Vanik knows that they will ask questions to students at top-left corner (N x N) because they are close to entrance of the class.Since he is LOL … he will flip any row or any column any number of times and wants best possible students in top-left corner. He knows intellgence score of each student , Help him to aggregate best possible students in that corner, and print sum of intelligence score of each student.