Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

Tour de France

📝 Solutions 🔵 仅限 C++
Problems Description
<p> A racing bicycle is driven by a chain connecting two sprockets. Sprockets are grouped into two clusters: the front cluster (typically consisting of 2 or 3 sprockets) and the rear cluster (typically consisting of between 5 and 10 sprockets). At any time the chain connects one of the front sprockets to one of the rear sprockets. The drive ratio -- the ratio of the angular velocity of the pedals to that of the wheels -- is n:m where n is the number of teeth on the rear sprocket and m is the number of teeth on the front sprocket. Two drive ratios d<sub>1</sub>&lt;d<sub>2</sub> are adjacent if there is no other drive ratio d<sub>1</sub>&lt;d<sub>3</sub>&lt;d<sub>2</sub>. The <i>spread</i> between a pair of drive ratios d<sub>1</sub>&lt;d<sub>2</sub> is their quotient: d<sub>2</sub>/d<sub>1</sub>. You are to compute the maximum spread between two adjacent drive ratios achieved by a particular pair of front and rear clusters. </p> <p> Input consists of several test cases, followed by a line containing 0. Each test case is specified by the following input: </p> <ul> <li> f: the number of sprockets in the front cluster; </li> <li> r: the number of sprockets in the rear cluster; </li> <li> f integers, each giving the number of teeth on one of the gears in the front cluster; </li> <li> r integers, each giving the number of teeth on one of the gears in the rear cluster. </li> </ul> <p> You may assume that no cluster has more than 10 sprockets and that no gear has fewer than 10 or more than 100 teeth. </p> <p> For each test case, output the maximum spread rounded to two decimal places. </p>
Input格式
<p> Please Input Input Here </p>
Output格式
<p> Please Input Output Here </p>
Sample
Sample Input 1
2 4 40 50 12 14 16 19 0
Sample Output 1
1.19
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token