Language: C++

include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

//約数列挙O(root n)
PLL div(ll n){
  vector<PLL> v;
  for(ll i=sqrt(n); i>=1; --i){
    if(n%i == 0) return PLL(i,n/i);
  }
  return PLL(0,0);
}


int main(void){
  SPEEDUP
  cout << setprecision(15);
  ll S;cin >> S;
  cout << 0 SP 0 SPF;
  ll x1,y1,x2,y2;

  // for(ll X = S; X<=1e18; ++X){
  //   x1 = y2 = 0;
  //   ll Y = X-S;
  //   if(Y<0)continue;
  //   vector<PLL> vX = divisor(X);
  //   vector<PLL> vY = divisor(Y);
  //   for(auto &a : vX) if(a.first <= 1e9 && a.second <= 1e9){
  //     x1 = a.first;
  //     y2 = a.second;
  //   }
  //   if(x1 == 0) continue;
  //   for(auto &a :vY) if(a.first <= 1e9 && a.second <= 1e9){
  //     cout << x1 SP a.first SPF;
  //     cout << a.second SP y2 << endl;
  //     return 0;
  //   }
  // }


  //for(ll sX = sqrt(S); sX<=1e9; ++sX){
  //  ll X = (sX)*(sX);
  //  ll Y = X-S;
  //  if(Y<0)break;
  //  vector<PLL> d = divisor(Y);
  //  for(auto &a : d) if(a.first <= 1e9 && a.second <= 1e9){
  //    cout << sX SP a.first SPF;
  //    cout << a.second SP sX << endl;
  //    return 0;
  //  }
  //}

  for(ll sX = sqrt(S); sX<=1e9; ++sX){
    rep(n,1e9){
      ll X = sX*(sX+n);
      ll Y = X-S;
      if(Y<0)continue;
      if(sX+n > 1e9) break;
      PLL py = div(Y);
      if(py.first == 0) continue;
      if(py.first > 1e9 || py.second > 1e9)continue;
      cout << sX SP py.first SPF;
      cout << py.second SP sX+n<< endl;
      return 0;
    }
  }
  //S以上でx1*y2(x1<=1e9, y2<=1e9となる最小の組を見つける
  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:18:11: error: 'pair' does not name a type
   18 |   typedef pair<int,int> PII;
      |           ^~~~
a.cc:19:11: error: 'pair' does not name a type
   19 |   typedef pair<char,char> PCC;
      |           ^~~~
a.cc:20:11: error: 'pair' does not name a type
   20 |   typedef pair<ll,ll> PLL;
      |           ^~~~
a.cc:21:11: error: 'pair' does not name a type
   21 |   typedef pair<char,int> PCI;
      |           ^~~~
a.cc:22:11: error: 'pair' does not name a type
   22 |   typedef pair<int,char> PIC;
      |           ^~~~
a.cc:23:11: error: 'pair' does not name a type
   23 |   typedef pair<ll,int> PLI;
      |           ^~~~
a.cc:24:11: error: 'pair' does not name a type
   24 |   typedef pair<int,ll> PIL;
      |           ^~~~
a.cc:25:11: error: 'pair' does not name a type
   25 |   typedef pair<ll,char> PLC;
      |           ^~~~
a.cc:26:11: error: 'pair' does not name a type
   26 |   typedef pair<char,ll> PCL;
      |           ^~~~
a.cc: In function 'void YesNo(bool)':
a.cc:28:28: error: 'cout' was not declared in this scope
   28 | inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
      |                            ^~~~
a.cc:28:56: error: 'endl' was not declared in this scope
   28 | inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
      |                                                        ^~~~
a.cc: In function 'void YESNO(bool)':
a.cc:29:28: error: 'cout' was not declared in this scope
   29 | inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
      |                            ^~~~
a.cc:29:56: error: 'endl' was not declared in this scope
   29 | inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
      |                                                        ^~~~
a.cc: In function 'void Yay(bool)':
a.cc:30:26: error: 'cout' was not declared in this scope
   30 | inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}
      |                          ^~~~
a.cc:30:55: error: 'endl' was not declared in this scope
   30 | inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}
      |                                                       ^~~~
a.cc: At global scope:
a.cc:33:1: error: 'PLL' does not name a type
   33 | PLL div(ll n){
      | ^~~
a.cc: In function 'int main()':
a.cc:10:17: error: 'cin' was not declared in this scope
   10 | #define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
      |                 ^~~
a.cc:43:3: note: in expansion of macro 'SPEEDUP'
   43 |   SPEEDUP
      |   ^~~~~~~
a.cc:10:28: error: 'ios' has not been declared
   10 | #define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
      |                            ^~~
a.cc:43:3: note: in expansion of macro 'SPEEDUP'
   43 |   SPEEDUP
      |   ^~~~~~~
a.cc:44:3: error: 'cout' was not declared in this scope
   44 |   cout << setprecision(15);
      |   ^~~~
a.cc:44:11: error: 'setprecision' was not declared in this scope
   44 |   cout << setprecision(15);
      |           ^~~~~~~~~~~~
a.cc:80:15: error: 'sqrt' was not declared in this scope
   80 |   for(ll sX = sqrt(S); sX<=1e9; ++sX){
      |               ^~~~
a.cc:86:7: error: 'PLL' was not declared in this scope
   86 |       PLL py = div(Y);
      |       ^~~
a.cc:87:10: error: 'py' was not declared in this scope
   87 |       if(py.first == 0) continue;
      |          ^~
a.cc:88:10: error: 'py' was not declared in this scope
   88 |       if(py.first > 1e9 || py.second > 1e9)continue;
      |          ^~
a.cc:89:21: error: 'py' was not declared in this scope
   89 |       cout << sX SP py.first SPF;
      |                     ^~
a.cc:90:35: error: 'endl' was not declared in this scope
   90 |       cout << py.second SP sX+n<< endl;
      |                                   ^~~~