CSPC '15 #6 - Attendance

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Many Crescent students are building a robot for the new robotics game. During this time the robotics lab is quite busy. However, this poses a problem for the robotics mentors, Mr. Morrison, Mr. Lim, and Mr. Stehlik. They want to know who is in the lab actually working on Tech Design, Computer Science, or Robotics.

Each of the five divisions (Electrical, Design, Programming, Business, and Strategy) have different time commitments. Help the robotics mentors decide who to cut.

Write a program that calculates the average amount of time students in each division actually spent on robotics and then tell the teachers/robotics mentors which students to cut (The students who work below average).

Input Specification

Line 1: The number of users, N (0 \le N \le 99).

Next N lines: NAME DIVISION Double(% of time spent on Tech Design) Double(% of time spent on Computer Sciences) Double(% of time spent on robotics) Int(integer specifying the total number of hours spent).

Since the robotics mentors have to decide who to cut, we only care about how much time, in hours, they spent on robotics.

Floating points will be specified to one decimal place. No student spends more than 1000 hours in the lab.

Output Specification

  • These Team Members Should Be Cut:
  • Design:
  • NAME
  • Electrical:
  • NAME
  • Programming:
  • NAME
  • Business:
  • NAME
  • Strategy:
  • NAME

Print a blank line after each of the divisions, including the last division.
Note that the order of appearance of students cut in each category must be the same as the input. Print each name on its own line.

Sample Input

4
Bob Business 20.0 30.0 50.0 20
Sam Business 0.0 0.0 0.0 0
Nick Business 20.0 30.0 50.0 20
John Design 20.0 30.0 50.0 20

Sample Output

These Team Members Should Be Cut:
Design:

Electrical:

Programming:

Business:
Sam

Strategy:

Explanation

Bob (Business) spent 10.0 hours on Robotics.
Sam (Business) spent 0.0 hours on Robotics.
Nick (Business) spent 10.0 hours on Robotics.
John (Design) spent 10.0 hours on Robotics.

The average time spent in Business was (10.0+0+10.0)/3 = 6.6666667.
The average time spent in Design was (10.0)/1 = 10.0.
The only person to be below average for any of the categories is Sam, since he worked for 0 hours in Business but the average for that category is 6.6666667.
Therefore, we decide to cut Sam from Business.


Comments

There are no comments at the moment.