[WA] F. Consecutive Subsequence Codeforces Round #479 (Div. 3)

help
aryanc403
codeforces

#1

Can someone help me in removing WA on http://codeforces.com/contest/977/problem/F ??
My solns - http://codeforces.com/contest/977/submission/38066138
http://codeforces.com/contest/977/submission/38018600

And please tell me where I’m wrong.