Perfect Cubes in a Range
Submissions: 2612   Accuracy:

24.86%

  Difficulty: Basic   Marks: 1

Given two given numbers a and b where 1<=a<=b, find the perfect cubes between a and b (a and b inclusive).

Input:
First line of input contains number of test cases T. Each line of test case contain numbers 'a' and 'b' separated by a single space.

Output:
Perfect cubes between a & b  are displayed. If there are no perfect cubes between a & b then print "No".

Constraints:
1 <=T<= 50
1 <= a <= b <= 10000

Example:
Input:

2
1 100
24 576

Output:
1 8 27 64
27 64 125 216 343 512

** For More Input/Output Examples Use 'Expected Output' option **

Author: atharv


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.