Preparing NOJ

# Line

1000ms 262144K

## Description:

You have a Black and white rectangle of $n * m$ .

As shown in the figure, there is a line segment connection coordinate $(0,0)$ and coordinates $(n , m)$ .

Please calculate the ratio of the black part to the length of the white part on this line segment .

## Input:

there are several test case . Each test cases is only one line , two integer $N$,$M$ ($1 \leq N , M \leq 1e9$) — the size of the rectangle.The input ends when $N = 0$and $M = 0$.

## Output:

Two nonnegative integer $P$ and $Q$ separated by a "$/$" — a irreducible fraction,represent the answer.

## Sample Input:

2 2
2 3
9 1
0 0

## Sample Output:

1/0
1/1
5/4

Info

Provider NOJ

Code NOJ2375

Tags

Submitted 401

Passed 92

AC Rate 22.94%

Date 08/13/2019 00:47:12

Related

Nothing Yet