You're planning your party's campaign strategy to win the Presidency of the United States. To win, your candidate has to navigate many controversial issues, which influence voters, such as healthcare, immigration, education, energy, independence, jobs, taxes, environment, and so on. Each of these is important, but also expensive to address.
Because the United States presidential election is determined by states casting votes in the Electoral College, you need minimum 270 of the total 538 Electoral College votes to win.
While not completely accurate, for this challenge we use the following criteria:
Your task is to put together a winning strategy by identifying the fewest issues you must address to win 270 votes.
Your program should accept a file as its first argument. The file content is the following:
The first line identifies the total number of potential issues, the second—information about costs for each program, and the third — information about each state, separated by spacing. Each state has a name, number of votes, and a list of issues that you can choose in each state. Each of these issues is valued based on the number of votes it can get in each state. Remember, you must get the majority of votes in each state to win.
Print out the list of issues you want to cover in you electoral program in alphabetical order.
Remember, that your task is to create a program with the fewest number of issues. If there are several variants of program with the fewest number of issues, then you need to choose the program with minimum costs.