> For the complete documentation index, see [llms.txt](https://heunnajo.gitbook.io/algorithms-problem-solving-skills/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heunnajo.gitbook.io/algorithms-problem-solving-skills/dynamic-programming/make-1.md).

# Make 1

10의 경우, ① 10->9->3->1 (3번) ②10->5->4->2->1(4번) 주어진 연산 대로라면 2로 나누어떨어지기 때문에 ②의 순서로 진행하는 것이 맞지만, 반례가 존재한다. 1로 먼저 빼주는 것이 더 빠르게 1로 만들어진다.

따라서 비교해야한다. 2로 나누어떨어지는 경우라도, 2로 먼저 나눴을 때가 연산 최소 횟수인지, 1을 먼저 뺐을 때가 연산 최소 횟수인지.

d\[10] = Math.min(go(5)+1,go(9)+1) = Math.min(go(n/2)+1,go(n-1)+1)\
\=> 첫번째 비교 대상 : go(n/2)+1은 재귀함수로 n/2를 얻기 때문에 n=>n/2로 2로 나누는 연산을 한번 하기 때문엥 go(n/2)+1이 된다.\
\=> 두번째 비교 대상 : go(n-1)+1 은 재귀함수로 n-1을 얻기 때문에 n=>n-1로 1 빼는 연산을 한번 하기 때문에 go(n-1) +1이 된다.\
d\[10]은 2개 중에 최솟값을 선택한다!\
다른 숫자 n들도 ㅗ마찬가지로, 1을 먼저 뺐을 때 연산 횟수와 2 또는 3으로 나누어 떨질 때 먼저 ㄴ누고 나서 만든 연산 횟수를 비교해서 최솟값을 선택한다!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://heunnajo.gitbook.io/algorithms-problem-solving-skills/dynamic-programming/make-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
