
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
A certain factory plans to invest a certain amount of funds to produce two new products, A and B. The average cost-profit function $f(x)$ (unit: ten thousand yuan) of product A with investment cost $x$ (unit: ten thousand yuan) satisfies: $f(x)=\frac{{alnx}}{x}+\frac{5}{x}-b$ (where $a$ and $b$ are constants, $a,b\in R$); the average cost-profit function $g(x)$ (unit: ten thousand yuan) of product B with investment cost $x$ (unit: ten thousand yuan) satisfies: $g(x)=\frac{{2\sqrt{x}}}{x}$. It is known that when investing in product A with $1$ ten thousand yuan and $10$ ten thousand yuan, the profits obtained are $5$ ten thousand yuan and $16.515$ ten thousand yuan, respectively. (Average cost-profit $=\frac{{profit}}{{investment cost}}$)<br/>$(1)$ Find the values of $a$ and $b$;<br/>$(2)$ If the factory plans to invest $50$ ten thousand yuan in the production of products A and B, with each product investing no less than $10$ ten thousand yuan, how should the $50$ ten thousand yuan be allocated to maximize the profit of the factory? What is the maximum profit in ten thousand yuan?<br/>$(Reference data: \ln 10=2.303, \ln 5=1.609)$

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