Data Structures & AlgorithmsHardCodeforces Div2 B-D · ICPC regional

How many integers from 1 to 200 inclusive are divisible by 4 or by 6 but not by 12?

  1. A. 51
  2. B. 52
  3. C. 67
  4. D. 16

Correct answer: A. 51

Multiples of 4 or 6 are multiples of 4 plus multiples of 6 minus multiples of 12 (the lcm). Removing those divisible by 12 afterwards gives the stated set.

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

Exams that ask this topic