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 isf there is some way to know the solution with the enclosed formula??↵
I think thatiI 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 occurrence 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!↵
↵
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
I think that
****↵
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 .↵
1 + (3 * 2 ) > 6. where 3 is the occurrence 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↵
↵
[link to the problem](https://codeforces.me/problemset/problem/574/A)↵
I checked the tutorial ..but couldn't find the problem explanation in it!↵




