
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: In triangle $\triangle ABC$, the lengths of sides $AB$ and $AC$ are the two real roots of the quadratic equation in $x$: $x^2 - (2k+3)x + k^2 + 3k + 2 = 0$, and the length of the third side $BC$ is 5.  
(1) For what value of $k$ is $\triangle ABC$ a right-angled triangle with $BC$ as the hypotenuse?  
(2) For what value of $k$ is $\triangle ABC$ an isosceles triangle? Also, find the perimeter of $\triangle ABC$.

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