Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 B

How many index pairs i < j in [1, 2, ..., 10] (the integers 1 to 10) have i * j divisible by 4?

  1. A. 21
  2. B. 20
  3. C. 22
  4. D. 24

Correct answer: B. 20

The product is divisible by 4 when the two numbers contribute enough factors of 2: either one is divisible by 4, or both are even.

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

Exams that ask this topic