Given a range (l, r) where 0.0 <= l,r <= 1.0 we want to find a fraction x/y which satisfies following condition: l <= x/y < r and y should be as small as possible. l and r might have at most 9 digits after floating point.

In the period between Nov. 28, 00:00 (UTC) and Nov. 28, 02:30 (UTC) Codeforces and Polygon will be possibly unavailable because of maintenance.
×

Before contest

Codeforces Round #687 (Div. 1, based on Technocup 2021 Elimination Round 2)

32:26:30

Register now »

Codeforces Round #687 (Div. 1, based on Technocup 2021 Elimination Round 2)

32:26:30

Register now »

*has extra registration

Before contest

Codeforces Round #687 (Div. 2, based on Technocup 2021 Elimination Round 2)

32:26:30

Register now »

Codeforces Round #687 (Div. 2, based on Technocup 2021 Elimination Round 2)

32:26:30

Register now »

*has extra registration

# | User | Rating |
---|---|---|

1 | tourist | 3687 |

2 | ecnerwala | 3600 |

3 | Benq | 3503 |

4 | ksun48 | 3421 |

5 | Um_nik | 3412 |

6 | Radewoosh | 3382 |

7 | maroonrk | 3323 |

8 | Itst | 3239 |

9 | apiadu | 3238 |

10 | ko_osaga | 3232 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 205 |

2 | SecondThread | 198 |

3 | Monogon | 195 |

4 | vovuh | 189 |

5 | Um_nik | 186 |

6 | pikmike | 185 |

7 | antontrygubO_o | 184 |

8 | Ashishgup | 182 |

9 | pashka | 169 |

10 | Radewoosh | 167 |

Finding fraction which has the smallest denumerator

Revision en2, by Logarithmic, 2017-02-04 19:51:28

Given a range (l, r) where 0.0 <= l,r <= 1.0 we want to find a fraction x/y which satisfies following condition: l <= x/y < r and y should be as small as possible. l and r might have at most 9 digits after floating point.

Revisions

Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|

en3 | Logarithmic | 2017-02-05 19:23:48 | 36 | |||

en2 | Logarithmic | 2017-02-04 19:51:28 | 37 | Tiny change: '<= x/y < r. l and r ' -> '<= x/y < r and y should be as small as possible. l and r ' | ||

en1 | Logarithmic | 2017-02-04 19:08:41 | 236 | Initial revision (published) |

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Nov/28/2020 01:38:31 (h2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|