CF295D Greg and Caves

Description

Greg has a pad. The pad's screen is an $ n×m $ rectangle, each cell can be either black or white. We'll consider the pad rows to be numbered with integers from 1 to $ n $ from top to bottom. Similarly, the pad's columns are numbered with integers from 1 to $ m $ from left to right. Greg thinks that the pad's screen displays a cave if the following conditions hold: - There is a segment $ [l,r] $ $ (1

Input Format

N/A

Output Format

N/A