LUCKG - Editorial

I used the same approach. But the thing doesnt work because your equation is satisfied for n=3, m=5, etc… So I changed the denominators to integer division. Now we get the equation. ((setsize-1)*m)/setsize>m/2 must be satisfied. This equation is the required one. Let me point out that even this fails for the test case: setsize=3, m=4. I had been working on this problem for 4 days, and seeing that we were supposed to brute-force did not impress me. :frowning:

1 Like

Oh. I get the equation thing. Thanks. So ultimately one needs to brute-force just for a specific case to get it accepted, that is strange. But what technique did you use to find such non common subsets according to the equation?

Also, after adding this brute-force constraint did you manage to get AC?

I went through all numbers from 1 to 1000 for n and m and realized that there is no number possible for which the equation isn’t satisfied such that n>2,m>2…except n=3 and m=4. This is where why thought process got stuck. i mathematically proved that n=3 and m=4 has no possible combination for the given pattern. After the contest, I was disappointed to see we were supposed to use brute force…but maybe the lesson to learn is not to be stuck in 1 pattern and try to clear testcases in different ways.

Well that is what competitive programming is all about. A single approach might just not be enough to solve the problem as some specific/corner test case might follow some other pattern. We get to learn something anyways :smiley:

Good Luck :slight_smile: