{"id":"4088301a-1ccc-4ff6-a86d-ad4c9b6247b3","name":"Pythagorean Triplet","description":"1. You are required to check if a given set of numbers is a valid pythagorean triplet.\r\n2. Take as input three numbers a, b and c.\r\n3. Print true if they can form a pythagorean triplet and false otherwise.","inputFormat":"a, an integer\r\nb, an integer\r\nc, an integer","outputFormat":"true if the numbers form a pythagorean triplet and false otherwise","constraints":"1 &lt;= a &lt;= 10^9\r\n1 &lt;= b &lt;= 10^9\r\n1 &lt;= c &lt;= 10^9","sampleCode":{"cpp":{"code":"#include <iostream>\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv){\r\n int a,b,c;\r\n cin >> a >> b >> c;\r\n \r\n //write your code here\r\n \r\n}"},"java":{"code":"import java.util.*;\r\n \r\n public class Main {\r\n \r\n \t public static void main(String[] args) {\r\n \t \t// Write your code here\r\n \t }\r\n }"},"python":{"code":"def main():\r\n # input\r\n arr = input().split(\" \")\r\n a = int(arr[0])\r\n\r\n try:\r\n b = int(arr[1])\r\n c = int(arr[2])\r\n except:\r\n b = int(input())\r\n c = int(input())\r\n \r\n\r\nif __name__ == \"__main__\":\r\n main()"}},"points":10,"difficulty":"easy","sampleInput":"5 3 4","sampleOutput":"true","questionVideo":"https://www.youtube.com/embed/HjfQtaJaWP0","hints":[],"associated":[{"id":"38f9ed52-e450-479e-9f44-da7900dd0a97","name":"What is the time complexity for Pythogorean Triplets?","slug":"what-is-the-time-complexity-for-pythogorean-triplets","type":4},{"id":"5e64dbad-e5dc-4f45-b5cf-063ffca0db4c","name":"What formula is devised to find the Pythogorean Triplets?","slug":"what-formula-is-devised-to-find-the-pythogorean-triplets","type":4},{"id":"9121b78a-cffb-4638-9c1c-66916f491c2b","name":"What will be the output if we give the input as 12, 35, 37?","slug":"what-will-be-the-output-if-we-give-the-input-as-12-35-37","type":4},{"id":"ccf21089-157a-491d-b08d-0109c4d85614","name":"If two numbers out of the three are equal, then what will the output of the code be?","slug":"if-two-numbers-out-of-the-three-are-equal-then-what-will-the-output-of-the-code-be","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"72157774-7fd0-4b8e-88dc-037800acd626","name":"Getting Started","slug":"getting-started-9996","type":0},{"id":"7d29eb24-058d-414c-a9a4-a4df4f1adb17","name":"Pythagorean Triplet","slug":"pythagorean-triplet","type":1}],"next":{"id":"d0a17e65-2f5e-47d6-9c64-c653427b2499","name":"Pythagorean Triplet","type":3,"slug":"pythagorean-triplet"},"prev":{"id":"932b4611-7872-49bb-8975-6b5090f7e0f0","name":"Prime Factorisation Of A Number","type":3,"slug":"prime-factorisation-of-a-number"}}}

Pythagorean Triplet

1. You are required to check if a given set of numbers is a valid pythagorean triplet. 2. Take as input three numbers a, b and c. 3. Print true if they can form a pythagorean triplet and false otherwise.

{"id":"4088301a-1ccc-4ff6-a86d-ad4c9b6247b3","name":"Pythagorean Triplet","description":"1. You are required to check if a given set of numbers is a valid pythagorean triplet.\r\n2. Take as input three numbers a, b and c.\r\n3. Print true if they can form a pythagorean triplet and false otherwise.","inputFormat":"a, an integer\r\nb, an integer\r\nc, an integer","outputFormat":"true if the numbers form a pythagorean triplet and false otherwise","constraints":"1 &lt;= a &lt;= 10^9\r\n1 &lt;= b &lt;= 10^9\r\n1 &lt;= c &lt;= 10^9","sampleCode":{"cpp":{"code":"#include <iostream>\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv){\r\n int a,b,c;\r\n cin >> a >> b >> c;\r\n \r\n //write your code here\r\n \r\n}"},"java":{"code":"import java.util.*;\r\n \r\n public class Main {\r\n \r\n \t public static void main(String[] args) {\r\n \t \t// Write your code here\r\n \t }\r\n }"},"python":{"code":"def main():\r\n # input\r\n arr = input().split(\" \")\r\n a = int(arr[0])\r\n\r\n try:\r\n b = int(arr[1])\r\n c = int(arr[2])\r\n except:\r\n b = int(input())\r\n c = int(input())\r\n \r\n\r\nif __name__ == \"__main__\":\r\n main()"}},"points":10,"difficulty":"easy","sampleInput":"5 3 4","sampleOutput":"true","questionVideo":"https://www.youtube.com/embed/HjfQtaJaWP0","hints":[],"associated":[{"id":"38f9ed52-e450-479e-9f44-da7900dd0a97","name":"What is the time complexity for Pythogorean Triplets?","slug":"what-is-the-time-complexity-for-pythogorean-triplets","type":4},{"id":"5e64dbad-e5dc-4f45-b5cf-063ffca0db4c","name":"What formula is devised to find the Pythogorean Triplets?","slug":"what-formula-is-devised-to-find-the-pythogorean-triplets","type":4},{"id":"9121b78a-cffb-4638-9c1c-66916f491c2b","name":"What will be the output if we give the input as 12, 35, 37?","slug":"what-will-be-the-output-if-we-give-the-input-as-12-35-37","type":4},{"id":"ccf21089-157a-491d-b08d-0109c4d85614","name":"If two numbers out of the three are equal, then what will the output of the code be?","slug":"if-two-numbers-out-of-the-three-are-equal-then-what-will-the-output-of-the-code-be","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"72157774-7fd0-4b8e-88dc-037800acd626","name":"Getting Started","slug":"getting-started-9996","type":0},{"id":"7d29eb24-058d-414c-a9a4-a4df4f1adb17","name":"Pythagorean Triplet","slug":"pythagorean-triplet","type":1}],"next":{"id":"d0a17e65-2f5e-47d6-9c64-c653427b2499","name":"Pythagorean Triplet","type":3,"slug":"pythagorean-triplet"},"prev":{"id":"932b4611-7872-49bb-8975-6b5090f7e0f0","name":"Prime Factorisation Of A Number","type":3,"slug":"prime-factorisation-of-a-number"}}}
plane

Editor


Loading...

Pythagorean Triplet

easy

1. You are required to check if a given set of numbers is a valid pythagorean triplet. 2. Take as input three numbers a, b and c. 3. Print true if they can form a pythagorean triplet and false otherwise.

Constraints

1 <= a <= 10^9 1 <= b <= 10^9 1 <= c <= 10^9

Format

Input

a, an integer b, an integer c, an integer

Output

true if the numbers form a pythagorean triplet and false otherwise

Example

Sample Input

5 3 4

Sample Output

true

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode