Question: Write a program which reads the statistics of n League A football teams and prints the team's name which fall in League B . A

Write a program which reads the statistics of n League A football teams and prints the team's name
which fall in League B. A team falls in League B, if it has less than k points after having played m weeks
where m is between 1 and 150. Each team gets three points for a win, one point for a draw and zero
points when lost.
Input Specification: In the first line, you will be given the number of teams 0< n <=500 and the points 0<
k <=300 needed to stay in league A. Then in the following n lines, there will be the
team name and its results. Semicolon indicates the end of the input series.
Number 2 represents win, number one represents draw and number zero represents loss.
Output Specification: Show the team names and their points which fall to League B. If no team falls to
League B then shows "0 Teams" message.
Sample Input 1: Sample Input 2:
419415
Team_A 11111111101110210 ; Team_00102211202022011 ;
Team_B 01022110110201002 ; Team_00202120010110121 ;
Team_C 00102221111100212 ; Team_00302120102001012 ;
Team_D 01012121000222000 ; Team_00410200112002120 ;
Sample Output 1: Sample Output 2:
Team_A 160 Teams
Team_B 18

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!