Given a rectangle of length L and breadth B, the task is to print the maximum integer altitude possible of the largest triangle that can be inscribed in it, such that the altitude of the triangle should be equal to half of the base....
Given an ellipse with major axis length and minor axis 2a & 2b respectively which inscribes a square which in turn inscribes a reuleaux triangle. The task is to find the maximum possible area of this reuleaux triangle.Examples:...
Given an array arr[] consisting of N pair of integers representing coordinates of N points, the task is to find the area of the largest rectangle formed by straight lines drawn parallel to X and Y-axis from a given set of points....
There are many ways of classifying algorithms and a few of them are shown below:...
We have a stick of length L. The stick got broken at (n-1) randomly chosen points (lengths of parts can be non-integer or floating point numbers also) so we get n parts. We need to find the probability that these n pieces can form a n sided polygon. Examples:...
In geometry, Descartes’ theorem states that for every four mutually tangent circles, the radii of the circles satisfy a certain quadratic equation. One can construct a fourth circle tangent to three given, mutually tangent circles. Descartes’ Circle Theorem helps us to find the radius of a circle when there are 4 circles with positive integer radius r1, r2, r3 and r4 as shown in the figure below. It finds the radius r4 of the circle formed by three circles of radius r1, r2, r3 as shown in the image below. (Note that the circles in the picture below are tangent to each other.)...
Given an integer N, the task is to find the total number of right angled triangles that can be formed such that the length of any side of the triangle is at most N....
Given a set of lines represented by a 2-dimensional array arr consisting of slope(m) and intercept(c) respectively and Q queries such that each query contains a value x. The task is to find the maximum value of y for each value of x from all the given a set of lines....
Given a positive integer n, the task is to find the sum of series...
Given an array of n integers, slope of a line i. e., m and the intercept of the line i.e c, Count the number of ordered pairs(i, j) of points where i ? j, such that point (Ai, Aj) satisfies the line formed with given slope and intercept....
Given an integer a as the side of the square ABCD. The task is to find the area of the leaf AECFA inside the square as shown below:...
In normal median, we find a point that has minimum sum of distances. Similar concept applies in 2-D space. Given N points in 2-D space, the task is to find out a single point (x, y) from which the sum of distances to the input points are minimized (also known as the centre of minimum distance).Examples:...