human
How to print maximum number of A 's using given four keys | A recursive function that returns the optimal length string for N keystrokes.
The optimal string length is N when N is smaller than.
Initialize result.
TRY ALL POSSIBLE BREAK - POINTS For any keystroke N , we need to loop from N - 3 keystrokes back to 1 keystroke to find a breakpoint ' b ' after which we will have Ctrl - A , Ctrl - C and then only Ctrl - V all the way ..
If the breakpoint is s at b 'th  keystroke then the optimal string  would have length  (n-b-1)*screen[b-1];.
Driver program.
for the rest of the array we will rely on the previous entries to compute new ones"
Solution in Python:
assistant
#Here is code to how to print maximum number of A 's using given four keys and the other steps required.
 def findoptimal ( N ) :
	if N <= 6 :
		return N
	maxi = 0
	for b in range ( N - 3 , 0 , - 1 ) :
		curr = ( N - b - 1 ) * findoptimal ( b )
		if curr > maxi :
			maxi = curr
	return maxi
if __name__ == ' _ _ main _ _ ' :
	for n in range ( 1 , 21 ) :
		print ( ' Maximum ▁ Number ▁ of ▁ As ▁ with ▁ ' , n , ' keystrokes ▁ is ▁ ' , findoptimal ( n ) )