Peter and Sanjit are running in a race. They both start from rest.
Peter accelerates uniformly, then moves at a constant speed v for 5 seconds and then decelerates uniformly, coming to rest at the finish line.
Sanjit accelerates uniformly, at the same rate as Peter, to the same speed v and then decelerates immediately, coming to rest at the finish line. He finishes the race x seconds after Peter.
Find the value of x.
I am not too sure how to tackle this problem, I have provided a sketch of a velocity time graph for this information and I thought I could compare the areas under each graph as they should be the same, however I couldn’t find a good way to do this. Here is my sketch:
Any ideas would be appreciated.

Say Peter takes $p$ seconds to run the entire race. Then the race is $$ \frac{p+5s}2\cdot v $$ distance long, according to the area below his graph. At the same time, it is also $$ \frac{p+x}2\cdot v $$ distance long, according to Sanjit's graph. Setting these equal, you can find $x$.