Data Structures & AlgorithmsModerateGATE CS · Codeforces Div2 B
How many pairs x < y with 1 <= x, y <= 12 have (x + y) dividing x * y exactly?
- A. 3
- B. 4
- C. 5
- D. 7
Correct answer: A. 3
Test each pair with x < y directly; for example (3, 6) qualifies because 9 divides 18, and (4, 12) qualifies because 16 divides 48.
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 distinct values does floor(30 / k) take as k ranges over 1 to 30?
- How many triples a < b < c with a, b, c in [1, 10] satisfy a + b = c?
- What is the minimum number of characters that must be deleted from aabbaa so that no two adjacent characters of the remaining string are…
- How many distinct strings can be obtained from aabb by removing exactly one character?
- What is the sum of the decimal digits of 100!?
- How many trailing zeros does 1000! have in base 10?