Spongebob tired try reason weird action calculation simply ask find pair n m exactly x distinct square table consist n row m column for example 35 table 15 square 8 square 3 square the total number distinct square 35 table 158326