| TeamsCode Summer 2026 Contest |
|---|
| Finished |
Please note the unusual memory limit for this problem.
You are given a pair of positive integers $$$A$$$ and $$$B$$$. Simplify $$$\frac{A}{B}$$$; find the unique pair of positive integers $$$a$$$ and $$$b$$$ such that $$$\frac{A}{B} = \frac{a}{b}$$$ and $$$\text{gcd}(a, b) = 1$$$.
The input contains two positive integers $$$A$$$ and $$$B$$$, separated by " / ".
—
Tests in subtasks are numbered from $$$1−20$$$ with samples skipped. Each test is worth $$$\frac{100}{20}=5$$$ points.
Test $$$1$$$ satisfies $$$a, b \leq 10^3$$$, $$$A, B \leq 10^6$$$.
Test $$$2$$$ satisfies $$$a, b \leq 10^6$$$, $$$A, B \leq 10^{18}$$$.
Tests $$$3-5$$$ satisfy $$$a, b \leq 10^6$$$, $$$A, B \leq 10^{10^3}$$$.
Tests $$$6-7$$$ satisfy $$$a, b \leq 2$$$, $$$A, B \leq 10^{10^7}$$$.
Tests $$$8-12$$$ satisfy $$$a, b \leq 10^3$$$, $$$A, B \leq 10^{10^7}$$$.
Tests $$$13-20$$$ satisfy $$$a, b \leq 10^6$$$, $$$A, B \leq 10^{10^7}$$$.
Output two positive integers, $$$a$$$ and $$$b$$$, separated by " / ".
56 / 80
7 / 10
2358544209746913906612418916796916 / 5683441466720575133896324432207124
3229 / 7781
| Name |
|---|


