Help your friends
Three software engineers are sitting in CCD , tackling a problem. These engineers have been hired by a bank and they need to solve this problem which is crucial for the efficient functioning of the banking processes. The problem is stated below: You have to answer K queries. Each query is described by 4 integers: a, b, l, r You have to find max( gcd(p,q) , such that a ≤ p ≤ b and l ≤ q ≤ r ). p
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start