Company: Amazon university talent Sde-1_10may
Difficulty: medium
Amazon's warehouse management team is planning to roll out certain standards and checks that every Amazon Warehouse Manager will follow. Some products may need to be moved initially from one warehouse to anoth er so that each warehouse complies. A warehouse stores $n$ identical containers arranged in the form of a circle. T he distance between two adjacent containers is 1. Each container in a warehouse should hold the sa me number of products. Plan the optimal set of movements under the following rules. Move products from any loc ation in either the clockwise or the anti-clockwise direction. The direction must remain the same t hroughout the remaining moves. While moving, collect excess products from some locations and deliver them to other locations that need more units. The cost of each product transfer is the distance the product is moved. The total cost is the sum of the costs for all products transferred. Find the minimum cost such that finally, every con tainer has the same numbe