Can anyone help me in understanding the test case 2
+1 its so weird
Solving by hand, I got answer as 31/7. This corresponds to output 31 * power(7, M-2) % M, right? This was not matching with the answer given.
I tried to multiply the given answer by natural numbers and found that 416666673 * 12 % M was coming out to be 41, which is a ‘nice’ number. So I thought maybe somehow the answer has to be 41/12. But it came out to be 31/7 for me by and by my code.
same mere sath bhi yhi hua bs itna hi likal paya. I not able to understand how sum is 41 and total subset is 12