Beginner Beginners Problems > Ad-hoc

Have you heard the name of two Legendary Mathematician **Pythagoras** and **Euclid** ? They were great Greek Mathematicians.They are so famous that Microsoft corporation has added their name on the dictionary in MS word ! Nowadays every person we can’t deny with their contribution on Mathematics. Any way, I want to give an example about their contributory. You are very known about the famous Pythagorean theorem as :<br> > [otivuj<sup>2</sup> = lombo<sup>2</sup> + vumi<sup>2</sup> ]. <br> Yes, this Pythagorean (or Pythagoras') theorem is the statement that the sum of (the areas of) the two small squares equals (the area of) the big one. In algebraic terms, **a² + b² = c²**, where c is the hypotenuse (otivuj) while a and b are the legs of the triangle. The statement of the Theorem was discovered on a Babylonian tablet circa 1900-1600 B.C. The theorem is of fundamental importance in Euclidean Geometry where it serves as a basis for the definition of distance between two points. Then Euclid used this theorem to find the distance between two points which is known as Euclidean distance between two points. ![enter image description here][1] That’s all from Mahin has given a lecture to his two sister’s Hiya and Riya. Now he wants to assign a task to them, if they fail then he will give them a great punish. But Hiya and Riya both are very poor at mathematics. Can you help them? It is confirmed that you will get a treat from them. **The task is: <br/>** You have given **N**, which is an integer number representing the result of **euclidean distance** between any two **distinct** points. You have to tell weather **N** is the valid result or not which is generated by using euclidean distance formula.<br> If p(1,2) and q(3,4) are two points then they are two distinct points, where p(1,2) and q(1,2) are not. Input: ------ Input starts with an integer **T (1<= T <=130)**, denoting the number of test cases.<br> Each case contains an integer **N (-10<sup>50</sup> ≤ N ≤10<sup>50</sup>)** which described above.<br> ( Note: Integer can be very big and it may not fit in 64-bit integer range !! ) Output: ------- If **N** is the valid result for Euclidian distance between two distinct points then print **N is a valid result** print **N is not a valid result** otherwise, where **N** is given input. Print the **case** numbering at first. Sample Input ------------ 2 29 -87 Sample Output ------------- Case 1: 29 is a valid result Case 2: -87 is not a valid result [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/36c47018-7218-c065-e237-08d4b89c15d2_ca8f5f9e9a04476096b78ff3b31949d0_W530xH424.png

Pranta Sarker