Submit | All submissions | Best solutions | Back to list |
FINFRAC - Finding Fractions |
English | Vietnamese |
Cho a,b,c,d, tìm phďż˝n sáť p/q váťi q nháť nhẼt, và tháťa mãn a/b < p/q < c/d.
Input
Máťi test trên máťt dòng, chᝊa 4 sáť nguyên a,b,c,d.
Output
Váťi máťi test, in ra phďż˝n sáť tìm �ưᝣc (xem vďż˝ d᝼). Náşżu cďż˝ nhiáťu ��p ďż˝n, in ra phďż˝n sáť váťi p nháť nhẼt.
Example
Input: 1 3 1 2 2 1 3 1 2 1 4 1 1000 1001 1001 1002 Output: 2/5 5/2 3/1 2001/2003
Constraints
Dataset 1: a,b,c,d ( 1 <= a,b,c,d <= 1e9, và a/b < c/d ).
Added by: | Race with time |
Date: | 2009-02-19 |
Time limit: | 3s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ERL JS-RHINO NODEJS PERL6 VB.NET |
Resource: | Code Craft 09 |