TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Given a,b,c,d, find a fraction p/q with minimum q, and satisfied a/b < p/q < c/d.

Input Format

For each test case, one line contains four integers a,b,c,d .
(1<=a,b,c,d<=109, and a/b < c/d)

Output Format

For each test case, print the fraction(see the sample for details).If multiple solution exists, output the one with minimum p.

Sample Input 1

1 3 1 2
2 1 3 1
2 1 4 1
1000 1001 1001 1002

Sample Output 1

2/5
5/2
3/1
2001/2003

Hints

Problem Source

Migrated from old NTUJ.

CodeCraft'09

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 4096