Skip to content

Instantly share code, notes, and snippets.

@kakysha
Created March 28, 2022 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kakysha/510cdce377e67f496e4c448d57ea909e to your computer and use it in GitHub Desktop.
Save kakysha/510cdce377e67f496e4c448d57ea909e to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
int a = 2000000000;
int cc =1;
for (int i = sqrt(a); i > 0; i --){
while (true){
unsigned long long r = i*i*cc;
cout << r << endl;
if (r == a) {cout << i*i; return 0;}
if (r > a) {r=0; break;}
cc++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment