CF1736D Equal Binary Subsequences
Description
Can you partition $ s $ into two disjoint equal subsequences after performing the allowed operation exactly once?
A partition of $ s $ into two disjoint equal subsequences $ s^p $ and $ s^q $ is two increasing arrays of indices $ p\_1, p\_2, \\ldots, p\_n $ and $ q\_1, q\_2, \\ldots, q\_n $ , such that each integer from $ 1 $ to $ 2n $ is encountered in either $ p $ or $ q $ exactly once, $ s^p = s\_{p\_1} s\_{p\_2} \\ldots s\_{p\_n} $ , $ s^q = s\_{q\_1} s\_{q\_2} \\ldots s\_{q\_n} $ , and $ s^p = s^q $ .
If it is not possible to partition after performing any kind of operation, report $ -1 $ .
If it is possible to do the operation and partition $ s $ into two disjoint subsequences $ s^p $ and $ s^q $ , such that $ s^p = s^q $ , print elements of $ b $ and indices of $ s^p $ , i. e. the values $ p\_1, p\_2, \\ldots, p\_n$$$.