Distinct Parity Excess

아직 제출이 없습니다시간 제한3초메모리 제한1024 MB

문제

A property of any positive integer is its prime parity, which is derived from the count of its distinct prime factors. If this count is even, the prime parity is even; if the count is odd, the prime parity is odd.

You are given a sequence of ranges to test. Each range is given as two numbers aa and bb, defining the range from aa to bb inclusive. You want to compute the excess of even parity integers over odd parity integers over this range. If there are more odd parity integers, the computed difference will be negative.

입력

The first line of the input contains a single integer nn (1n100)(1\le n\le 100), which is the number of ranges to test.

Each of the next nn lines contains two integers aa and bb (2ab1072\le a\le b\le 10^7), which is a range to test.

출력

Output nn lines, one for each range in the input. For each range, output a single integer giving the excess of even parity integers over odd parity integers.