aboutsummaryrefslogtreecommitdiff
path: root/codechef/collegLife2/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/collegLife2/main.cpp')
-rw-r--r--codechef/collegLife2/main.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/codechef/collegLife2/main.cpp b/codechef/collegLife2/main.cpp
index 0e72523..231767f 100644
--- a/codechef/collegLife2/main.cpp
+++ b/codechef/collegLife2/main.cpp
@@ -8,9 +8,26 @@ int main () {
int tt;
cin >> tt;
while(tt--){
- int s;
- vector<int> q(s);
-
-
+ int s, introLength, numberOfEposides, eposideLength;
+ long long ans = 0;
+ cin >> s;
+ vector<int> seasons(s); // array containg the introLength of each season
+ for(auto &x : seasons) {
+ cin >> x;
+ }
+ for(int i = 0 ; i < s; i++) {
+ cin >> numberOfEposides;
+ for(int j = 0; j < numberOfEposides; j++) {
+ int x;
+ cin >> x;
+ if(j == 0) {
+ ans += x;
+ }
+ if(j > 0) {
+ ans += x - seasons[i];
+ }
+ }
+ }
+ cout << ans << endl;
}
}