SP15062 GCJ102C - Bacteria

Description

N/A

Input Format

The input consists of: - One line containing **C**, the number of test cases. Then for each test case: - One line containing **R**, the number of rectangles of cells that initially contain bacteria. - **R** lines containing four space-separated integers **X** $ _{1} $ **Y** $ _{1} $ **X** $ _{2} $ **Y** $ _{2} $ . This indicates that all the cells with X coordinate between X $ _{1} $ and X $ _{2} $ , inclusive, and Y coordinate between Y $ _{1} $ and Y $ _{2} $ , inclusive, contain bacteria. The rectangles may overlap. North is in the direction of decreasing Y coordinate. West is in the direction of decreasing X coordinate.

Output Format

For each test case, output one line containing "Case #N: T", where N is the case number (starting from 1), and T is the number of seconds until the bacteria all die.