Tags: programming 

Rating:

# Challenge description

Have you ever heard the term "The sum of two squares"?

It's like the following :
```
4 = 0^2 + 2^2
8 = 2^2 + 2^2
16 = 0^2 + 4^2
----------------------------
5002 = 39^2 + 59^2 => 49^2 + 51^2 => 51^2 + 49^2 => 59^2 + 39^2
And so on. In the example of 16, if we add the square of 0 & 4 we get 16. So here we are getting two values 0 & 4. So that's the answer.

So write a program & find out the two values of 25000. Conditions are the following :

* Remove the duplicates
* Pick the third one
```
Flag Format : KCTF{0,1}

**Author: TareqAhmed**

-----------------------------------------------------------
Solve.py
```python

y=25000

for i in range(0,y//2):
for j in range(0,y//2):
if (i*i + j*j == y) :
print(i,j)

```
Output of solve.py :

![image](https://user-images.githubusercontent.com/58823465/150652307-e3f79e6a-4112-4385-a97e-19057ee6b0c8.png)

``` KCTF{90,130} ```

Original writeup (https://github.com/j3seer/KnightCTF-2022-WriteUps/tree/main/KnightCTF%202022/Programming/Square%20Sum).