#P5810. [SCOI2004] 文本的输入
[SCOI2004] 文本的输入
Problem Description
When people input text, besides typing character by character, they can also use the clipboard to copy. Typing one letter takes unit of time. Copying the part that has already been typed into the clipboard takes units of time (Ctrl+A, Ctrl+C, then cancel the select-all state). Pasting the clipboard content takes units of time (Ctrl+V).
If we do not care about the actual content of the text and only care about its length, what is the minimum time needed to input a text whose length is at least ?
Note: The Constraints are slightly different from the original problem.
Input Format
A positive integer , representing the length of the text.
Output Format
A positive integer , representing the minimum time needed.
20
16
Hint
Sample explanation: First spend units of time to type characters, then copy (costs units of time), paste twice (costs units of time), and you can type characters in units of time.
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5