Question: The code should be written in C++ Task Divisors A sequence of n integers, each no greater than 1000 (by absolute value), is given. Write
The code should be written in C++
Task Divisors A sequence of n integers, each no greater than 1000 (by absolute value), is given. Write program divisors, which finds how many of the given integers have the following property: the integer is divided exactly by m positive divisors (each divisor should not be equal to 1, or to the integer itself). Input The first line of the standard input contains the values of n and m. The second line contains the given sequence of integers. Output The standard output has to contain one integer - the amount of the elements of the given sequence, which have exactly m distinct divisors. Constraints: isns 200 1 sms 10 Example: Input: 74 6 20 12 64 1024 50 24 Output: 3 Explanation: The elements of the given sequence with exactly 4 divisors are 20, 12 and 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
