Helping Hands - Dementia (Minimum steps: k +n - 4)

The setters intended solution was wrong which makes the question wrong

Where in announcement its written that ranklist will be made on remaining four
i can’t see it

It isn’t written. I was just saying that they shouldn’t do so

please explain the appproach

n=11 ans should be 12 ( lcm achievable with 5,7,8,9,11 in 6 steps and rest 6 elements in 6 steps) …your output is 14

for n=23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
first consider only these 8 numbers
7,9,11,13,16,17,19,23
LCM(7,9)
LCM(11,13)
LCM(16,17)
LCM(19,23)
63 63 143 143 272 272 437 437
LCM( 63,143)
LCM(272,437)
63 9072 9072 143 272 11864 11864 437
LCM(9072,11864)
LCM(9072,11864)
out of the 8 now 4 numbers are 1078334208 in total 8 operations;
combine these 4 numbers each with 5,10,15,20
LCM(1078334208,5)
LCM(1078334208,10)
LCM(1078334208,15)
LCM(1078334208,20)
all four will give same answer which is the final LCM all four numbers should reach
so now in tottal 8 numbers(4 of 1078334208 and 5,10,15,20) are converted to final form in 12 steps, this leaves us with remaining 23-8=15 numbers which can be done in 15 steps combining each with any of 8 already in final form
so it requires 15+12=27 operations

This disproves my method as well. I am curious to see the solution they put up in the editorial.

Here: HELPHAND - Dementia

mine too

For 11:
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 77 8 9 10 77
1 2 3 4 385 6 385 8 9 10 77
1 2 3 4 385 6 3465 8 3465 10 77
1 2 3 4 385 6 3465 27720 27720 10 77
…
4 + 9 = 13 seconds
Maybe this is wrong answer but it less then your output(14)

Can you prove that dividing k primes into two subgroups of size k/2 each will give the optimal solution?

Actual optimal solution F(n) = F(n-1) + 2
Base case: n=4 F(4) = 4

Thus we get F(n) = 2*n-4

its absolutely wrong

Does this give you correct answers for all testcases which have come up till now?
Also, can you prove that it is optimal?

In this question author thought that the answer would be 2k-3 not knowing that minimum steps is 2k-4.

There is way to construct 2*k-4 solution.
F(k) = F(k-1) + 2.
In first step we will take LCM between I1 and I2. Now we need F(k-1) moves to make all elements from 2 to k equal. And in one more step we will take LCM again between I1 and I2.

Check this document for the proof F(k)>2*k-5

What about n = 23 ?
Check out this post ->

This shows that the moves are less than n + k - 4