Help in

Revision en1, by twoseven, 2022-01-12 12:53:52
Problem 1

Problem 2

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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English twoseven 2022-01-12 13:26:44 2
en4 English twoseven 2022-01-12 13:17:28 46
en3 English twoseven 2022-01-12 13:06:06 30
en2 English twoseven 2022-01-12 13:00:54 126 Tiny change: 'ms. Thanks. **' -> 'ms. Thanks!!**' (published)
en1 English twoseven 2022-01-12 12:53:52 2091 Initial revision (saved to drafts)