
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given that the cost of producing $x$ units of a product in a certain factory is $C=25000+200x+\frac{1}{40}x^2$ (in yuan), find:

$(1)$ The number of units that should be produced to minimize the average cost.

$(2)$ The number of units that should be produced to maximize the profit if each unit is sold for 500 yuan.

Present the answer in LaTex format: \boxed{Your answer}
user