Minimise the maximum difference between the heights

Правка en3, от Aafat_Wapas, 2019-08-01 19:12:58

Given an array of integers H representing heights of towers and a positive integer B. It is allowed to either increase or decrease the height of every tower by B (only once).

How to calculate the minimum possible difference between the heights of the longest and the shortest tower after modifications.

Note: It is mandatory to either increase or decrease the height of every tower.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Aafat_Wapas 2019-08-01 19:12:58 2 Tiny change: 'e integer K.\nIt is a' -> 'e integer B.\nIt is a'
en2 Английский Aafat_Wapas 2019-08-01 12:32:10 4
en1 Английский Aafat_Wapas 2019-08-01 12:30:57 454 Initial revision (published)