Minimum size of array possible?

Revision en1, by Impostor_Syndrome, 2022-02-16 22:15:13

In an array — 'arr' there are n elements. Two elements arr[i] and arr[j] can be combined to one element if arr[i] >= k * arr[j], for i != j. After combination, these two elements cannot further combine with any other element of the array. Find the minimum size of the array possible, after executing atmost n/2 operations.

Input will be n, the array elements and k.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Impostor_Syndrome 2022-02-16 22:15:13 406 Initial revision (published)