my code does not check for the elements present explicitly ,like it does (IYKWIM) but yeah so the problem is that my code fails the 11th case alone and i am not able to figure it out for the past 2 days and rest of the cases are AC.
And yes it is WA for the 11th test case alone .
see the thing that they are pairwise distint is that they are "unique".
and u are asked to print n+m-1 pairs .
These two are the major hints that is required to solve the problem explaning further more u dont need to put the sum and check for them theres another way where u dont need to compute the sum at all.
I guess i have revealed the max .
Try again i was struggling with this but it is a cakewalk trust me.