It seems that if subtract q[i] every time( i.e, e times) and then finally add it once in the end(thus making it e-1 times), it gives a correct ans. Why?
Thank you.

This is my solution, I have took sum as sum of the total time used for watching one season, which I took as the sum of all time and then I subtracted (noOfEpisodes - 1)*intro[i] which means I subtracted the time skipped and then added it to total time.

Please anyone check and tell me what’s the problem in this solution It is giving TLE

@mimikyu_18 I changed everything from int/long to long long and submitted your code and it worked. submission. You declared the total sum variable as long and the sum variable as int. In c++ int and long have the same max limit.

If you want to use int then take a closer look on the constraints. I personally use long long everywhere thus eliminating the need.

from what i understand, you have defined E of size S, which is incorrect.
the number of episodes will be the first number on every line.
You might want to read the problem description again.

just look at the way the input are given. you might be misguided the way sample input 1 is given, so just check the sample input 2 .Example->Let there are 2 seasons
you have to take input for intro song timing in next line(till this you have done correct). Then in the next line for the 1st season no of episode is given as input and next to it timing of each episodes are given as input(for 1st season only). Now similarly for second season its number of episode is given as input and next to it timing are given for each episodes of 2nd season only. COLGLF2 Problem - CodeChef