22516_RideMyBicycle

2022-5-16 18:22| 发布者: Hocassian| 查看: 25| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506515462300-Problem List-采集的数据-后羿采集器.html

Pro.ID

22516

Title

Ride My Bicycle

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22516

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 800/400 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Alan Chester Mason, worried about the overuse of fossil fuels and his own expanding waist, has decided to purchase a bicycle. The model he has decided on has 3 chain rings on the crank (the gears attached to the pedal mechanism) and 7 gears on the back wheel. There is a chain connecting one front chain ring to one back gear. This selection can be changed (via the derailleurs) to any combination of front chain ring and back gear desired. The ease of pedalling is determined by the ratio of teeth in the chosen chain ring and the chosen back ring. The smaller the ratio, the easier it is to pedal. Alan has many options for the number of teeth in each chain ring and each back gear and wishes to see what the gearing (that is, ratios) would be for various combinations. You are to write a program to help him out.

    输入

    Input for this program will be the description of one configuration of chain rings and back gears. Input will be speci ed on two lines. The first line will have three positive integers, separated by single spaces, in strictly increasing order giving the number of teeth on each chain ring. The second line will contain 7 positive integers, separated by spaces, in strictly increasing order giving the number of teeth on each back gear. We will refer to the chain rings as chain rings 1, 2 and 3 from smallest to largest. We refer to the back gears in a similar manner.

    输出

    Description

    Alan Chester Mason, worried about the overuse of fossil fuels and his own expanding waist, has decided to purchase a bicycle. The model he has decided on has 3 chain rings on the crank (the gears attached to the pedal mechanism) and 7 gears on the back wheel. There is a chain connecting one front chain ring to one back gear. This selection can be changed (via the derailleurs) to any combination of front chain ring and back gear desired. The ease of pedalling is determined by the ratio of teeth in the chosen chain ring and the chosen back ring. The smaller the ratio, the easier it is to pedal. Alan has many options for the number of teeth in each chain ring and each back gear and wishes to see what the gearing (that is, ratios) would be for various combinations. You are to write a program to help him out.

    Input

    Input for this program will be the description of one configuration of chain rings and back gears. Input will be speci ed on two lines. The first line will have three positive integers, separated by single spaces, in strictly increasing order giving the number of teeth on each chain ring. The second line will contain 7 positive integers, separated by spaces, in strictly increasing order giving the number of teeth on each back gear. We will refer to the chain rings as chain rings 1, 2 and 3 from smallest to largest. We refer to the back gears in a similar manner.

    Output

    You should generate 21 lines of output for this program. Each line should give information about one particular combination of chain ring and back ring and should be of the form

    x.xx f b

    where f is the number of the chain ring, b is the number of the back ring and x.xx is the ratio of (teeth in f)/(teeth in b) given to 2 decimal places. These numbers are separated by a single space. These lines are to be printed from smallest ratio to largest. If two (or more) ratios are equal, print the one with the smallest chain ring first. You may assume that the number of teeth are such that the ratios will all be less than 10.

    Sample Input

    32 42 52
    12 15 17 18 21 24 28

    Sample Output

    1.14 1 7
    1.33 1 6
    1.50 2 7
    1.52 1 5
    1.75 2 6
    1.78 1 4
    1.86 3 7
    1.88 1 3
    2.00 2 5
    2.13 1 2
    2.17 3 6
    2.33 2 4
    2.47 2 3
    2.48 3 5
    2.67 1 1
    2.80 2 2
    2.89 3 4
    3.06 3 3
    3.47 3 2
    3.50 2 1
    4.33 3 1

    Source

    样例输入

    32 42 52
    12 15 17 18 21 24 28

    样例输出

    1.14 1 7
    1.33 1 6
    1.50 2 7
    1.52 1 5
    1.75 2 6
    1.78 1 4
    1.86 3 7
    1.88 1 3
    2.00 2 5
    2.13 1 2
    2.17 3 6
    2.33 2 4
    2.47 2 3
    2.48 3 5
    2.67 1 1
    2.80 2 2
    2.89 3 4
    3.06 3 3
    3.47 3 2
    3.50 2 1
    4.33 3 1

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部