# Tag Archives: Maths

## Possible values of Q such that, for any value of R, their product is equal to X times their sum

Given an integer X, the task is to find the possible values of Q for the pair (Q, R) such that their product is equal… Read More »

## Construct a square Matrix whose parity of diagonal sum is same as size of matrix

Given an integer N representing the size of the matrix, the task is to construct a square matrix N * N which have element from… Read More »

## Convert Unix timestamp to DD/MM/YYYY HH:MM:SS format

Given a Unix Timestamp T (in seconds) for a given point in time, the task is to convert it to human-readable format (DD/MM/YYYY HH:MM:SS) Example:… Read More »

## Count of numbers upto M divisible by given Prime Numbers

Given an array arr[] of Prime Numbers and a number M, the task is to count the number of elements in the range [1, M]… Read More »

## Find a number M < N such that difference between their XOR and AND is maximum

Given a natural number N, the task is to find a number M smaller than N such that the difference between their bitwise XOR (N… Read More »

## Count of N digit Numbers whose sum of every K consecutive digits is equal

Given two integers N and K, the task is to find the total count of N-digit number such that the sum of every K consecutive… Read More »

## Perfect Square factors of a Number

Given an integer N, the task is to find the number of factors of N which are perfect square.Examples:  Input: N = 100 Output: 4 Explanation: There are… Read More »

## Nth angle of a Polygon whose initial angle and per angle increment is given

Given four integers N, A, K, n where N represents the number of sides the polygon, A represents the initial angle of the polygon, K… Read More »

## Area of a Square | Using Side, Diagonal and Perimeter

Given one of the Sides S, Diagonal D, or Perimeter P of the square, the task is to find the area of the square with… Read More »

## Arrange the numbers in the Array as per given inequalities

Given a list of N distinct integers and a list of N-1 inequality signs, the task is to insert the integers between the inequality signs,… Read More »

## Minimum number of squares whose sum equals to a given number N | Set-3

Pre-requisite: Lagrange’s Four-Square Theorem, Legendre’s Three-Square Theorem A number can always be represented as a sum of squares of other numbers. Note that 1 is… Read More »

## Number of ways to sum up a total of N from limited denominations

Given a number N and two arrays arr1[] and arr2[] of length 4. The array arr1[] denotes the denomination of 1, 5, 10, and 20… Read More »

## Min operations to reduce N to 1 by multiplying by A or dividing by B

Given a number N and two integers A and B, the task is to check if it is possible to convert the number to 1… Read More »

## Maximum inversions in a sequence of 1 to N after performing given operations at most K times

Given two integers N and K, the task is to find the maximum number of inversion in a sequence of first N natural numbers after… Read More »

## Count of natural numbers in range [L, R] which are relatively prime with N

Given three integers N, L, and R. The task is to calculate the number of natural numbers in the range [L, R] (both inclusive) which… Read More »