
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
At a trade fair, in the consumer goods exhibition area, a company brought a new energy-saving and environmentally friendly product for exhibition and decided to mass-produce it for the market. It is known that the annual fixed R&D cost of the product is $1.5$ million yuan, and an additional $380$ yuan is required for each unit produced. Let the company produce $x$ thousand units of this product in a year and sell them all. The sales revenue per thousand units is $R$ million yuan, and $R=\left\{\begin{array}{l}500-2x,0＜x≤20\\ 370+\frac{2140}{x}-\frac{6250}{{x}^{2}},x＞20\end{array}\right.$.<br/>$(1)$ Write the function expression of the annual profit $S$ (in million yuan) in terms of the annual production quantity $x$ (in thousand units). (Profit $=$ Sales Revenue $-$ Cost)<br/>$(2)$ For how many thousand units of production does the company achieve maximum profit, and what is the maximum profit?

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