Express number as sum of four squares
Description:
Recently you had a quarrel with your math teacher. Not only that nerd demands knowledge of all the theorems, but he turned to be an constructivist devotee! After you recited by heart Lagranges theorem of sum of four squares, he now demands a computer program to obtain such a decomposition, so that to see that you really understand a topic. What a downer!
You remember well the theorem. Any positive integer can be decomposed into a sum of four squares of integers. Seems not too hard... But after a quarrel, your teacher wants blood. Apparently he will test your program on extremely huge numbers... And your program better finished working before the break - you don't want to get F
, do you?
Tip: random tests feature 20 numbers as high as 2^128
and 20 number as high as 2^1024
.
Similar Kata:
Stats:
Created | Aug 21, 2022 |
Published | Aug 21, 2022 |
Warriors Trained | 8525 |
Total Skips | 497 |
Total Code Submissions | 7125 |
Total Times Completed | 108 |
Python Completions | 66 |
JavaScript Completions | 37 |
Java Completions | 14 |
Racket Completions | 3 |
Total Stars | 255 |
% of votes with a positive feedback rating | 100% of 34 |
Total "Very Satisfied" Votes | 34 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 3 |
Average Assessed Rank | 2 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 4 kyu |