← All problemsSign in

Simple Problem 010

Given an array of integers a1,a2,a3,....aN of length N.These integers are PIN code of N cities of ChefLand.There is a two way connecting path between each pairs of city $ ai $ and $ aj $ ($1 \leq i \leq N$ ,$1 \leq j \leq N$) if and only if the PIN codes of these pairs of cities are Coprime( $ ai $ and $ aj $ are $ Coprime $),and length of path would be sum of PIN code($ ai $ + $ aj $). Chef

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start