The ICC World Test Championship is a league competition for Test cricket run by the International Cricket Council (ICC), which started on 1 August 2019. The result of a test match could be win, lose, draw or tie. According to the ICC Test Championship, each of the nine top-ranked sides will play six series over two years. Totally 27 Test series will be played.Each series can have number of matches from 2 to 5. Each country can choose the number of matches that they will play in each series. Irrespective of the number of matches in the series, total points of each series is 120 and the 120 points is equally divided between the matches in the series.Hence, in a two-match series the winner of a match will get 60 points; while in a four-match series, the winner of a match will get 30 points. In case of a match being tie, half of the total points available for the match will be offered to either side, while for a match that ends up in draw, one-third of the available points of the match will be given to both sides.Given the number of points scored by both the teams till now, calculate the total number of points of the teams in a scenario, given name of a team which wins the next two matches and the last match of the series ends up in a draw. Check the validity of the team name and print ‘Invalid input’ if the country name is not valid.ExampleCurrently India vs Australia are playing a four match test series in Australia, and after the loss of Adelaide test India has got 360 points and Australia has got 326 points.When Australia has won the next two matches the total number of points scored by the teams will be:India = 360+10 = 370Australia = 326+30+30+10=396Input formatFirst line will have current points of IndiaNext line will have current points of AustraliaNext line contains the name of the team that has won the next two matches (‘IND for India and ‘AUS’ for Australia)Output FormatFirst line will have final points of IndiaSecond line will have final points of Australia
Question
The ICC World Test Championship is a league competition for Test cricket run by the International Cricket Council (ICC), which started on 1 August 2019. The result of a test match could be win, lose, draw or tie. According to the ICC Test Championship, each of the nine top-ranked sides will play six series over two years. Totally 27 Test series will be played.Each series can have number of matches from 2 to 5. Each country can choose the number of matches that they will play in each series. Irrespective of the number of matches in the series, total points of each series is 120 and the 120 points is equally divided between the matches in the series.Hence, in a two-match series the winner of a match will get 60 points; while in a four-match series, the winner of a match will get 30 points. In case of a match being tie, half of the total points available for the match will be offered to either side, while for a match that ends up in draw, one-third of the available points of the match will be given to both sides.Given the number of points scored by both the teams till now, calculate the total number of points of the teams in a scenario, given name of a team which wins the next two matches and the last match of the series ends up in a draw. Check the validity of the team name and print ‘Invalid input’ if the country name is not valid.ExampleCurrently India vs Australia are playing a four match test series in Australia, and after the loss of Adelaide test India has got 360 points and Australia has got 326 points.When Australia has won the next two matches the total number of points scored by the teams will be:India = 360+10 = 370Australia = 326+30+30+10=396Input formatFirst line will have current points of IndiaNext line will have current points of AustraliaNext line contains the name of the team that has won the next two matches (‘IND for India and ‘AUS’ for Australia)Output FormatFirst line will have final points of IndiaSecond line will have final points of Australia
Solution
To calculate the total number of points for the teams in the given scenario, we need to consider the current points of India and Australia, as well as the team that wins the next two matches and the last match ending in a draw.
Let's assume the current points of India are represented by variable "india_points" and the current points of Australia are represented by variable "australia_points".
We can start by reading the current points of India and Australia from the input.
Next, we need to validate the team name provided for the team that wins the next two matches. If the team name is not 'IND' or 'AUS', we should print 'Invalid input' and stop further calculations.
If the team name is valid, we can proceed with calculating the final points for both teams.
For India, we can add 10 points for winning each of the next two matches. So, the final points for India will be "india_points + 10 + 10".
For Australia, we can add 30 points for winning each of the next two matches and 10 points for the last match ending in a draw. So, the final points for Australia will be "australia_points + 30 + 30 + 10".
Finally, we can print the final points of India and Australia in the specified output format.
Here is the step-by-step solution in code:
- Read the current points of India from input and store it in a variable "india_points".
- Read the current points of Australia from input and store it in a variable "australia_points".
- Read the team name for the team that wins the next two matches from input and store it in a variable "winning_team".
- Check if the team name is valid. If it is not 'IND' or 'AUS', print 'Invalid input' and stop further calculations.
- If the team name is valid, calculate the final points for India: "final_india_points = india_points + 10 + 10".
- Calculate the final points for Australia: "final_australia_points = australia_points + 30 + 30 + 10".
- Print the final points of India: "final_india_points".
- Print the final points of Australia: "final_australia_points".
Please note that the code provided is a general outline of the solution. You would need to implement the actual code in a programming language of your choice to get the desired output.
Similar Questions
Select the correct answerNational cricket league for upcoming England Test series was held in seven different cities of India – Jaipur, Varanasi, Mysuru, Agra, Shimla, Madurai and Visakhapatnam not necessarily in the same order during the first seven months of the year (starting from January and ending in July). The matches were held only in one city during a month.Matches in only four cities were held between the Visakhapatnam match and the Mysuru match. The Visakhapatnam match was not held in June. Only one match was held between Vishakhapatnam match and the Varanasi match. The Jaipur match was held immediately after the Vishakhapatnam match. The Shimla match was held immediately before the Madurai match. The Madurai match was not held in MayHow many matches were held between the Agra match and the Jaipur match?radio_button_uncheckedMore than threeradio_button_uncheckedOne radio_button_uncheckedTwo radio_button_uncheckedThree
The winners of the International Cricket Council(ICC) One Day International(ODI) world cups are as follows: West Indies, West Indies, India, Australia, Pakistan, Sri Lanka, Australia, Australia, Australia, India, Australia, England.1 pointHow many world cups have been played in total?
Cricket World Cup QualifierThe cricket World Cup has started in Chefland. There are many teams participating in the group stage matches. Any team that scores 1212 or more points in the group stage matches qualifies for the next stage.You know the score that a particular team has scored in the group stage matches. Determine if the team has qualified for the next stage or not.Input FormatThe first and only line of input consists of an integer 𝑋X denoting the total points scored by the given team in the group stage matches.Output FormatOutput Yes, if the team has qualified for the next stage, and No otherwise.You may print each character of the string in uppercase or lowercase (for example, the strings YES, yEs, yes, and yeS will all be treated as identical).Constraints1≤𝑋≤201≤X≤20Sample 1:InputOutput3NoExplanation:The team has not scored ≥12≥12 points. Hence it does not qualify.Sample 2:InputOutput17YesExplanation:The team has scored ≥12≥12 points. Hence it does qualify.
When did India play its first Test match?20p5p1931193019321929
There is a cricket match going on between two teams 𝐴A and 𝐵B.Team 𝐵B is batting second and got a target of 𝑋X runs. Currently, team 𝐵B has scored 𝑌Y runs. Determine how many more runs Team 𝐵B should score to win the match.Note: The target score in cricket matches is one more than the number of runs scored by the team that batted first.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of two space-separated integers 𝑋X and 𝑌Y, the target for team 𝐵B and the current score of team 𝐵B respectively.Output FormatFor each test case, output how many more runs team 𝐵B should score to win the match.Constraints1≤𝑇≤101≤T≤1050≤𝑌<𝑋≤20050≤Y<X≤200Sample 1:InputOutput4200 50100 99130 9753 511501332Explanation:Test case 11: The target is 200200 runs and team 𝐵B has already made 5050 runs. Thus, the team needs to make 200−50=150200−50=150 runs more, to win the match.Test case 22: The target is 100100 runs and team 𝐵B has already made 9999 runs. Thus, the team needs to make 100−99=1100−99=1 runs more, to win the match.Test case 33: The target is 130130 runs and team 𝐵B has already made 9797 runs. Thus, the team needs to make 130−97=33130−97=33 runs more, to win the match.Test case 44: The target is 5353 runs and team 𝐵B has already made 5151 runs. Thus, the team needs to make 53−51=253−51=2 runs more, to win the match.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.