Data Structures & AlgorithmsVery hardGATE CS · ICPC regional

How many pairs (a, b) with 1 <= a <= b <= 12 satisfy lcm(a, b) > 36?

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

Correct answer: C. 20

Each pair is counted once with a <= b, and a pair such as (a, a) has lcm a, which never exceeds 36 here. Checking each pair directly is feasible at this size.

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

Exams that ask this topic