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 Teaching how to draw problem solution

YASH PAL, 31 July 202413 February 2026
In this HackerEarth Teaching how to draw problem solutions HackerMan has brought a new drawing book for his child, which consists only of geometric shapes. Its consists of lessons where the child has to make drawings using geometric shapes. The first lesson is based on how to use squares to build different objects.
 
You are task is to help HackerMan in teaching one part of this lesson. You have to help him in determining, given S number of squares, how many distinct rectangles you can build out of that.
 
Two rectangles are considered different if none of them can be rotated and moved to obtain the second one. During rectangle construction, the child can neither deform the squares nor put any squares upon any other ones.

 

HackerEarth Teaching how to draw problem solution

 

HackerEarth Teaching how to draw problem solution.

#include <bits/stdc++.h>

using namespace std;

int main()
{
int t , n;

cin >> t;

while(t--){

cin >> n;

int i = 1, ans = 0;

while(n / i >= i){

ans += n / i - (i - 1);
i++;
}

cout << ans << "n";
}


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