give m n matrix seat represent seat distribution classroom if seat break denote character denote characterstudents answer sit leave right upper left upper right answer student sit directly return maximum number student exam cheat possiblestudent place seat good condition example 1input seat output 4explanation teacher place 4 student available seat do not cheat exam example 2input seat Output 3explanation Place student available seat Example 3input seat Output 10explanation Place student available seat column 1 3 5 Constraintsseats contain character andm seatslengthn seatsilength1 m 81 n 8