You are given a positive integer x. Check whether the number x is representable as the amount of the solid shapes of two positive integers.    Officially, you really want to check in case there are two integers an and b (1≤a,b) to such an extent that a3+b3=x.    For instance, in the event that x=35, the numbers a=2 and b=3 are reasonable (23+33=8+

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

Correct answer will be upvoted else downvoted. Computer science.

 

 You are given a positive integer x. Check whether the number x is representable as the amount of the solid shapes of two positive integers. 

 

Officially, you really want to check in case there are two integers an and b (1≤a,b) to such an extent that a3+b3=x. 

 

For instance, in the event that x=35, the numbers a=2 and b=3 are reasonable (23+33=8+27=35). In the event that x=4, no pair of numbers an and b is reasonable. 

 

Input 

 

The primary line contains one integer t (1≤t≤100) — the number of experiments. Then, at that point, t experiments follow. 

 

Each experiment contains one integer x (1≤x≤1012). 

 

Kindly note, that the input for some experiments will not squeeze into 32-cycle integer type, so you should use something like 64-bit integer type in your programming language. 

 

Output 

 

For each experiment, output on a different line: 

 

"Indeed" in case x is representable as the amount of the 3D shapes of two positive integers. 

 

"NO" in any case. 

 

You can output "YES" and "NO" regardless (for instance, the strings yEs, indeed, Yes and YES will be perceived as certain).

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Bare Bones Programming Language
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr