003. Triangle Sum

003. Triangle Sum
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Triangles are one of the simplest geometric shapes. Equilateral triangles have the special property of all three of their sides being equal to each other. In this problem, you will be given a list of side lengths of equilateral triangles. You should find the sum of the perimeters of the triangles, given that the triangles are all equilateral.
Input
The first line of the input will contain a positive integer n indicating the number of triangles. Each of the next n lines will contain an integer t, indicating the side length of each triangle.
Output
Print one number, the calculated sum of the perimeters of the triangles.
Example
input
Copy
3
3
4
6
output
Copy
39
Note
In the example, the first triangle has a side length of 3, so it has a perimeter of 9. The second triangle has a perimeter of 12, and the third triangle has a perimeter of 18.

Comments

Popular posts from this blog

How to pass parameters in webhook?

Access and modify all the resources of our Wiki.js using WikiJS API

Fahrenheit to Celsius