Educational Codeforces Round 158 (Rated for Div. 2) | JorbanS
A-LineTripintsolve(){cin>>n>>m;for(inti=1;i>a[i];a[n+1]=2*m-a[n];intres=0;for(inti=1;i>n;for(inti=1;i>a[i];llres=0;intt=1;for(inti=1;it)res+=a[i]-t,t=a[i];elset=min(t,a[i]);}returnres;}C-Add,Divideand