All Tracks Data Structures Arrays 1-D Problem

Pairs
/
No tags
Problem
Editorial
Analytics

You need to find no. of ways of selecting a pair of prime number \((p)\) and a composite number \((q)\) in a given range \(l \leq p,q \leq r\).

Input : -

First line contains integer \(T\) ,no. of testcases.

Next  \(T\) lines contains two space integers \(l\) and \(r\)

Output : -

Each test case has one output , no. of pairs of prime number and a composite number in new line.

Constraints : -

\(1 \leq T \leq 10^{5}\)

\(1 \leq l \leq r \leq 10^{5}\)

SAMPLE INPUT
3
5 11
4 4
5 10
SAMPLE OUTPUT
12
0
8
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

Initializing Code Editor...
Notifications
View All Notifications

?