Dementia rated contest

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.

1 Like

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 -->

  1. ab, ab, c, d
  2. ab, ab, cd, cd
  3. abcd, ab, abcd, cd
  4. abcd, abcd, abcd, abcd

if primes -> 5
a, b, c, d, e

  1. ab, ab, c, d, e
  2. ab, ab, c, de, de
  3. ab, abc, abc, de, de
  4. ab, abc, abcde, abcde, de
  5. ab, abcde, abcde, abcde, abcde
  6. abcde, abcde, abcde, abcde, abcde

similarly for primes -> 6 and so on…

1 Like

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.

@aryanc403 pls tell the correct ans.

You can only assign two indexes the same value at one second, even if the quantity minimum of one value is bigger than 1.

@admin weak test cases are okai but wrong test case cant be acceptable