Project Euler 142 - Perfect Square Collection

Official link: https://projecteuler.net/problem=142

Thought Process

Near complete brute force.

We deduce the following:

Now I just brute force on possible values of a, b, c with a few observation such as:

Interactive Code

This problem is not suitable for interactive code, instead I provide my code below.