|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||4||0||0||0.000%|
For Gen Y, digital communication is all encompassing. Extreme stress can be induced in many people by removing a teenager’s cell phone.
Ms Hatchett is a teacher who has decided that students will accumulate de-merit points for every cell phone misdemeanor. Confiscation of the miscreant’s cell phone occurs after 100 demerit points have been accumulated.
She communicates the following table to her classes
|Texting while teacher talks||TT||75|
|Texting during exercises||TX||50|
|Argues about phone use||AP||25|
She then records the student’s first name and their points over the course of a week. At the end of the week, she announces the scorers of at least 100 points and confiscates their phone over the weekend. Everyone starts the week with a clean slate – that is, points aren’t accumulated over more than a week.
Your job is to help her find the owners of phones needing to be confiscated.
Input consists of a number of scenarios, each representing one week. The first line of a scenario consists of 2 whole numbers, W and N. (0 < W, N <= 50). W is the week number and N is the number of pupil demerit entries in that week. Input is terminated by a zero value for the week number. Do not process that line.
The first line will be followed by N lines, with each line containing a name (at most 20 characters) and a code as described in the table above. The name and code will be separated by a space.
There may be more than one week’s data.
Output will consist of one line for each week. The line starts with the word “Week” separated by a space from the week number followed by the names of the people whose phone’s are confiscated. Names must appear in the order that they appear in the input list. These should be commas between the names and a space after the week number. If no phones are confiscated in that week, output a message “No phones confiscated”.
1 6 Sophie TX Sophie AP Matt PR Sophie PX Mandy RT Matt PR 2 3 Matt TX Jess TT Lance TX 0 0
Week 1 Sophie,Matt Week 2 No phones confiscated