Data Structures & AlgorithmsVery hardCodeforces Div2 B-D · ICPC regional

How many integers from 1 to 100 inclusive are divisible by none of 2, 3 and 5?

  1. A. 26
  2. B. 27
  3. C. 7
  4. D. 25

Correct answer: A. 26

The count of numbers coprime to 30 in 1..100 follows from inclusion-exclusion over 2, 3, 5. Summing the remainders directly gives the same result.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic