Andrey's submission of Intervals and subarrays | CodeChef