An equilateral triangle
Practice
3.8 (30 votes)
Basic programming
Basics of implementation
Combinatorics
Easy
Implementation
Problem
90% Success 5878 Attempts 20 Points 1s Time Limit 32MB Memory 1024 KB Max Code

The shape of a network is a big equilateral triangle as shown in the following picture and it consists of many small equilateral triangles of different sizes. Each point represents a computer and you have to choose a rectangle such that each of its corners is a computer and the horizontal edges are parallel with the lower edge of the network(big triangle) The size of the network is the number of small triangles on each edge of the big triangle. You need to count the number of rectangles that can be selected from the network.

Network with the size 5 and two rectangles are shown with green and red

Input format
A single line which contains an integer \(n\) (\(1 \leq n \leq 100\)) that represents the length of the sides of the triangles of the network.

Output format
Print an integer that represents the number of rectangles that we can choose

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
441 votes
Tags:
ApprovedEasyMathOpen
Points:20
45 votes
Tags:
Basic ProgrammingBasics of ImplementationEasyImplementation
Points:20
67 votes
Tags:
Basic ProgrammingBasics of ImplementationEasyImplementation