Given 4 integer numbers, so that the sum of any 2 numbers is a full square | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

Given 4 integer numbers, so that the sum of any 2 numbers is a full square

For instance: a+b=k^2 b+c =n^2 c+d= p^2 d+a =r^2 etc.

5th Mar 2019, 6:45 AM
MDD
6 Answers
5th Mar 2019, 10:50 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
+ 4
Thx a lot
5th Mar 2019, 4:38 PM
MDD
+ 1
Do you want to generate these numbers or they will be input from the user and your program will define if the summaries are perfect squares ?
5th Mar 2019, 10:27 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
0
It should generate this numbers
5th Mar 2019, 10:54 AM
MDD
0
By the way the numbers are not equal
5th Mar 2019, 10:56 AM
MDD
0
Use vectors to get distinct combinations of numbers. and for every combination call AreAllCombinationsSumSquare (in my code above) to define if it is the right combination. For getting the combinations check the below code : https://www.geeksforgeeks.org/make-combinations-size-k/ with k=4 and n=the maximum number
5th Mar 2019, 12:11 PM
Prokopios Poulimenos
Prokopios Poulimenos - avatar