Distributing Natural Numbers into Two Sets with Equal Absolute Sum
Given N and M, distribute first N natural numbers in two sets such that the absolute sum of the numbers in the two sets is equal to M. If possible, print the sum of the numbers in the two sets separated by a space, otherwise, print “Not Possible“. Examples: Input : 7 4 Output : 16 12 Explanation… Read More »