Search⌘ K
AI Features

Magnetic Force Between Two Balls

Explore how to maximize the minimum magnetic force between balls placed in baskets by applying sorting and search strategies. Understand problem constraints and develop an efficient solution that balances placement and force calculations.

Statement

In the universe Earth C-137, Rick has discovered a unique type of magnetic force between two balls when placed in his newly invented baskets. He has nn baskets, each located at specific positions given by the array position[i]. Morty has m balls and needs to distribute these balls across the baskets in such a way that the minimum magnetic force between any two balls is as large as possible.

The magnetic force between two balls placed at positions xx and y ...