Computer Science, asked by avik81231, 1 month ago

In a birthday party, the host decides to gift the guest who wins a game in the party. In the game, the host announces an odd number and asks the participants to find all the maximum sized sumfree subsets. The participants will then add all the elements of the sumfree subsets. A set is a sumfree set if no element of the set is the sum of any other two elements in the set. An element can also be considered twice to get the sum. The participant is declared a winner if he/she tells the corre total sum of the elements of all the maximal sized sumfree sets. He/She will get number of gifts equal to the total sum. Write an algorithm to find the maximum number of gifts a participant can win. Input The input consists of an integer N, representing the odd number announced by the host. Output Print an integer representing the maximum number of gifts a participant can win.

Answers

Answered by shaikhimaadrafi
1

Explanation:

In a birthday party, the host decides to gift the guest who wins a game in the party. In the game, the host announces an odd number and asks the participants to find all the maximum sized sumfree subsets. The participants will then add all the elements of the sumfree subsets. A set is a sumfree set if no element of the set is the sum of any other two elements in the set. An element can also be considered twice to get the sum. The participant is declared a winner if he/she tells the corre total sum of the elements of all the maximal sized sumfree sets. He/She will get number of gifts equal to the total sum. Write an algorithm to find the maximum number of gifts a participant can win. Input The input consists of an integer N, representing the odd number announced by the host. Output Print an integer representing the maximum number of gifts a participant can win.

Similar questions