For n=7
It could be 8
1 2 3 4 5 6 7
(STARTS HERE)
1 6 6 4 5 6 7
1 6 30 4 30 6 7
1 6 30 4 210 6 210
1 6 30 4 210 420 420
1 6 30 420 420 420 420
1 6 420 420 420 420 420
1 420 420 420 420 420 420
420 420 420 420 420 420 420
We are aware of this. We are trying to find correct solution to this problem.
Not for only n = 7, output is wrong but for n = 8 , n= 9 …so on… output is wrong.
we can prove like,
according to setters logic
to make all primes to be equal to final LCM, we need to take (p-1 + p-2) time but it can be proved that we need exactly one less than that
if primes -> 4
a, b, c, d -->
- ab, ab, c, d
- ab, ab, cd, cd
- abcd, ab, abcd, cd
- abcd, abcd, abcd, abcd
if primes -> 5
a, b, c, d, e
- ab, ab, c, d, e
- ab, ab, c, de, de
- ab, abc, abc, de, de
- ab, abc, abcde, abcde, de
- ab, abcde, abcde, abcde, abcde
- abcde, abcde, abcde, abcde, abcde
similarly for primes -> 6 and so on…
yes you are right e.g. I checked for 7 during the contest and got the answer as 7 for it but according to others solutions output is 8, I wasn’t able to crack it during the contest because I applied 2-3 logics and the answer was not optimal for some cases in each of the logic.
@admin please make the contest unrated.
You can only assign two indexes the same value at one second, even if the quantity minimum of one value is bigger than 1.