GCD SEQUENCE
CodeChefOpen on judge ↗
Problem description. Given an array A of N elements.Find the maximum length K such that B is a sub-sequence of A of size K where gcd(B1,B2,B3,.....,BK)>1 Input First line of input contains T(total number of test cases). First line of each test case contains N(number of elements). Second line of each test case contains array A. Output For each test case output maximum length K in a new line
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