NGIRL - Namit In Trouble

Namit's girlfriend's birthday is coming next week. He went to a gift shop and saw N gifts are arranged in a single row in such a way that the position at which the gift is placed is equal to its price. (Position starts from 1.)

Namit's girlfriend being a maths student like those numbers which have exactly 3 divisors, so Namit decide to buy only those gifts which are placed at a position which have only 3 divisors, but Namit's girlfriend likes gifts whose price are above a certain amount K.

Now Namit wants to know total choices he have and how many gifts his girlfriend like for a given value of N.

Input

Input starts with 1 ≤ T ≤ 1000 (number of test cases). Then T lines follows each containing two integer 1 ≤ N < 1010 (number of gifts at gift shop) and 1 ≤ K ≤ 1010.

Output

You program should output two values indicating total number of choices and the number of gifts Namit's girlfriend likes.

Example

Input:
3
10 2
20 7
10 4

Output:
2 2
2 1
2 1

Added by:JUNK
Date:2017-03-06
Time limit:0.100s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Own Problem

hide comments
2020-01-08 18:25:38
Sieve Of Eratosthenes + Binary Search -> AC
2019-11-04 11:48:32
Runs in my pc but gives compilation error here.
2019-06-06 18:27:13
Can someone explain the question by explaining this test case
2018-09-28 13:50:55
AC in one go too :)
2018-06-15 16:40:56
Nice problem AC in one go (time 0.00) thanks.
2018-01-21 14:26:02 rkp
Good problem.

Last edit: 2018-01-21 15:05:53
2017-12-04 05:20:14
AC in One Go (TIme 0.00)
2017-09-11 14:12:52 testing java
Dear author of this problem, Is there any particular reason for so tight time limit? Is there any non optimal solution which requires so strict time limit to make it invalid or is it just pure hate towards java programming language?
2017-08-21 07:38:01
AC after 2 w.a.
just missed one test case!!!
2017-04-04 11:02:07
Simple AC in one go:)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.