#include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) typedef long long ll; using namespace std; ll calc(ll d) { return (ll)((-1 + sqrt(1 + 4*d)) / 2.0); } ll sq(ll x) { return x * x; } bool check(ll t, ll d) { return sq(t)+t <= d and sq(t+1)+(t+1) > d; } int main() { const int n = 1e5; ll t = 999999999; for (int i = 0; i < n;) { repeat (dd,100) { ll d = sq(t)+t-dd; if (check(calc(d), d)) continue; cout << d << endl; if (++ i >= n) break; } -- t; } return 0; }