moamen drawing grid n row 109 column contain digit 0 1 Ezzat notice Moamen draw interested minimum number row need remove grid beautifulA grid beautiful consecutive row column contain 1 rowsezzat number row n m segment grid contain digit 1 every segment represent integer l r represent row number l r represent column segment rowfor example n 3 m 6 segment 111 178 277 21515 311 31515 grid your task tell Ezzat minimum number row remove grid beautiful