← All problemsSign in

FIND A and B

CodeChefRating 802Open on judge ↗

You are given three **distinct** positive integers $X, Y,$ and $Z$. Your task is to find integers $A$ and $B$ such that: - $B$ is equal to one of the three given numbers; - $A$ is equal to the **product** of **remaining** two numbers; - $A$ is **divisible** by $B$. Print $A$ and $B$ which satisfy the given conditions. If no such pair of $A$ and $B$ exists, print $-1$ instead. ### Input - The fir

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