21728_EXERCISE

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

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

Pro.ID

21728

Title

EXERCISE

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Our local gym has a number of exercise machines, each of which has a number of "levels". Some levels are harder than others, and exercising at those levels uses more energy per minute than at the easier levels. In this problem you have to work out how much energy a person would use up during an exercise session.

    输入

    Input will consists of a number of scenarios, each representing a machine and a number of people using the machine for exercise. Each scenario will begin with an integer, n, the number of levels available on the machine (0 < n < 10). The next n lines define the energy expended per minute at one level of the machine. The first line represents level 1, the second level 2 and so on.

    There then follows data about a number of people who are exercising on the machine described. The first line of data gives the name of the person who is exercising (a single series of between 2 and 10 letters, lower case except for the first) followed by a space, followed by e, the number of exercises the person carried out (0 < e ≤ 50).

    The next e lines contain the exercises carried out by the person. These consist of an integer giving the level, followed by a space, followed by d, the duration of the exercise in minutes.

    The list of people is terminated by a line containing # 0. This line should not be processed.

    Input is terminated by a scenario where n is 0 ? this scenario should not be processed.

    输出

    Description

    Our local gym has a number of exercise machines, each of which has a number of "levels". Some levels are harder than others, and exercising at those levels uses more energy per minute than at the easier levels. In this problem you have to work out how much energy a person would use up during an exercise session.

    Input

    Input will consists of a number of scenarios, each representing a machine and a number of people using the machine for exercise. Each scenario will begin with an integer, n, the number of levels available on the machine (0 < n < 10). The next n lines define the energy expended per minute at one level of the machine. The first line represents level 1, the second level 2 and so on.

    There then follows data about a number of people who are exercising on the machine described. The first line of data gives the name of the person who is exercising (a single series of between 2 and 10 letters, lower case except for the first) followed by a space, followed by e, the number of exercises the person carried out (0 < e ≤ 50).

    The next e lines contain the exercises carried out by the person. These consist of an integer giving the level, followed by a space, followed by d, the duration of the exercise in minutes.

    The list of people is terminated by a line containing # 0. This line should not be processed.

    Input is terminated by a scenario where n is 0 ? this scenario should not be processed.

    Output

    Output is in sections, one section for each machine. Machines must be numbered, starting at 1. For each machine, one line is output for each person using the machine. This output is the name of the person, followed by a space, followed by the total amount of energy they expended carrying out their set of exercises. The people should be output in the order they appear in the input.

    Sample Input

    3
    10
    20
    30
    Bill 3
    1 5
    2 20
    1 5
    Jason 2
    1 10
    3 30
    # 0
    2
    50
    25
    Susan 4
    1 5
    2 20
    1 5
    2 15
    Li 2
    2 20
    1 60
    # 0
    0

    Sample Output

    Machine 1
    Bill 500
    Jason 1000
    Machine 2
    Susan 1375
    Li 3500

    Source

    样例输入

    3
    10
    20
    30
    Bill 3
    1 5
    2 20
    1 5
    Jason 2
    1 10
    3 30
    # 0
    2
    50
    25
    Susan 4
    1 5
    2 20
    1 5
    2 15
    Li 2
    2 20
    1 60
    # 0
    0

    样例输出

    Machine 1
    Bill 500
    Jason 1000
    Machine 2
    Susan 1375
    Li 3500

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部