def convert_2d_to_1d(coordinate, n):
    """
    Convert a 2D coordinate to a coordinate on a line.

    Args:
        coordinate(tuple): 2D coordinate
        n(int): Number of scales

    Returns:
        int: 1D coordinate
    """
    return coordinate[0] + 2**n * coordinate[1]