Need help for a number theory problems !
Difference between en1 and en2, changed 17 character(s)
Hi everyone!↵

I recently came across this problem and I’m not sure how to approach it efficiently. Any hints or ideas would be appreciated!↵

---↵

## Problem Statement↵

### Cyclic Divisibility↵

Given three positive integers $a, b, c$, we need to find the smallest positive integer $x$ such that:↵

$$↵
a \cdot x \equiv 0 \pmod b↵
$$↵

$$↵
b \cdot x \equiv 0 \pmod c↵
$$↵

$$↵
c \cdot x \equiv 0 \pmod a↵
$$↵

---↵
## Input↵

The first line contains an integer $T$ — the number of test cases ($1 \le T \le 10^5$).↵

Each of the next $T$ lines contains three integers $a, b, c$ ($1 \le a, b, c \le 10^6$).↵

---↵

## Output↵

For each test case, print a single integer — the minimum value of $x$ satisfying the conditions.↵

---↵

## Example↵
### Input↵
```↵
2↵
4 6 10↵
12 34 56↵
```↵
### Output↵
```↵
2↵
4 6 10↵
12 34 56
30↵
1428

```↵
Thanks for reading!  ↵
Any ideas or hints would be appreciated :)↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English backupkid 2026-05-16 17:32:51 17 Tiny change: 'put\n```\n2\n4 6 10\n12 34 56\n```\nTha' -> 'put\n```\n30\n1428\n```\nTha'
en1 English backupkid 2026-05-16 16:42:46 953 Initial revision (published)