Find K numbers with sum equal to N and sum of their squares maximized
Given two integers N and K, the task is to find K numbers(A1, A2, â¦, AK) such that ?i=1KAi is equal to N and ?i=1KAi2 is maximum.Examples: Input: N = 3, K = 2 Output: 1 2 Explanation: The two numbers are 1 and 2 as their sum is equal to N and 12 + 22 is maximum.Input: N = 10, K = 3 Output: 1 8 1 App