Tap here to switch tabs
Problem
Submissions

Problem: Minimized Maximum of Products Distributed to Any Store

med
30 min
Try to solve the Minimized Maximum of Products Distributed to Any Store problem.

Statement

You are given an integer n representing the number of retail stores and an integer array quantities, where quantities[i] denotes the total quantity of the ii-th product type.

You must distribute all products to the n stores adhering to the following rules:

  • A store can be allocated at most one product type, but can receive any amount of that product.

  • A store may also receive 00 products.

Let xx be the maximum number of products allocated to any single store.

Return the minimum possible value of xx.

Constraints:

  • m ==== quantities.length

  • 1≤1 \leq m ≤\leq n ≤105\leq 10^5

  • 1≤1 \leq quantities[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimized Maximum of Products Distributed to Any Store

med
30 min
Try to solve the Minimized Maximum of Products Distributed to Any Store problem.

Statement

You are given an integer n representing the number of retail stores and an integer array quantities, where quantities[i] denotes the total quantity of the ii-th product type.

You must distribute all products to the n stores adhering to the following rules:

  • A store can be allocated at most one product type, but can receive any amount of that product.

  • A store may also receive 00 products.

Let xx be the maximum number of products allocated to any single store.

Return the minimum possible value of xx.

Constraints:

  • m ==== quantities.length

  • 1≤1 \leq m ≤\leq n ≤105\leq 10^5

  • 1≤1 \leq quantities[i] ≤105\leq 10^5