Data Structures & AlgorithmsVery hardGATE CS · ICPC regional

How many integers x in [1, 1000] satisfy x ≡ 2 (mod 13) and x ≡ 5 (mod 17)?

  1. A. 4
  2. B. 5
  3. C. 6
  4. D. 8

Correct answer: A. 4

The two congruences determine x modulo 221, so there are about 1000/221 solutions: exactly the values of the form x0 + 221k inside the range.

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

Exams that ask this topic