Imagine you have a special keyboard with the following keys:
'A' on the screen.Given an integer n, return the maximum number of 'A' you can print on the screen with at most n presses on the keys.
Example 1:
Input: n = 3
Output: 3Explanation:
We can at most get 3 A's on screen by pressing the following key sequence:
A, A, A
Example 2:
Input: n = 7
Output: 9Explanation:
We can at most get 9 A's on screen by pressing following key sequence:
A, A, A, Ctrl A, Ctrl C, Ctrl V, Ctrl V
Constraints:
1 <= n <= 50