• Language
  • Navigation

The Perfect Job

Recruiting season is an exciting time for students. It's filled with decisions about the future, your classmates walking around in business suits, and some lectures tossed in somewhere along the way. Important decisions are being made: what kind of opportunity to pursue, where to pursue it, and who to have with you along the way.

Luckily, you're no stranger to honing your problem solving and coding skills for just such an occasion. While others may struggle with such a decision, you know that finding the perfect job is just an optimization problem subject to certain constraints.

Put your brain to work: write some code that generates the optimal set of job assignments for the set of job offers and people below.

The problem set

 Jobs
Each type of job has certain benefits and drawbacks along several dimensions:

  Pay Hours Impact Opportunity to Learn
Big Software Firm 6 6 2 8
Hedge Fund 8 8 4 6
Investment Bank 10 10 3 4
Startup 4 8 10 8
Grad School 1 4 3 10


Personalities

Accordingly, different types of people have different sets of preferences across these job dimensions. These preferences can be thought of as coefficients for the utility offered in each dimension:

  Pay Hours Impact Opportunity to Learn
The Money Grubber 10 -1 4 2
The Entrepreneur 4 -2 10 8
The Slacker 1 -10 2 2
The Academic 2 -6 8 10


Relationships

Lastly, people don't consider their job choices in a vacuum; their utility derived from a job is a function of both the job itself and the people around them. Since jobs are associated with specific geographies, the geography of the job alone can have a sizable impact on people's happiness:

Mortal Enemies Cannot be in the same city
Friends +20 to each person for same city
Dating +50 to each person for same city
Married Must be in the same city

Your task, should you choose to accept it

Write some code that generates the optimal set of job assignments for a given set of job offers and people. To verify that your code works, run it against the set of input files below and upload the resulting output files along with your source code. Happy coding!

Sample Input 1

Sample Input 2

Sample Input 3

 

Solve the puzzle now by submitting your answer here!