Determine all pairs $(a,b)$ of real numbers with $a\leqslant b$ that maximise the integral $$\int_a^b e^{\cos (x)}(380-x-x^2) \mathrm{d} x.$$
1. **Identify the function to be integrated:**
   The integral to be maximized is:
   \[
   \int_a^b e^{\cos(x)} (380 - x - x^2) \, dx
   \]

2. **Find the roots of the quadratic function:**
   The quadratic function inside the integral is \( 380 - x - x^2 \). To find its roots, solve the equation:
   \[
   380 - x - x^2 = 0
   \]
   Rearrange it to:
   \[
   x^2 + x - 380 = 0
   \]
   Solve this quadratic equation using the quadratic formula \( x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \), where \( a = 1 \), \( b = 1 \), and \( c = -380 \):
   \[
   x = \frac{-1 \pm \sqrt{1^2 - 4 \cdot 1 \cdot (-380)}}{2 \cdot 1} = \frac{-1 \pm \sqrt{1 + 1520}}{2} = \frac{-1 \pm \sqrt{1521}}{2}
   \]
   Since \( \sqrt{1521} = 39 \), the roots are:
   \[
   x = \frac{-1 + 39}{2} = 19 \quad \text{and} \quad x = \frac{-1 - 39}{2} = -20
   \]

3. **Determine the interval for the integral:**
   The quadratic function \( 380 - x - x^2 \) is positive between its roots \( x = -20 \) and \( x = 19 \). Therefore, to maximize the integral, we should integrate over this interval.

4. **Verify the conditions \( a \leq b \):**
   Given \( a \leq b \), the interval \([-20, 19]\) satisfies this condition.

5. **Conclusion:**
   The integral is maximized when \( a = -20 \) and \( b = 19 \).

The final answer is \( \boxed{ (a, b) = (-20, 19) } \)