Sunidhi Bansal has Published 1085 Articles

Maximum number of pieces in N cuts in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:14:19

770 Views

Given the task is to calculate the maximum number of square or rectangle pieces of equal size that can be obtained by cutting a given square piece in total N number of cuts horizontally or vertically.Let’s now understand what we have to do using an example −Input − N=8Output − ... Read More

Maximum number of parallelograms that can be made using the given length of line segments in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:12:37

159 Views

Given the task is to find the maximum number of parallelograms that can be made using given N number of line segments if each line segment can be used at most in one parallelogram.Let’s now understand what we have to do using an example −Input − Arr[] = {8, 3, ... Read More

Maximum number of ones in a N*N matrix with given constraints in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:10:45

167 Views

Given the task is to find the maximum number of ones in a binary matrix possible with the following constraints.Two integers N and X are given where X

Maximum number of groups of size 3 containing two type of items in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:09:27

187 Views

Given the task is to calculate the maximum number of groups of size 3 that can be formed when N number of items of type A and M number of items of type B are given.Also, each group should have at least one item of each type, that is either ... Read More

Maximum number of dots after throwing a dice N times in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:07:36

163 Views

Given the task is to calculate the maximum number of dots that can be expected after throwing a dice N times having M faces.The first face of the dice contains 1 dot, the second face has 2 dots and so on. Likewise the M-th face contains M number of dots.The ... Read More

Maximize number of continuous Automorphic numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:05:49

304 Views

Given the task is to maximize the number of continuous Automorphic elements in a given array with N number of elements.An automorphic number is a number whose square ends with the same digits as the number itself. For example 5 is an automorphic number as 5*5 = 25 and 25 ... Read More

Maximize the size of array by deleting exactly k sub-arrays to make array prime in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:03:00

137 Views

Given the task is to delete exactly K sub-arrays from a given array Arr[] with N positive elements such that all the remaining elements in the array are prime and the size of the remaining array is maximum.Input Arr[]={4, 3, 3, 4, 3, 4, 3} , K=2Output 3Explanation − K=2, this means ... Read More

Maximize the sum of products of the degrees between any two vertices of the tree in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:59:08

293 Views

Given the task is to construct a tree with a given integer N such that, the sum of degree(x) * degree(y) for all ordered pairs (x, y) is maximum and x is not equal to y.Input −N=5Output −50Explanation    1     \      2       \   ... Read More

Maximum distinct lines passing through a single point in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:55:56

232 Views

We are given the number N and coordinates of two points (x1, y1) and (x2, y2) for each line. The goal is to find the maximum number of lines from given lines that can pass through a single point such that no two lines cover each other, and no rotation ... Read More

Maximum given sized rectangles that can be cut out of a sheet of paper in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:53:52

420 Views

We are given the dimensions of the sheet of paper, it’s Length L, and Breadth B. Also, we are given the dimensions of a small rectangle, it’s length l, and breadth b. The goal is to find the maximum number of smaller rectangles that can be cut out of a ... Read More

Advertisements