You have a collection of books on a shelf and you want to determine how many of them have a certain level of complexity. Each book has a unique positive integer identifier. You have a list of K integers representing the
maximum sum of the powers of prime factors that each book can have to be considered "complex".
Count the number of books on the shelf that are considered "complex" based on the given criteria, and whose identifier is within the range I to r (inclusive)
Complete the spicyNumbers function. This function takes the following 4
parameters and returns the list of integer values:
Given two integers N and K.
Find out the of number of pairs (x, y) such that GCD(x , y) = K and 1 ≤ x, y ≤ N where GCD(x,y) is the greatest common divisor of x and y.
Complete the KGCD function. This function takes the following 2 parameters and returns the count of required pairs:
Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code.
For each test case:
Sample Input Sample Output
3 1
1 1 1
3 3 3
4 2