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

HackerEarth An equilateral triangle problem solution

YASH PAL, 31 July 202411 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 *

Pages

  • About US
  • Contact US
  • Privacy Policy

Follow US

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