Knowee
Questions
Features
Study Tools

In the recent RCB vs CSK match, RCB batted first and scored 𝑋X runs while CSK batted second and scored 𝑌Y runs.It is known that RCB qualifies to the playoffs if they win by at least 1818 runs, otherwise CSK qualify. Knowing the final scores of both teams, find out who qualified to the playoffs.Input FormatThe only line of input contains 22 integers 𝑋X and 𝑌Y - the final scores of RCB and CSK respectively.Output FormatOutput RCB if RCB managed to qualify to the playoffs, otherwise output CSK.You may print each character of the string in uppercase or lowercase (for example, the strings RCB, rCb, rcb, and rcB will all be treated as identical).Constraints150≤𝑋≤250150≤X≤250150≤𝑌≤𝑋+6150≤Y≤X+6Sample 1:InputOutput218 191RCBExplanation:RCB won by 218−191=27218−191=27 runs, which is more than 1818. Thus, RCB qualified.Sample 2:InputOutput218 201CSKExplanation:RCB won by 218−201=17218−201=17 runs, which is less than 1818. Thus, CSK qualified.Sample 3:InputOutput218 200RCBExplanation:RCB won by 218−200=18218−200=18 runs, which is equal to 1818. Thus, RCB qualified.

Question

In the recent RCB vs CSK match, RCB batted first and scored 𝑋X runs while CSK batted second and scored 𝑌Y runs.It is known that RCB qualifies to the playoffs if they win by at least 1818 runs, otherwise CSK qualify. Knowing the final scores of both teams, find out who qualified to the playoffs.Input FormatThe only line of input contains 22 integers 𝑋X and 𝑌Y - the final scores of RCB and CSK respectively.Output FormatOutput RCB if RCB managed to qualify to the playoffs, otherwise output CSK.You may print each character of the string in uppercase or lowercase (for example, the strings RCB, rCb, rcb, and rcB will all be treated as identical).Constraints150≤𝑋≤250150≤X≤250150≤𝑌≤𝑋+6150≤Y≤X+6Sample 1:InputOutput218 191RCBExplanation:RCB won by 218−191=27218−191=27 runs, which is more than 1818. Thus, RCB qualified.Sample 2:InputOutput218 201CSKExplanation:RCB won by 218−201=17218−201=17 runs, which is less than 1818. Thus, CSK qualified.Sample 3:InputOutput218 200RCBExplanation:RCB won by 218−200=18218−200=18 runs, which is equal to 1818. Thus, RCB qualified.

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Para resolver este problema, sigamos los siguientes pasos:

  1. Leer los valores de entrada 𝑋 y 𝑌.
  2. Calcular la diferencia de puntuación entre RCB y CSK, es decir, 𝑋 - 𝑌.
  3. Comparar la diferencia de puntuación con 18.
  4. Si la diferencia es mayor o igual a 18, RCB califica para los playoffs.
  5. Si la diferencia es menor a 18, CSK califica para los playoffs.
  6. Imprimir el equipo que califica.

Aquí está la solución paso a paso:

  1. Leer los valores de entrada:

    X, Y = map(int, input().split())
    
  2. Calcular la diferencia de puntuación:

    diferencia = X - Y
    
  3. Comparar la diferencia de puntuación con 18 y determinar el equipo que califica:

    if diferencia >= 18:
        print("RCB")
    else:
        print("CSK")
    

Ejemplo de implementación completa:

# Leer los valores de entrada
X, Y = map(int, input().split())

# Calcular la diferencia de puntuación
diferencia = X - Y

# Determinar el equipo que califica
if diferencia >= 18:
    print("RCB")
else:
    print("CSK")

Con esto, podemos determinar qué equipo califica para los playoffs basado en las puntuaciones finales de RCB y CSK.

This problem has been solved

Similar Questions

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.

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.

Max Score: 20Given a string S and a character C, check whether the character C is occurring together in the string S.Input FormatThe first and only line of input contains a string S and character, C separated by space.Output FormatPrint "Yes" if the character C is occurring together, otherwise print "No".Constraints1 <= |S| <= 103ExampleInputsnooze oOutputYes

Input format :The first line contains an integer 't' representing the number of test cases.Each test case consists of a single line with two space-separated integers 'x' and 'y', representing the scores of Sasha and Brenda, respectively, for a particular round.Output format :For each test case, the output prints the result of that round.If x is greater than y, the output prints "Sasha".If x is equal to y, the output prints "Tie".Otherwise, the output prints "Brenda"

In a football match, a penalty shootout is used to determine the winner if the score is tied after regulation and extra time. Each team takes turns attempting five penalty kicks.Team A has scored 𝑋X goals in 33 turns while team B has scored 𝑌Y goals in 44 turns.Determine if it's possible for the penalty shootout to end with equal score after both teams have taken all 55 of their penalty kicks.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 number of goals scored by team A in 33 turns and team B in 44 turns respectively.Output FormatFor each test case, output on a new line YES if match can still end in draw, otherwise output NO.You may print each character of the output in either uppercase or lowercase (for example, the strings YES, yEs, yes, and yeS will all be treated as identical).Constraints1≤𝑇≤10001≤T≤10000≤𝑋≤30≤X≤30≤𝑌≤40≤Y≤4Sample 1:InputOutput31 23 01 1YESNOYESExplanation:Test case 11: Team A can score 11 and 00 goals in their 4𝑡ℎ4 th and 5𝑡ℎ5 th turn respectively and team B can score 00 goals in 5𝑡ℎ5 th turn.This way the final score of penalty for both teams would be 22.Test case 22: Even if team B scores a goal in 5𝑡ℎ5 th turn, their total would be 11, which is less than the score of team A.Test case 33: Team A can score 00 and 11 goal in their 4𝑡ℎ4 th and 5𝑡ℎ5 th turn respectively and team B can score 11 goal in 5𝑡ℎ5 th turn.

1/1

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.