Generation

generate functionFri, 03 Feb 2023

There is a length L bar. It has N slits, and the i-th slit from the left is at position Ai from the left. You want to choose K of the N cuts and divide the bar into K+1 pieces. The length of the shortest of the K+1 pieces is called the score. Please give me a program to find the score obtained when dividing the pieces so that the score is maximized.

def add(a, b): return a + b add(1, 2)

Questions about programming?Chat with your personal AI assistant