#P6160. [Cnoi2020] 向量

[Cnoi2020] 向量

Description

Take the ice house as the origin. The positions of the Sangetsusei are denoted by vectors a\vec{a}, b\vec{b}, c\vec{c}.

By definition, a=r1|\vec{a}|=r_1, b=r2|\vec{b}|=r_2, c=r3|\vec{c}|=r_3.

Now Cirno assigns you the task of computing the destruction limit index σ\sigma.

$$\sigma=\min\{\vec{a}\cdot\vec{b}+\vec{b}\cdot\vec{c}+\vec{c}\cdot\vec{a}\}$$

Here, “\cdot” denotes the vector dot product.

Input Format

One line with three integers r1r_1, r2r_2, r3r_3, guaranteed that r1r2r3r_1 \le r_2 \le r_3.

Output Format

One line with one real number σ\sigma. (Keep one digit after the decimal point.)

3 4 5
-25.0
159 473 824 
-445561.0

Hint

Sample1 Explanation

The answer is minimized when $\cos\langle\vec{a},\vec{b}\rangle=0,\cos\langle\vec{b},\vec{c}\rangle=-\frac{4}{5},\cos\langle\vec{c},\vec{a}\rangle=-\frac{3}{5}$.

Required Math Knowledge

  • Definition of dot product: $\vec{a}\cdot\vec{b}=|\vec{a}||\vec{b}|\times \cos\langle\vec{a},\vec{b}\rangle$
  • Coordinate form of dot product: (x1,y1)(x2,y2)=x1x2+y1y2(x_1,y_1)\cdot(x_2,y_2)=x_1x_2+y_1y_2

Constraints

This problem uses bundled testdata.

  • Subtask 1 (20%20\%): r1=r2=r3r_1=r_2=r_3
  • Subtask 2 (40%40\%): r1,r2,r310r_1,r_2,r_3 \le 10
  • Subtask 3 (40%40\%): r1,r2,r3109r_1,r_2,r_3 \le 10^9

For 100%100\% of the testdata, 0<r1r2r31090 < r_1 \le r_2 \le r_3 \le 10^9.

Translated by ChatGPT 5