International Secret Santa Matching
The format for the input is CSV. Each entry consists of three comma seperated values: the user's UID, the user's country, and if the user is willing to ship internationally. The first should be a number, the second is any string free of commas or new lines, and the last is either "true" or "false" (without the quotation marks).
The format for the output is a comma seperated set of bracket enclosed and comma seperated values. The giver comes first and the receiver comes after. For example, [1,2],[3,4] indicates user 1 is giving to user 2 and user 3 is giving to user 4.
This form calculates Secret Santa matches for a list of people. Each entrant needs to be previously assigned a UID, which will be used give the user's match. As well, you need the country each user is in and whether or not they are willing to be matched with someone from another country.
A user who does not want to be matched with someone from a different country will not be unless there is no one else from their country participating. Additionally, users who do want to ship internationally will be matched to both gift and be gifted by participants from other countries whenever possible. However, if there are not enough people in other countries also interested in shipping internationally, they may be matched with people from the same country