def read_file(in_file):
    """
    Read Intput File

    Args:
        in_file: input file path

    Returns:
        no_of_caches: Number of cache servers
        , cache_size:   Each cache server's size
        , video_sizes:  List of video sizes
        , ep_dc_latencies:  List of latency between Endpoint and Data Center
        , ep_no_of_caches:  List of Number of connected Cache Servers in each Endpoint
        , ep_cache_latencies:   List of each endpoint's latency to a connected cache server
        , video_ep_requests:    Dict of requests of each video from each Endpoint
    """
    no_of_videos = 0
    no_of_endpoints = 0
    no_of_request_desc = 0
    no_of_caches = 0
    cache_size = 0      # Each cache server's size
    video_sizes = []    # List of video sizes
    ep_dc_latencies = []    # List of latency between Endpoint and Data Center
    ep_no_of_caches = []    # List of Number of connected Cache Servers in each Endpoint

    # list of each endpoint's latency to a connected cache server
    # [{cache_idx: latency, 0: 100, 1: 150, ...}, ...]
    ep_cache_latencies = []

    # dict of requests of each video from each endpoint
    # {(video_idx, endpoint_idx): no_of_requests), (3, 0): 1500, (0, 1): 1200, ...}
    video_ep_requests = {}

    # Read the file into variables    
    with open(in_file, 'r') as infile:
        # Process lines and save data into variables
        no_of_videos, no_of_endpoints, no_of_request_desc, no_of_caches, cache_size = [int(x) for x in infile.readline().strip().split(' ')]
        video_sizes = [int(x) for x in infile.readline().strip().split(' ')]

        for ep_idx in range(0, no_of_endpoints):
            ep_dc_latency, no_of_connect_caches = [int(x) for x in infile.readline().strip().split(' ')]
            ep_dc_latencies.append(ep_dc_latency)

            ep_cache_latency = {}
            for cache_cnt in range(0, no_of_connect_caches):
                cache_idx, cache_latency = [int(x) for x in infile.readline().strip().split(' ')]
                ep_cache_latency[cache_idx] = cache_latency
            ep_no_of_caches.append(no_of_connect_caches)
            ep_cache_latencies.append(ep_cache_latency)

        for request_cnt in range(0, no_of_request_desc):
            [video_idx, ep_idx, request_size] = [int(x) for x in infile.readline().strip().split(' ')]
            video_ep_requests[(video_idx, ep_idx)] = request_size

    '''
    print(no_of_videos)
    print(no_of_endpoints)
    print(no_of_request_desc)
    print(no_of_caches)
    print(cache_size)
    print(video_sizes)
    print(ep_dc_latencies)
    print(ep_no_of_caches)
    print(ep_cache_latencies)
    print(video_ep_requests)
    '''

    return no_of_caches, cache_size, video_sizes, ep_dc_latencies, ep_no_of_caches, ep_cache_latencies, video_ep_requests