← All problemsSign in

3 - Puzzle with division

You are given an array of positive integers $a_1, a_2, \ldots, a_n$. You should find another array of positive integers $b_1, b_2, \ldots, b_n$ that satisfies the following conditions: - For all $1 \leq i \leq n$, $b_i\le 10^{18}$. - For all $1 \leq i \leq n$, $a_i$ divides $b_i$. - For all $1 \leq i \leq n$, $b_i$ divides $b_{i-1} \cdot b_{i + 1}$ (we consider $b_0 = b_n$ and $b_{n+1}=b_1

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