enclosed formula to make an elment greater than any elemnet in given sequence 
Difference between en1 and en2, changed 169 character(s)
I had the following sequence ↵
↵
5 1 11 2 8↵
And I  need to make 5 greater than any element in the given sequence with minimum operations..there is a solution for this using while and sorting...etc.↵
I wonder i
sf there is some way to know the solution with the enclosed formula??↵
I think that 
iI can get 11 — 5 = 6 and then divide 6 by 2 --> 3 and then  5 will be 8 ..but it's not the greatest element then iI can just add 1, the answer will be 4 -->(9-5).↵
****↵
another test case will be 1 8 8 8 ↵
i can make the sequence 7 6 6 6 ..the answer is 7-1 = 6 operations .↵
iI can analysisze this solution into the following :↵
1 + (3 * 2 ) > 6. where 3 is the occur
rence of the biggest element in the sequence.... and 1 is the first element??↵
Is my thinking wrong??↵
another test case↵
16--> number of elements↵
7 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000↵
iI solve it to 990 ..but the optimal is 932!!!!↵
↵
[link to the problem](https://codeforces.me/problemset/problem/574/A)↵
I checked the tutorial ..but couldn't find the problem explanation in it!↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Elkhateb 2022-07-14 14:26:26 169
en1 English Elkhateb 2022-07-14 14:20:25 1011 Initial revision (published)