import sequtils,strutils var N,L,x,w,t,p,c,a,b : int hyou : array[101, array[3, int]] (N, L) = stdin.readline.split.map(parseInt) for n in 0..= w: a += w else: a += w + t - (a - b * t) + t p = x + w a += L - p echo a