you give multiset a b each multiset exactly n integer 1 n inclusive Multisets contain multiple copy numberyou like find nonempty subset a nonempty subset b sum element subset equal Subsets multiset ie contain element equal valuesif solution exist print 1 otherwise print index element subset a b sum