#K66027. Total Gravitational Force
Total Gravitational Force
Total Gravitational Force
Given the masses of a set of celestial bodies, calculate the total gravitational force between every unique pair. The gravitational force between two bodies with masses \( m_i \) and \( m_j \) is given by \( F_{ij} = m_i \times m_j \), since the distance between each pair is fixed at 1 unit and the gravitational constant \( G \) is 1. Compute the sum of these forces for all distinct pairs and print the result rounded to two decimal places.
inputFormat
The input consists of two lines. The first line contains a single integer \( n \) representing the number of celestial bodies. The second line contains \( n \) space-separated integers representing the masses of the celestial bodies.
outputFormat
Output a single floating-point number representing the total gravitational force, rounded to two decimal places.
## sample3
2 3 5
31.00