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:
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
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
Editorial