CF1292E
Step 1
We can consider pushing down the value by breaking the strings up. However, we actually don't need all the positions of CHO, we only need 2 and we can infer the 3rd.
Step 2
If we break it up to 2-grams: CC CH CO HC HH HO OC OH OO
To cover up all occurrences of C and H, we need to to match: for C: CCC CCH CCO HCC HCH HCO OCC OCH OCO we need CC CO CH (or CC HC OC) to cover all Cs. similarly we need HH CH OH (or HH HC HO) to cover all Hs.
we notice that we can eliminate one of them to a set of 5: CC CO CH HH OH
This allows us to get down to 1.25 for large n. But we don't know what the ends looks like. They can be: HC HO OC OO
We needs to check once for each side. This gives a total of \(1.25 + \frac{1}{(n-1)^2} + \frac{1}{n^2}\). This is below 1.4 for \(n \ge 5\).
Step 3
We need to Ad-Hoc \(n = 4\). For the ends: HCHC HCHO HCOC HCOO HOHC HOHO HOOC HOOO OCHC OCHO OCOC OCOO OOHC OOHO OOOC OOOO We already knew the inner 2 characters. We need to do this in \(0.15\). We can query CH CO OH first, if it returns any range, then we have: XX?? We can immediately brute force over all the combinations, max \(1.31\). Then we query CC and HH. If one exists, we know at least 3 characters, the last requires 1 query, max \(1.31\). If not, then the middle section is definitely OO, leave us with: OOOC HOOO OOOO Querying OOO will tell you which it is, max \(1.36\).
Step 4
We can actually push this even lower. We can build a sort of a ACAM of all the queries, and we have a match for all the positions C and H. In other words, we need any: XXCXX XXHXX to match to something if we use length 3. Though the problem is 3-SAT and non-solvable, we can manually construct it.
If we only use CC CH HH for length 2 sections: CCC 1 CCH 1 CCO 1 HCC 1 HCH 1 HCO OCC 1 OCH 1 OCO CHC 1 CHH 1 CHO 1 HHC 1 HHH 1 HHO 1 OHC OHH 1 OHO We only can't find the middle C when the section is: HCO OCO OHC OHO This replacement works because \(\frac{2}{9} < \frac{1}{4}\). This already gets us to \(\frac{43}{36}\).
However, this method only allows us to know the arrangements of \([2, n-1]\). The front and end can be anything. That gives double the coefficients.
Gemini provided an even better solution: CC HC HH OO OCO CHOH(OHOC?) (TO BE VERIFIED)