def rc2i(row, col):
    cell = (- 1)
    if ((row < num_rows) and (row >= 0) and (col < num_cols) and (col >= 0)):
        cell = ((row * num_rows) + col)
    for c in obstacle_cells:
        if (cell == rc2i_short(c[0], c[1])):
            return (- 1)
    return cell
def rc2i(row, col):
    cell = (- 1)
    if ((row < num_rows) and (row >= 0) and (col < num_cols) and (col >= 0)):
        cell = ((row * num_rows) + col)
    for c in obstacle_cells:
        if (cell == rc2i_short(c[0], c[1])):
            return (- 1)
    return cell