Must Be Divisible
Chef likes sequences of integers and in particular, he likes arithmetic progressions. There are two integers $N$ and $K$. Chef wants to choose a starting positive integer $A$, create the sequence $(A, A+K, A + 2 \cdot K, \ldots, A + (N-1) \cdot K)$ and compute the product of all elements of this sequence; let's denote this product by $X$. For example, if $N=3$ and $K=2$, then Chef can create th
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