Pythagorean Triplets
Practice
5 (1 votes)
Mathematics
Medium
Open
Approved
Mathamatics
Problem
67% Success 3318 Attempts 30 Points 3s Time Limit 256MB Memory 1024 KB Max Code

Pythagorean triplet (a,b,c) satisfies:
enter image description here

You will be given an integer N. You have to count how many triplets a,b,c exist such that
1 <= a <= b <= c <= N.

Input:
First line contains T, the number of testcases. Each testcase consists of only one integer in one line.

Output:
For each testcase, print the required answer.

Constraints:
1 <= T <= 100
1 <= N <= 10^6

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
Tags:
CombinatoricsBasic MathC++Math
Points:30
1 votes
Tags:
Medium
Points:30
Tags:
Dynamic ProgrammingProbabilityCombinatoricsAd-HocMediumMathematicsOpenApprovedMathamatics