import sys sys.setrecursionlimit(1000000000) # # Solution Template for Wheeling and Dealing # # Australian Informatics Olympiad 2023 # # This file is provided to assist with reading of input and writing of output # for the problem. You may modify this file however you wish, or # you may choose not to use this file at all. # # N is the number of candidates. N = 0 # M is the number of voters. M = 0 # V contains the voters plans. Note that here the voters are numbered starting # from 0. V = [] # P contains the amount of money that you can pay each voter to change their # vote. Note that here the voters are numbered starting from 0. P = [] # Read the values of N, M, V and P. N, M = map(int, input().strip().split()) V = list(map(int, input().strip().split())) P = list(map(int, input().strip().split())) # TODO: This is where you should compute your solution. Store the minimum # amount of money that you must pay so that candidate 1 wins into the variable # answer. answer = 0 # Write the answers. print(answer)