Problem Statement 2:
It is given that the beauty of one pair (student, teacher) is equal to the difference in absolute value between the index of the teacher. The beauty of all pairs is the sum of beauties of each pair.
Your task is to find a total number of ways to make N pairs (student, teacher) such that the beauty of these pairs is equal to K.
Constraints:
1 <= N <= 50
0 <= K <= N * N
Sample TestCases:
Input:
3
2
Output:
2
Explanation:
Teachers -> 1 2 3 Students -> 1 2 3. There are two possible pair groups: {(1, 2), (2, 1), (3, 3)} and {(1, 1), (2, 3), (3, 2)}
Input:
3
3
Output:
0
Explanation:
It can be seen that there are no possible groups of pairs.
Input:
50
2
Output:
49