Data Structures & AlgorithmsModerateGATE CS · Codeforces Div2 B
How many integers x with 1 <= x <= 500 satisfy x mod 7 = x mod 11?
- A. 49
- B. 48
- C. 42
- D. 6
Correct answer: B. 48
x mod 7 = x mod 11 = r means x ≡ r (mod 77) with 0 ≤ r ≤ 6, so 7 of every 77 integers qualify: 6 full blocks give 42, and 462–468 add 7 more, minus x = 0, giving 48. Including 0 gives 49, skipping the partial block gives 42, and 6 counts blocks.
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 ordered pairs (i, j) with 1 <= i, j <= 20 have i^2 + j^2 divisible by 5?
- How many integers x with 1 <= x <= 600 are divisible by 4 or 6 but not by 12?
- How many contiguous subarrays of [6, 12, 18, 8, 4] have gcd exactly equal to 2?
- What is the least common multiple of the integers 2 through 20, reduced modulo 1000000007?
- How many contiguous subarrays of [2, 5, 3, 4, 10] have a product divisible by 10?
- How many integers from 1 to 1000 have digit sum exactly 10 and are odd?