Yet Another Counting Problem

medium
<a href="https://codeforces.com/problemset/problem/1342/C" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Yet Another Counting Problem</i></a>

Input Format

check the link

Output Format

check the link

Constraints

check the link

Example

Input
2
4 6 5
1 1
1 3
1 5
1 7
1 9
7 10 2
7 8
100 200
Output
0 0 0 2 4 
0 91 
Previous
Circle Of Monsters
Next
Social Circles

Related Questions