HCF SUM
CodeChefOpen on judge ↗
You are given two arrays A and B containing n elements each. Choose a pair of elements (x,y) such that: - x belongs to array A . - y belongs to array B . - HCF(x,y) is maximum of all pairs (x,y). If there is more than one such pair (x,y) having maximum HCF, then choose the one with maximum sum. Print the sum of elements of this maximum-sum pair. Note: HCF(x,y) returns the largest integer that d
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