orrect answer will be upvoted else downvoted. Computer science. Vasya concentrates on the properties of right triangles, and he utilizes a recipe that decides whether some triple of integers is Pythagorean. Lamentably, he has failed to remember the specific recipe; he recalls just that the recipe was some condition with squares. Along these lines, he concocted the accompanying equation: c=a2−b. Clearly, this isn't the right recipe to check if a triple of numbers is Pythagorean. Yet, amazingly, it really dealt with the triple (3,4,5): 5=32−4, thus, as indicated by Vasya's equation, it is a Pythagorean triple. When Vasya tracked down the right recipe (and comprehended that his equation is off-base), he pondered: what number of are there triples of integers (a,b,c) with 1≤a≤b≤c≤n to such an extent that they are Pythagorean both as per his equation and the genuine definition? He requested that you count these triples. Input The principal line contains one integer t (1≤t≤104) — the number of experiments. Each experiment comprises of one line containing one integer n (1≤n≤109). Output For each experiment, print one integer — the number of triples of integers (a,b,c) with 1≤a≤b≤c≤n to such an extent that they are Pythagorean agreeing both to the genuine definition and to the recipe Va
Correct answer will be upvoted else downvoted. Computer science.
Vasya concentrates on the properties of right triangles, and he utilizes a recipe that decides whether some triple of integers is Pythagorean. Lamentably, he has failed to remember the specific recipe; he recalls just that the recipe was some condition with squares. Along these lines, he concocted the accompanying equation: c=a2−b.
Clearly, this isn't the right recipe to check if a triple of numbers is Pythagorean. Yet, amazingly, it really dealt with the triple (3,4,5): 5=32−4, thus, as indicated by Vasya's equation, it is a Pythagorean triple.
When Vasya tracked down the right recipe (and comprehended that his equation is off-base), he pondered: what number of are there triples of integers (a,b,c) with 1≤a≤b≤c≤n to such an extent that they are Pythagorean both as per his equation and the genuine definition? He requested that you count these triples.
Input
The principal line contains one integer t (1≤t≤104) — the number of experiments.
Each experiment comprises of one line containing one integer n (1≤n≤109).
Output
For each experiment, print one integer — the number of triples of integers (a,b,c) with 1≤a≤b≤c≤n to such an extent that they are Pythagorean agreeing both to the genuine definition and to the recipe Vasya thought of.
Step by step
Solved in 3 steps with 4 images