Category Archives: Geometric

Count of acute, obtuse and right triangles with given sides

Given an array of n positive distinct integers representing lengths of lines that can form triangle. The task is to find the number of acute triangles, obtuse triangles, and right triangles separately that can be formed from the given array. Examples: Input : arr[] = { 2, 3, 9, 10, 12, 15 }. Output :… Read More »

Paper Cut into Minimum Number of Squares

Given a paper of size A x B. Task is to cut the paper into squares of any size. Find the minimum number of squares that can be cut from the paper. Examples: Input : 13 x 29 Output : 9 Explanation : 2 (squares of size 13×13) + 4 (squares of size 3×3) +… Read More »

Count of parallelograms in a plane

Given some points on a plane, which are distinct and no three of them lie on the same line. We need to find number of Parallelograms with the vertices as the given points. Examples: Input : points[] = {(0, 0), (0, 2), (2, 2), (4, 2), (1, 4), (3, 4)} Output : 2 Two Parallelograms… Read More »

Circle and Lattice Points

Given a circle of radius r in 2-D with origin or (0, 0) as center. The task is to find the total lattice points on circumference. Lattice Points are points with coordinates as integers in 2-D space. Example: Input : r = 5. Output : 12 Below are lattice points on a circle with radius… Read More »