Codeforces Round #665 (Div. 2) B. Ternary Sequence
TitleCodeForces1401B.TernarySequenceTimeLimit2secondsMemoryLimit256megabytesProblemDescriptionYouaregiventwosequencesa1,a2,…,ana_1,a_2,\dots,a_na1,a2,…,anandb1,b2,…,bnb_1,b_2,\dots,b_nb1,b2,…,bn.Eache