Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 50Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started