Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedThe 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

use the chi-square table, Table VII.

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago