there n problem prepare Codeforces round they arrange ascending order difficulty problem difficulty moreover m pair similar problem author want split problem division accord follow rule Problemset division nonempty each problem exactly division yes unusual requirement each problem division 1 hard problem division 2 if problem similar different division your goal count number way split problem division satisfy rule two way split problem consider different problem belong division 1 division 2 otherNote relation similarity transitive that problem similar problem j problem j similar problem k do not follow similar k