human
Find K numbers with sum equal to N and sum of their squares maximized | Function that prints the required K numbers.
Print 1 , K - 1 times.
Print ( N - K + 1 ).
Driver code"
Solution in Python:
assistant
#Here is code to find K numbers with sum equal to N and sum of their squares maximized and the other steps required.
 def printKNumbers ( N , K ) :
	for i in range ( K - 1 ) :
		print ( 1 , end = ' ▁ ' )
	print ( N - K + 1 )
if __name__ == ' _ _ main _ _ ' :
	( N , K ) = ( 10 , 3 )
	printKNumbers ( N , K )