D. Upgrading Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have an array of positive integers a[1], a[2], ..., a[n] and a set of bad prime numbers b1, b2, ..., bm. The prime num…