Given Input
int A = 2 , B = 2 ; int N = 3 , M = 4 ; List < List < int > > mat = new List < List < int > > ( ) ; mat . Add ( new List < int > ( new int [ ] { 1 , 0 , 1 , 0 } ) ) ; mat . Add ( new List < int > ( new int [ ] { 0 , 1 , 0 , 1 } ) ) ; mat . Add ( new List < int > ( new int [ ] { 1 , 0 , 1 , 0 } ) ) ;