
def main():
    num_cases = int(input())
    for _ in range(num_cases):
        x, y = map(int, input().split())
        size = max(x, y)
        MEMO = [[-1]*(2**size) for _ in range(size)]

        start_x, end_x = map(int, input().split() 
        num_points = int(input())
        distances = []


if __name__ == "__main__":
    main()
