Data Structures & AlgorithmsHardGATE CS · ICPC regional
What is the smallest integer x greater than 100 with x congruent to 3 modulo 7 and x congruent to 5 modulo 11?
- A. 116
- B. 117
- C. 119
- D. 115
Correct answer: D. 115
The Chinese remainder theorem gives a unique solution modulo 77; search upward from 101 and check both congruences.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- How many integers in [1, 200] are coprime to 210?
- What is the sum of all integers in [1, 50] that are either perfect squares or perfect cubes?
- What is the greatest common divisor of 6, 24, 60, 120 and 210?
- How many trailing zeros does 50! have when written in base 12 (note 12 = 2^2 3)?
- How many integers x in [1, 1000] satisfy x ≡ 2 (mod 13) and x ≡ 5 (mod 17)?
- How many index pairs i < j in [1, 2, ..., 10] (the integers 1 to 10) have i j divisible by 4?