Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

HackerEarth An equilateral triangle problem solution

YASH PAL, 31 July 202413 February 2026
In this HackerEarth An equilateral triangle problem solution The shape of a network is a big equilateral triangle 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.
 
 
HackerEarth An equilateral triangle problem solution

 

 

HackerEarth An equilateral triangle problem solution.

#include<bits/stdc++.h>
using namespace std;
int n,ans;
int32_t main()
{
cin>>n;
for(int i=1;i<n;i++)
ans+=(i+1)*i*((n-i)/2)/2;
cout<<ans<<endl;
return 0;
}
 
 
coding problems solutions HackerEarth HackerEarth

Post navigation

Previous post
Next post

Leave a Reply

Your email address will not be published. Required fields are marked *

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes