Computer Science, asked by sreddy3344, 11 months ago

In a remote location, a student is watching a game of ODI cricket on TV. At some point, power goes off; the student is assured about the current run rate of the batting team, which batsman is on strike and individual scores of both the batsmen playing currently but is unsure of exact number of runs the batting team has scored. After some time, power is restored for a moment and at that point in time, a 'Timeline' of runs scored in last 'D' no. of deliveries and current run rate is being shown on TV. Exactly 'D' no. of deliveries were bowled in between the power outage.

Given these details, you need to find out the total number of runs scored by the team and score of batsmen currently playing.

- Wickets falling will be shown as 'W'. Assume batsmen can only be 'bowled' in these 'D' deliveries

- Consequent overs are bowled from opposite ends. (ie. batsmen change sides at the end of an over)

Answers

Answered by harsh78618
7

Answer:

sorry but I don't like cricket

Answered by manojdintakurti
1

Answer:

rr1=float(input())

st,nst=map(int,input().split())

l=input().split()

rr2=float(input())

tt=0

for i in l:

   if i=='W':

       continue  

   else:

       tt+=int(i)

b=int((rr2*len(l)-6*(tt))/(rr1-rr2))

l1=[st,nst]

k=0

for i in range(len(l)):

   j=b+i+1  

   if j%6==0:

       if l[i]=='W':

           l1[k]=0

           if k==0:

               k=1  

           elif k==1:

               k=0

       else:            

           l1[k]+=int(l[i])

           if int(l[i])%2!=0:

               if k==0:

                   k=0  

               else:

                   k=1  

           if int(l[i])%2==0:

               if k==0:

                   k=1  

               else:

                   k=0

   else:

       if l[i]=='W':

           l1[k]=0

           if k==0:

               k=0  

           else:

               k=1  

       else:

           l1[k]+=int(l[i])

           if int(l[i])%2!=0:

               if k==0:

                   k=1

               else:

                   k=0  

total=int((rr1*b)/6)

total+=tt

print(total,l1[1],l1[0])

Explanation:

Similar questions