Help needed in segment tree questions?

How to solve this hackerearth problem??
Link: https://www.hackerearth.com/practice/data-structures/advanced-data-structures/segment-trees/practice-problems/algorithm/interval-counting-bf6ebe8a/description/

//