#K56397. Calculate Rewards
Calculate Rewards
Calculate Rewards
You are given the durations (in minutes) for three types of workouts: jogging, cycling, and swimming performed over several days. The points awarded for each minute are as follows:
- Jogging: 10 points/minute
- Cycling: 5 points/minute
- Swimming: 15 points/minute
The total points are computed as:
$$\text{total\_points} = 10\times\sum_{i}\text{jogging}_{i} + 5\times\sum_{j}\text{cycling}_{j} + 15\times\sum_{k}\text{swimming}_{k}$$
The number of rewards is then the floor of the total points divided by 100, i.e.,
$$\text{rewards} = \left\lfloor\frac{\text{total\_points}}{100}\right\rfloor$$
Your task is to write a program that reads the workout durations from the standard input and outputs the number of rewards a member can redeem.
inputFormat
The input is provided via standard input (stdin) and consists of four lines:
- The first line contains three non-negative integers
n m p
separated by spaces. Here,n
is the number of jogging records,m
is the number of cycling records, andp
is the number of swimming records. - The second line contains
n
integers representing the jogging durations in minutes. Ifn
is 0, this line will be empty. - The third line contains
m
integers representing the cycling durations in minutes. Ifm
is 0, this line will be empty. - The fourth line contains
p
integers representing the swimming durations in minutes. Ifp
is 0, this line will be empty.
All integers are separated by spaces.
outputFormat
The program should output a single integer to standard output (stdout) representing the number of rewards a member can redeem.
## sample3 2 2
30 45 20
60 30
25 40
23