003. Triangle Sum

Codeforces
IDCF10269003
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
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. 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. Print one number, the calculated sum of the perimeters of the triangles. 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. ## 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. [samples] ## 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.
**Definitions** Let $ n \in \mathbb{Z}^+ $ be the number of equilateral triangles. Let $ T = (t_1, t_2, \dots, t_n) $ be a sequence of positive integers, where $ t_i $ is the side length of the $ i $-th triangle. **Constraints** 1. $ n \geq 1 $ 2. For all $ i \in \{1, \dots, n\} $, $ t_i \in \mathbb{Z}^+ $ **Objective** Compute the sum of the perimeters of the triangles: $$ \sum_{i=1}^{n} 3t_i $$
API Response (JSON)
{
  "problem": {
    "name": "003. Triangle Sum",
    "description": {
      "content": "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 ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269003"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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 ...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of equilateral triangles.  \nLet $ T = (t_1, t_2, \\dots, t_n) $ be a sequence of positive integers, where $ t_i $ is the side length of the $ ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments