Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer , it's urgent Chef has just started watching Game of Thrones, and he wants to first calculate the exact time (in minutes) that
Please answer , it's urgent
Chef has just started watching Game of Thrones, and he wants to first calculate the exact time (in minutes) that it'll take him to complete the series The series has S seasons, and the ith season has E, episodes, each of which are Li 1, L1,2,..., Li,e, minutes long. Note that these Lis include the duration of the beginning intro song in each episode. The streaming service that he uses, allows Chef to skip the intro song. The intro song changes slightly each season. and so he wants to watch the intro song in the first episode of each season, but he'll skip it in all other episodes of that season (yes, we know, a sacrilege!). You know that the intro song lasts for Q2 minutes in the ith season Find the total time in minutes, that he has to watch Input: First line will contain a single integer, T, denoting the number of testcases. Then the testcases follow. The first line of each testcase will contain a single integer S, denoting the total number of seasons. The second line contains S space separated integers, Q1, Q2, ...,Qs. where Q, denotes the duration of the intro song in the ith season. The ith of the next S lines contains E; + 1 space separated integers, where the first integer is Ej, denoting the number of episodes in the ith season. That is followed by the duration of each of the E, episodes, L1,L1,2,..., LE Output: For each testcase, output the answer in a single line. Constraints 1STStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started