Company: Samsung
Difficulty: medium
Minimize Fisherman Movement Problem Description There are fishing spots aligned along a river, numbered from 1 to N. At the fishery, there are 3 entrances (gates), and fishermen are waiting in front of each gate to get in. Each fisherman gets one spot, and the process of getting a spot is as follows: In order to avoid crowdedness, one gate entrance after another is chosen, and the entering goes in order. After selecting a gate entrance, the fishermen waiting at the corresponding gate will enter individually and go to the closest spot from their position that is not yet occupied. Each takes a spot in order. From the entrance to the fishing spot at the gate's location, the distance is 1m. Whenever a fisherman moves one spot to the left or right, it adds an additional 1m to the distance. For instance, if Gate 1 is at fishing spot 4, the distance to spot 4 is 1m, and to fishing spot 3 or spot 5, the distance is 2m. In case of the last fisherman at the corresponding gate entrance, if there