Problem Statement
You have already typed one emoticon into the chat. Then, you realized that typing is slow. Instead, you will produce the remaining emoticons using copy and paste.
You can only do two different operations:
- Copy all the emoticons you currently have into the clipboard.
- Paste all emoticons from the clipboard.
Return the smallest number of seconds in which you can turn the one initial emoticon into smiles emoticons.
Definition
- Class:
- EmoticonsDiv2
- Method:
- printSmiles
- Parameters:
- int
- Returns:
- int
- Method signature:
- int printSmiles(int smiles)
- (be sure your method is public)
Constraints
- smiles will be between 2 and 1000, inclusive.
Examples
2
Returns: 2
First use copy, then use paste. The first operation copies one emoticon into the clipboard, the second operation pastes it into the message, so now you have two emoticons and you are done.
6
Returns: 5
Copy. This puts one emoticon into the clipboard. Paste. You now have 2 emoticons in the message. Copy. The clipboard now contains 2 emoticons. Paste. You now have 4 emoticons in the message. Paste. You now have 6 emoticons in the message and you are done.
11
Returns: 11
16
Returns: 8
1000
Returns: 21
3
Returns: 3
4
Returns: 4
5
Returns: 5
7
Returns: 7
8
Returns: 6
9
Returns: 6
11
Returns: 11
12
Returns: 7
13
Returns: 13
99
Returns: 17
14
Returns: 9
15
Returns: 8
17
Returns: 17
21
Returns: 10
24
Returns: 9
29
Returns: 29
31
Returns: 31
32
Returns: 10
33
Returns: 14
87
Returns: 32
93
Returns: 34
101
Returns: 101
123
Returns: 44
321
Returns: 110
254
Returns: 129
255
Returns: 25
256
Returns: 16
257
Returns: 257
300
Returns: 17
343
Returns: 21
400
Returns: 18
500
Returns: 19
601
Returns: 601
699
Returns: 236
765
Returns: 28
897
Returns: 39
893
Returns: 66
901
Returns: 70
989
Returns: 66
990
Returns: 24
991
Returns: 991
992
Returns: 41
993
Returns: 334
994
Returns: 80
995
Returns: 204
996
Returns: 90
997
Returns: 997
998
Returns: 501
999
Returns: 46
971
Returns: 971
125
Returns: 15
955
Returns: 196
53
Returns: 53
49
Returns: 14
333
Returns: 43
37
Returns: 37