Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Prove answer of a problem

Revision en1, by NVGU, 2023-08-27 07:45:12

Today I read the following problem that makes all elements in a sequence the same, using the minimum number of steps. Where each step increments or decrements an element by a constant integer d. And I know the minimum number of steps is the number of steps that make all elements the median of all elements. But I don't know how to prove it. please can someone help me prove it. Thanks for taking the time to read this blog,

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English NVGU 2023-08-27 07:45:12 453 Initial revision (published)