Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2. N is a natural number and

A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2.

N is a natural number and there's only one Pythagoren triple set which satisfies the condifition a + b + c = N. Given N can you find the values for a, b and c?

Input Format

It contains a natural number, N.

Output Format

Print the answer to stdout.

Sample Input

1000 

Sample Output

200 375 425 

Explanation

For the input N, we have the following numbers which satisfy the condition: 200, 375, 425. 2002 + 3752 = 4252 200 + 375 + 425 = 1000

process.stdin.resume(); process.stdin.setEncoding('ascii');

var input_stdin = ''; var input_stdin_array = ''; var input_currentline = 0;

process.stdin.on('data', function (data) { input_stdin += data; });

process.stdin.on('end', function () { input_stdin_array = input_stdin.split(' '); main(); });

function readLine() { return input_stdin_array[input_currentline++]; }

/////////////// dont modify the lines above ////////////////////

function main() { var n = parseInt(readLine());

// console.log("answer"); }

SOLVE AND ADD THIS TO JAVASCRIPT

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions