There are N countries, each country has Ai players. You need to form teams of size K such that each player in the team is from a different country. Given N and number of players from each country and size K. Find the maximum number of teams you can form.
Similar question: https://leetcode.com/problems/rearrange-string-k-distance-apart/ (premium)