akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
#define fbo find_by_order
#define ook order_of_key

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 122)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 122)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 122)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
bool isect (int l1, int r1, int l2, int r2){
    pii p1,p2;
    p1 = mp(l1,r1); p2 = mp(l2,r2);
    if(p1>p2)swap(p1,p2);
    if(p2.fi <= p1.se)return true;
    else return false;
}
ll quickpow (ll num1, ll num2, ll MOD){
    if(num2==0)return 1;
    else if(num2==1)return num1;
    else{
        ll temp = quickpow (num1,num2/2,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2%2==1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return quickpow (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/__gcd(num1,num2))*num2;}
// end of Template
ll a,b,k;
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    cin>>a>>b>>k;
    ll d = min(a,k);
    a-=d; k-=d;
    d = min(b,k);
    b-=d; k-=d;
    cout<<a<<" "<<b<<newl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define repk(i,m,n) for(ll i=m;i<n;i++)
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define F first
#define S second
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD=1e9+7;
int main()
{
    ll h,n,sum=0,temp;
    cin>>h>>n;
    rep(i,n)
    {
        cin>>temp;
        sum+=temp;
    }
    if(sum>=h) cout<<"Yes";
    else cout<<"No";
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
  Q[tail] = x;
  if(tail == LEN)tail = 1;
  else tail++;
}

P dequeue(){
  P x = Q[head];
  if(head == LEN)head = 1;
  else head++;
  return x;
}


int main(){
  int elaps = 0, c;
  int i,q,a=0;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  
  head = 1;
  tail = n+1;

  while(head != tail){
    u = dequeue();
    u.t -= q;
    if(u.t == 0){
      elaps += q;
    }
    if(u.t < 0){
      a = q+u.t;
      u.t = 0;
      elaps += a;
    }
    if(u.t > 0){
      enqueue(u);
      elaps += q; 
    }
    else {
      printf("%s %d\n",u.name,elaps);
    }
  }
  
  
  return 0;
}



Measured memory_bytes: 11864
#include <bits/stdc++.h>
using namespace std;
map<string,int>mp;
int main(int argc, char const *argv[])
{
	string a,b;
	cin>>a>>b;
	int aa,bb;
	cin>>aa>>bb;
	mp[a]=aa;
	mp[b]=bb;
	string t;
	cin>>t;
	mp[t]--;
	cout<<mp[a]<<" "<<mp[b]<<endl;
	return 0;
}

Measured memory_bytes: 256
from itertools import *
from collections import *
from functools import *

def isqrt(n):
  if n > 0:
    x = 1 << (n.bit_length() + 1 >> 1)
    while True:
      y = (x + n // x) >> 1
      if y >= x:
        return x
      x = y
  elif n == 0:
    return 0
  else:
    raise ValueError

def qrime():
  yield from [2, 3, 5, 7]
  q = [i for i in range(1, 210, 2) if 0 not in (i%3, i%5, i%7)]
  yield from q[1:]
  for i in count(210, 210):
    for j in q:
      yield i + j

def factor(n):
  p = Counter()
  limit = isqrt(n)
  for q in qrime():
    if q > limit:
      break
    while n % q ==0:
      p[q] += 1
      n //= q
    if q in p:
      limit = isqrt(n)
  if n != 1:
    p[n] += 1
  return p

def divisor(n):
  p, m = zip(*factor(n).items())
  for c in product(*map(lambda x:range(x+1), m)):
    yield reduce(int.__mul__, (x**y for x, y in zip(p, c) if y), 1)

N = int(input())
ans = reduce(int.__mul__, (c+1 for c in factor(N-1).values()), 1) - 1

for d in divisor(N):
  if d == 1:
    continue
  n = N
  while n % d == 0:
    n //= d
  if n % d == 1:
    ans += 1

print(ans)


Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long a,b,c,ans=0; cin>>a>>b>>c;
  while(a%2==0 && b%2==0 && c%2==0){
    ans++;
    long long aa,bb,cc;
    aa=b/2+c/2;
    bb=c/2+a/2;
    cc=a/2+b/2;
    a=aa, b=bb, c=cc;
    if(a==b && b==c){
      ans=-1;
      break;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
    #pragma GCC target("avx,avx2,fma")
    #include <bits/stdc++.h>
    using namespace std;
    //---------------------------------//
    void __print(int x) {cerr << x;}
    void __print(long x) {cerr << x;}
    void __print(long long x) {cerr << x;}
    void __print(unsigned x) {cerr << x;}
    void __print(unsigned long x) {cerr << x;}
    void __print(unsigned long long x) {cerr << x;}
    void __print(float x) {cerr << x;}
    void __print(double x) {cerr << x;}
    void __print(long double x) {cerr << x;}
    void __print(char x) {cerr << '\'' << x << '\'';}
    void __print(const char *x) {cerr << '\"' << x << '\"';}
    void __print(const string &x) {cerr << '\"' << x << '\"';}
    void __print(bool x) {cerr << (x ? "true" : "false");}
  
    template<typename T, typename V>
    void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
    template<typename T>
    void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
    void _print() {cerr << "]\n";}
    template <typename T, typename... V>
    void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
    #ifndef ONLINE_JUDGE
    #define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
    #else
    #define deb(x...)
    #endif
   //------------------------------//
  
    typedef long long int ll;
    typedef pair<int,int> pi;
    typedef pair<ll,ll> pll;
    typedef vector<int> vi;
    typedef vector<ll> vll;
    typedef vector<pi> vpi;
    typedef vector<pll> vpll;
  
    #define  ff           first
    #define  ss           second
    #define  pb           push_back
    #define  IOS          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    #define  all(x)       (x).begin(), (x).end()
    #define  ps(x,y)      fixed<<setprecision(y)<<x
    #define  rep(i,a,b)   for(ll i=a ; i<b ; ++i)
  
    const ll MOD = 1e9 + 7;
    const ll INF = 1e18;
    const ll maxn = 1e6 + 4;
  
  
    void solve(){
        int n;
        cin >> n;
        vector<vector<ll>> v(n,vector<ll> (3));
        for(int i=0;i<n;i++){
          for(int j=0;j<3;j++){
            cin >> v[i][j];
          }
        }
        for(int cx=0;cx<=100;cx++){
           for(int cy=0;cy<=100;cy++){
            set<ll> s;
            ll mxh = INF;
             for(int i=0;i<n;i++){
                if(v[i][2]==0){
                  mxh = min(mxh,abs(cx-v[i][0])+abs(cy-v[i][1]));
                }
                else{
                  s.insert(v[i][2]+abs(cx-v[i][0])+abs(cy-v[i][1]));
                }
             }
             if((int)s.size() == 1){
               if(*s.begin() <= mxh){
                  cout << cx << ' ' << cy << ' ' << *s.begin();
                  return;
               }
             }
           }
        }
    }
  
    int main(){
      IOS
      	solve();
      //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
    }
  
  // integer overflow

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;

int main() {
  string x, y;
  cin >> x >> y;

  if (x < y) {
    cout << "<" << endl;
  } else if (x == y) {
    cout << "=" << endl;

  } else {
    cout << ">" << endl;
  }
}

Measured memory_bytes: 256
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ a, b, c ] <- readInts
	putStrLn $ which "Yes" "No" $ a + b >= c


Measured memory_bytes: 508
n = int(input())
points = [0]*2

for i in range(n):
    taro, hanako = input().split()
    if taro > hanako:
        points[0] += 3        
    if taro == hanako:
        points[0] += 1
        points[1] += 1
    if taro < hanako:
        points[1] += 3

l = list(map(str, points))
print(" ".join(l))


Measured memory_bytes: 5600
w, h, x, y, r = gets.split(' ').map(&:to_i)
def over(w, x, r)
  x - r < 0 || x - r > w || x + r < 0 || x + r > w
end
puts over(w, x, r) || over(h, y , r) ? 'No' : 'Yes'


Measured memory_bytes: 8872
#include <stdio.h>

int ball_in(int ball[], int n)
{
	static int a[10], b[10];
	static int a_final, b_final;
	
	if (n == 0){
		int i;
		for (i = 0; i < 10; i++) a[i] = b[i] = 0;
		a_final = b_final = 0;
	}
	if (n == 9){
		if (a[a_final - 1] < ball[n]){
			return 1;
		}
		else if (b[b_final - 1] < ball[n]){
			return 1;
		}
	}
	if (a[a_final - 1] < ball[n]){
		a[a_final++] = ball[n];
		if (ball_in(ball, n + 1) == 1){
			return 1;
		}
		else {
			a_final--;
			a[a_final] = 0;
		}
	}
	if (b[b_final - 1] < ball[n]){
		b[b_final++] = ball[n];
		if (ball_in(ball, n + 1) == 1){
			return 1;
		}
		else {
			b_final--;
			b[b_final] = 0;
			return 0;
		}
	}
	else {
		return 0;
	}
}

int main(void)
{
	int n;
	
	scanf("%d", &n);
	while (n-- > 0){
		int ball[10];
		int i, j;
		
		for (i = 0; i < 10; i++){
			scanf("%d", &ball[i]);
		}
		if (ball_in(ball, 0) == 1){
			puts("YES");
		}
		else {
			puts("NO");
		}
	}
	
	return 0;
}

Measured memory_bytes: 580
#include <iostream>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

void solve(long long A, long long B){
    if (B == 1) cout << 0 << '\n';
    else if (A >= B) cout << 1 << '\n';
    else if ((B-A) % (A-1)) cout << (B-A) / (A-1) + 2 << '\n';
    else cout << (B-A) / (A-1) + 1 << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

int a[200200];
int lst[200200];

int main() {
	int n;
	std::cin >> n;
	for(int i = 0; i < n; i++) {
		std::cin >> a[i];
	}
	if(a[0] != 0) {
		std::cout << "-1\n";
		return 0;
	}
	long long ans = 0;
	for(int i = 1; i < n; i++) {
		if(a[i] > a[i - 1] + 1) {
			std::cout << "-1\n";
			return 0;
		}
		if(a[i] > 0) {
			lst[i - a[i]] = i;
		}
	}
	for(int i = 0; i < n; i++) {
		//std::cout << lst[i] << (i + 1 == n ? '\n' : ' ');
		if(lst[i] > 0) {
			ans += lst[i] - i;
		}
	}
	std::cout << ans << std::endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(void) {

    string s;
    cin >> s;
    for(int i=0; i<s.size(); i++){
      if( s[i] == ',' ) cout << " ";
      else cout << s[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define task "atcoder"
#define lwb lower_bound
#define upb upper_bound
#define ar array
#define fi first
#define se second
#define ALL(v) (v).begin(), (v).end()
typedef long double ld;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pii;

void solve()
{
    int x;
    cin>>x;
    if(x<30) cout<<"No";
    else cout<<"Yes";
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(fopen(task".inp","r"))
    {
        freopen(task".inp","r",stdin);
        freopen(task".out","w",stdout);
    }
    solve();
}







Measured memory_bytes: 3648
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)

res = A[0]
cnt = 1
use = []
for i in range(1, N):
    if A[i] == res:
        cnt += 1
    else:
        cnt = 1
        res = A[i]

    if cnt >= 2:
        use.append(A[i])
        cnt -= 2

    if len(use) >= 2:
        break

if len(use) >= 2:
    print(use[0]*use[1])
else:
    print(0)


Measured memory_bytes: 14224
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end());

	string t;
	cin >> t;
	sort(t.begin(), t.end());
	reverse(t.begin(), t.end());
	
	if(s < t) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
using namespace std;

#define coutv(v) for (int i = 0; i < (v).size(); ++i) cout << v[i] << ' '; cout << endl;
#define coutvv(v) for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cout << v[i][j] << ' '; cout << endl;}
#define debugv(v) {for (int i = 0; i < (v).size(); ++i) cerr << v[i] << ' '; cerr << endl;}
#define debugvv(v) {for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cerr << v[i][j] << ' '; cerr << endl;}}
#define TC int TESTCASE; cin >> TESTCASE; while (TESTCASE--)
typedef long long ll;



int main() {
    vector<int> a(5);
    cin >> a[0]; cin >> a[1]; cin >> a[2]; cin >> a[3]; cin >> a[4];
    int res = 0;
    int m = 10;
    for (int i = 0; i < 5; i++) {
        if (a[i] % 10 == 0) {
            res += a[i];
        } else {
            res += a[i] + 10 - (a[i] % 10);
            m = min(a[i] % 10, m);
        }

    }
    if (m == 10) {
        cout << res;
    } else {
        cout << res + m - 10;
    }

}


Measured memory_bytes: 3544
#include<bits/stdc++.h>
using namespace std;
int main()
{
 long long int a,b,c,d=0;

 cin>>a;
  for(int i=1;i<=a;i++)
{
  cin>>b>>c;
 d=d+abs(b-c)+1;
}
cout<<d<<endl;
}

Measured memory_bytes: 256
//
// Created on 2020/04/21.
//


#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <ios>
#include <iomanip>
#include <numeric>

#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;


int main() {

    int n;
    cin>>n;
    vector<int>A(n);

    for (int i = 0; i < n; ++i) {
        cin>>A[i];
    }
    auto A_2 = A;
    sort(all(A_2));

    for (int j = 0; j < n; ++j) {
        if(A[j] == A_2[n-1]){
            cout<<A_2[n-2]<<endl;
        }else{
            cout<<A_2[n-1]<<endl;
        }
    }



}


Measured memory_bytes: 3200
N = input()
answer_list = []
answer = 0

for i in range(len(N)):
  if N[i] == "A" or N[i] == "T" or N[i] == "C" or N[i] == "G":
    answer += 1
  else:
    answer_list.append(answer)
    answer = 0
  if i+1 == len(N):
    answer_list.append(answer)
print(max(answer_list))


Measured memory_bytes: 3060
#include<iostream>
using namespace std;

class Dice {
    public:
        int *num;

        Dice(int *n) {
            num = n;
        }

        int top() {
            return num[0];
        }

        void move(char c) {
            int n[6];
            for (int i = 0; i < 6; i++) {
                n[i] = num[i];
            }
            if (c == 'N') {
                num[0] = n[1];
                num[1] = n[5];
                num[4] = n[0];
                num[5] = n[4];
            } else if (c == 'S') {
                num[0] = n[4];
                num[1] = n[0];
                num[4] = n[5];
                num[5] = n[1];
            } else if (c == 'W') {
                num[0] = n[2];
                num[2] = n[5];
                num[3] = n[0];
                num[5] = n[3];
            } else {
                num[0] = n[3];
                num[2] = n[0];
                num[3] = n[5];
                num[5] = n[2];
            }
        }
};

int main() {
    int num[6];
    string c;
    for (int i = 0; i < 6; i++) {
        cin >> num[i];
    }
    cin >> c;

    Dice d(num);
    for (int i = 0; i < c.size(); i++) {
        d.move(c[i]);
    }
    cout << d.top() << endl;
}

Measured memory_bytes: 1208
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
	int a,b,c,t=0,f=0;
	cin>>a>>b>>c;
	while(a%2==0&&b%2==0&&c%2==0){
		if(a==b&&b==c&&a==c){cout<<-1<<endl;
		f=1;
		break;}
		int A,B,C;
		A=a/2;
		B=b/2;
		C=c/2;
		a=B+C;
		b=A+C;
		C=A+B;
		t++;
	}
	
	if(f==0) 
	cout<<t<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
  int d,n;
  cin >> d >> n;
  int beki = 1;
  int i;
  for(i = 0;i < d;++i){
    beki *= 100;
  }
  int ans;
  if(n != 100){
    ans = beki*n;
  }else{
    ans = 101*beki;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)

template <class T> struct CumulativeSum2D {
    vector<vector<T>> data;

    CumulativeSum2D(int W, int H) : data(W + 1, vector<int>(H + 1, 0)) {}

    void add(int x, int y, T z) {
        ++x, ++y;
        if (x >= data.size() || y >= data[0].size())
            return;
        data[x][y] += z;
    }

    void build() {
        FOR(i, 1, data.size()) FOR(j, 1, data.size()) {
            data[i][j] += data[i][j - 1] + data[i - 1][j] - data[i - 1][j - 1];
        }
    }

    T query(int sx, int sy, int gx, int gy) {
        return (data[gx][gy] - data[sx][gy] - data[gx][sy] + data[sx][sy]);
    }

    void print() {
        for (auto &x : data) {
            for (auto &y : x) {
                cout << y << " ";
            }
            cout << endl;
        }
    }
};

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    char c;
    int n, k, x, y;
    cin >> n >> k;
    CumulativeSum2D<int> s(k * 2, k * 2);
    REP(i, n) {
        cin >> x >> y >> c;
        if (c == 'W') {
            y += k;
        }
        y %= 2 * k;
        if (y >= k) {
            y -= k;
            x += k;
        }
        x %= 2 * k;
        s.add(x, y, 1);
        s.add((x + k) % (2 * k), y + k, 1);
    }
    // 二次元累積和
    s.build();
    // s.print();
    int maxv = 0;
    REP(x, k) {
        REP(y, k) {
            int t = s.query(x, y, x + k, y + k);
            maxv = max({maxv, t, n - t});
        }
    }
    cout << maxv << endl;
    return 0;
}


Measured memory_bytes: 16000
#include<iostream>
#include<algorithm>
#include<cmath>
using lint=int64_t;
using namespace std;

constexpr lint mod=1e9+7;

int main()
{
	int H,W,K;
	cin >> H >> W >> K;

	lint dp[110][10]={};
	dp[0][1]=1;
	
	for(int h=1;h<=H;h++)
	{
		for(int bit=0;bit<pow(2,W-1);bit++)
		{
			int tbit=bit;
			int bits[10]={};
			bool con=false;
			for(int j=1;j<=W-1;j++)
			{
				bits[j]=tbit%2;
				tbit/=2;
				if(bits[j-1]==1 && bits[j]==1)con=true;
			}
			if(con)continue;
			
			for(int j=1;j<=W;j++)
			{
				if(bits[j-1]==0 && bits[j]==0)
					dp[h][j]+=dp[h-1][j];
				else if(bits[j-1]==1)
					dp[h][j]+=dp[h-1][j-1];
				else if(bits[j]==1)
					dp[h][j]+=dp[h-1][j+1];
				dp[h][j]%=mod;
			}
		}
	}

	cout << dp[H][K] << endl;
	return 0;
}



Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: usize = sc.get();
    let t = (N + 999) / 1000;
    println!("{}", t * 1000 - N);
}


Measured memory_bytes: 2132
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 87;
int n;
ll a[N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        a[i] += a[i-1];
    }
    ll ans = a[n];
    for (int i = 2; i <= n - 2; ++i) {
        int j = upper_bound(a+1,a+i,a[i]/2) - a;
        int k = upper_bound(a+i+1,a+n+1,(a[i]+a[n])/2) - a;
        for (int i0 = j - 2; i0 <= j + 2; ++i0)
            for (int i2 = k - 2; i2 <= k + 2; ++i2) {
                if (i <= i0 || i2 <= i || i0 < 1 || i2 >= n)
                    continue;
                ll t[4] = {a[i0],a[i]-a[i0],a[i2]-a[i],a[n]-a[i2]};
                sort(t,t+4);
                ans = min(ans, t[3]-t[0]);
            }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <sstream>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
#include <list>
using namespace std;
#define INF 100000000
typedef long long int lli;
typedef pair<int,int> P;
int dp[100][100];

int main (){
	string tmp;
	vector<vector<int> > data;
	for(int i=0; i<100; ++i){
		for(int j=0; j<100; ++j){
			dp[i][j]=-1;
		}
	}
	while(cin >> tmp){
		vector<int> v;
		replace(tmp.begin(),tmp.end(),',',' ');
		stringstream ss(tmp);

		while(ss >> tmp){
			v.push_back(atoi(tmp.c_str()));
		}
		data.push_back(v);
	}
	dp[0][0]=data[0][0];
	for(int i=1; i<data.size(); ++i){
		for(int j=0; j<data[i].size(); ++j){
			for(int k=0; k<data[i-1].size(); ++k){
				if(i<=data.size()/2){
					if(k==j||k+1==j){
						dp[i][j]=max(dp[i][j],dp[i-1][k]+data[i][j]);
					}
				} else {
					if(k==j||k-1==j){
						 dp[i][j]=max(dp[i][j],dp[i-1][k]+data[i][j]);
					}
				}
			}
		}
	}
	//cout << dp[1][0] << " " << dp[1][1] << "\n";
	cout << dp[data.size()-1][0] << "\n";
	/*for(int i=0; i<data.size(); ++i){
		for(int j=0; j<data[i].size(); ++j){
			cout << dp[i][j] << " ";
		}
		cout << "\n";
	}*/
	return 0;
}

Measured memory_bytes: 1300
def solve(i, tp, n, ar)
  if i == n
    puts ar.join
    return
  end
  for j in 1..(tp+1)
    ar[i] = (("a".ord)+j-1).chr
    (j <= tp) ? solve(i+1, tp, n, ar) : solve(i+1, tp+1, n, ar)
  end
end

n = gets.to_i

ar = Array.new(n)
ar[0] = "a"

solve(1, 1, n, ar)

Measured memory_bytes: 3196
using System;
using System.Linq;

namespace A_Favorite_Sound
{
    class Program
    {
        static void Main(string[] args)
        {
            var ABC = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var A = ABC[0];
            var B = ABC[1];
            var C = ABC[2];

            Console.WriteLine(B / A >= C ? C : B / A);

        }
    }
}

Measured memory_bytes: 11348
package main
import (
  "fmt"
)
func main() {
  var a, b int
  fmt.Scan(&a, &b)
  dif := b-a
  sum := 0
  for i := 1; i < dif; i++ {
    sum += i
  }
  result := sum-a
  fmt.Println(result)
}

Measured memory_bytes: 512
import java.util.*;

class Main {

  public static final int MAX_INT = 2147483647;

  static boolean isPrime(int n) {
    for (int i = 7; (i-1)*(i-1) <= n; i += 7) {
      if (n % (i-1) == 0 || n % (i+1) == 0) return false;
    }
    return true;
  }

  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    boolean primeList[] = new boolean[300000];

    for (int i = 7; i - 1 < 300000; i += 7) {
      if (isPrime(i-1)) primeList[i-1] = true;
      if (isPrime(i+1)) primeList[i+1] = true;
    }

/*
    for (int i = 0; i < 10; i++){
      for (int j = 0; j < 10; j++) {
        if (primeList[i*10 + j]) System.out.print("  #");
        else System.out.print("  -");
      }
      System.out.println();
    }
*/
    while (true) {
      int n = sc.nextInt();
      if (n == 1) return;

      System.out.print(n + ":");
      for (int i = 2; i <= n; i++)
        if (primeList[i] && n % i == 0) System.out.print(" " + i);
      System.out.println();
    }

  }
}



Measured memory_bytes: 31384
use std::io;
use std::cmp;

fn main() {
    let n = read_values::<usize>()[0];
    let d = read_values::<i32>();

    let mut count = vec![0; 13];
    for e in &d {
        count[(*e as usize)] += 1;
    }

    if count[0] >= 1 {
        println!("0");
        return;
    }

    for c in &count {
        if *c >= 3 {
            println!("0");
            return;
        }
    }
    if count[12] >= 2 {
        println!("0");
        return;
    }

    let mut fixed = Vec::<i32>::new();
    let mut d = Vec::<i32>::new();
    for i in 1..13 {
        if count[i] == 2 {
            fixed.push(i as i32);
        } else if count[i] == 1 {
            d.push(i as i32);
        }
    }

    let mut max = 0;
    for mask in 0..(1 << d.len()) {
        let mut v = Vec::new();
        for i in 0..d.len() {
            if ((1 << i) & mask) != 0 {
                v.push(d[i]);
            } else {
                v.push(-d[i]);
            }
        }

        for f in &fixed {
            v.push(*f);
            v.push(-(*f));
        }
        v.push(0);

        v.sort();
        let mut min = 12;
        for i in 0..v.len() {
            if i == v.len() - 1 {
                min = cmp::min(min, v[0] + 24 - v[i]);
            } else {
                min = cmp::min(min, v[i + 1] - v[i]);
            }
        }

        max = cmp::max(max, min);
    }
    println!("{}", max);
}

fn read_line() -> String {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).unwrap();
    buf
}

fn read<T>() -> T
    where T: std::str::FromStr,
          T::Err: std::fmt::Debug
{
    read_line().trim().parse().unwrap()
}

fn read_values<T>() -> Vec<T>
    where T: std::str::FromStr,
          T::Err: std::fmt::Debug
{
    read_line()
        .split(' ')
        .map(|a| a.trim().parse().unwrap())
        .collect()
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

struct UF {
  int n;
  vector<int> pr;

  UF(){};
  UF(int _n) {
    n = _n;
    pr.resize(n);
    for (int i = 0; i < n; i++) {
      pr[i] = i;
    }
  };
  int root(int a) {
    if (a == pr[a])
      return a;
    else {
      return pr[a] = root(pr[a]);
    }
  }
  void unite(int a, int b) {
    a = root(a);
    b = root(b);
    if (a == b) return;
    pr[a] = b;
  }
  bool same(int a, int b) { return root(a) == root(b); }
};

int main() {
  int n, k, l;
  cin >> n >> k >> l;
  UF road(n);
  UF rail(n);
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    road.unite(x, y);
  }
  for (int i = 0; i < l; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    rail.unite(x, y);
  }
  map<pair<int, int>, int> cnt;
  for (int i = 0; i < n; i++) {
    P x = make_pair(road.root(i), rail.root(i));
    //   cerr << road.root(i) << " " << rail.root(i) << endl;
    cnt[x]++;
  }
  for (int i = 0; i < n; i++) {
    P x = make_pair(road.root(i), rail.root(i));
    cout << cnt[x];
    if (i < n - 1) cout << " ";
  }
  cout << endl;
}


Measured memory_bytes: 13568
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i < (int)(n); i++)
using ull = unsigned long long;
using ll = long long;

const int INF = 1E+9;

int main() {
    int N;
    cin >> N;

    int a[N];
    rep(i, N) cin >> a[i];

    int LIS[N];
    fill(LIS, LIS + N, INF);

    rep(i, N) {
        auto pos = lower_bound(LIS, LIS+N, a[i]);
        *pos = a[i];
    }

    cout << lower_bound(LIS, LIS+N, INF) - LIS << endl;

    return 0;
}


Measured memory_bytes: 3872
#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
int main(void)
{
  int n;
  cin >> n;
  for(int i=1;;++i){
    int di=0;
    for(int j=1;j<=i;++j){
      if(i%j==0)di++;
    }
    if(di==n){
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n; cin>>n;
	cout << setp(9) << (double)((n+1)/2)/n << "\n";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

int main(){
	string t;
	cin >> t;
	int n = t.size();
	
	static int x[1<<18][18];
	rep(i,n){
		x[i][0] = t[i]-'a';
	}
	for(int i = n ; i < (1<<18) ; i ++){
		x[i][0] = -1;
	}
	for(int j = 0 ; j < 17 ; j ++){
		vector<P> vec;
		rep(i,n){
			vec.pb(P(x[i][j],x[i+(1<<j)][j]));
		}
		sor(vec);
		uniq(vec);
		rep(i,n){
			x[i][j+1] = lb(vec,P(x[i][j],x[i+(1<<j)][j])) - vec.begin();
		}
		for(int i = n ; i < (1<<18) ; i ++){
			x[i][j+1] = -1;
		}
	}
	
	int ret = 0;
	static int y[1<<18];
	rep(i,(1<<18))y[i] = -1;
	rrep(j,18){
		vector<P> vec;
		rep(i,n){
			vec.pb(P(y[i],x[i+ret][j]));
		}
		sor(vec);
		uniq(vec);
		if(vec.size() != n){
			rep(i,n){
				y[i] = lb(vec,P(y[i],x[i+ret][j])) - vec.begin();
			}
			ret += (1<<j);
		}
	}
	
	cout << n-ret << endl;
}



Measured memory_bytes: 21848
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	ab = input[0].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var a = parseInt(ab[0], 10);
	var b = parseInt(ab[1], 10);
   if (b%a == 0){console.log(a+b);}else{console.log(b-a);}
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
#define int long long 

main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int N; cin >> N;
	set<int> S;
	//all factors of N-1
	for (int i=1; i*i<=N-1; i++){
		if ((N-1)%i==0){
			S.insert(i);
			S.insert((N-1)/i);
		}
	}
	//cout << S.size() << " ";
	for (int i=2; i*i<=N; i++){
		if (N%i!=0) continue;
		int k = i;
		while (k<=N){
			if (N%k!=0) break;
			if ((N/k) % i==1){
				S.insert(i);
				//cout << i << "\n";
				break;
			}
			k *= i;
		}
		k = N/i;
		if ((N/k)%k==1) S.insert(k);
	}
	S.insert(N);
	S.erase(1);
	//for (auto i:S) cout << i << " ";
	//cout << "\n";
	cout << (int) S.size();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
typedef long long ll;




int main(){
    string s;cin>>s;
    ll l=0,r=s.size()-1,lx=0,rx=0,ans=0;
    while(l<=r){
        lx=0;rx=0;
        while(s.at(l)=='x'){
            l++;
            lx++;
            if(l==s.size()){
                cout<<0<<endl;
                return 0;
            }
        }
        while(s.at(r)=='x'){
            r--;
            rx++;
        }
        if(s.at(l)!=s.at(r)){
            cout<<-1<<endl;
            return 0;
        }
        ans+=abs(lx-rx);
        l++;
        r--;
    }
    cout<<ans<<endl;
    
}







Measured memory_bytes: 512
import bisect
N, K, Q = [int(i) for i in input().split()]
A = [(int(v),i) for i,v in enumerate(input().split())]
A.sort()
B = [0]*(N)
for i in range(N):
    B[A[i][1]] = i
C = [A[B[i]][0] for i in range(N)]
Candi = set(range(N))
ctr = 0
ans = []
rng = [-1,N]
while len(Candi) >= Q:
    T = sorted(Candi)
    ans.append((list(T)[0],list(T)[Q-1]))
    x = B.index(ctr)
    st = bisect.bisect_left(rng, x)
    Candi = Candi - set(sorted(B[rng[st-1]+1:x]+[2002],reverse = 1)[:K])\
    - set(sorted(B[x:rng[st]]+[2002],reverse = 1)[:K])- set([B[x]])
    bisect.insort_left(rng, x)
    ctr += 1
print(min([A[j][0]-A[i][0] for i,j in ans]))

Measured memory_bytes: 3956
#include <bits/stdc++.h>

#define INF 1e9
using namespace std;

#define REPR(i, n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()

template<class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

typedef long long ll;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }


int main() {
    int N, Y;
    cin >> N >> Y;
    REP(k10, N + 1) {
        REP(k5, N + 1 - k10) {
            auto k = (double)(Y-(10000*k10+5000*k5))/1000;
            if (k==(N-k10-k5)) {
                cout << k10 << " " << k5 << " " << k << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;

int main() {
    int j = 0;
    int x = 1;
    while (x != 0)
    {
        cin >> x;
        if (x == 0)
            break;
        j++;
        cout << "Case " << j << ": " << x << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcorder_text
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int SV = int.Parse(input[0]);
            int HW = int.Parse(input[1]);

            int[]HWList= Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            int HWday = HWList.Sum();
            int Freeday = SV - HWday;
            if (HWday > SV)
            {
                Console.Write("-1");
            }
            else
            {
                Console.Write(Freeday);
            }
            Console.Read();
        }
    }
}


Measured memory_bytes: 28988
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MaxN = 4e5;
int n;
int a[MaxN + 5];

int main()
{
	while (~scanf("%d", &n)) {
		n = n * 3;
		for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
		sort(a + 1, a + n + 1);
		int cnt = 0;
		long long ans = 0;
		for (int i = n; i >= 1; i -= 2) {
			ans = ans + a[i - 1];
			cnt++;
			if (cnt == n / 3) break;
		}
		printf("%lld\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;

int main(void) {
	int n, l;
	cin >> n >> l;
	int ans = 0;
	int a = 101;
	int b = 0;
	for (int i = l; i < n + l; i++) {
		ans += i;
		if (a > abs(i)) {
			a = abs(i);
			b = i;
		}
	} 
	ans -= b;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}

int main() {
	string a, b;
	cin >> a >> b;
	if (a.size() > b.size())cout << "GREATER" << endl;
	else if (a.size() < b.size())cout << "LESS" << endl;
	else {
		rep(i, a.size()) {
			if (a[i]-'0' > b[i] - '0') {
				cout << "GREATER" << endl;
				return 0;
			}
			else if (a[i] - '0' < b[i] - '0') {
				cout << "LESS" << endl;
				return 0;
			}
		}
		cout << "EQUAL" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  if (n == 4 && ((a == 1 && b == 4) || (a == 4 && b == 1)))
    printf("Draw");
  if (abs(b - a) % 2 == 1)
    printf("Borys");
  else
    printf("Alice");
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n;
vector< vector<int> > do_thi; 
bool *da_duyet;
int *d;
int *f;
int timestamp;

void dfs(int dinh_dang_duyet) { 
	d[dinh_dang_duyet] = timestamp++; // Danh dau so buoc bat dau duyet dinh
	da_duyet[dinh_dang_duyet] = true; // Danh dau dinh da duoc duyet
	// Tim nhung dinh lan can
	for (int i = 0, lan_can = 0; i < do_thi[dinh_dang_duyet].size(); ++i) {
		lan_can = do_thi[dinh_dang_duyet][i];
		if (da_duyet[lan_can]) continue;
		dfs(lan_can);
	}
	f[dinh_dang_duyet] = timestamp++; // Danh dau so buoc khi ket thuc viec duyet dinh do
}

int main() {
	cin >> n; // Sau khi co gia tri n cu the moi cap phat kich thuoc o nho cho cac mang
	da_duyet = new bool[n + 1]; // Cap phat mang danh dau dinh da duyet hay chua (vi mang chi so tinh tu 0)
	d = new int[n + 1]; // Cap phat mang de luu thoi diem tim ra cac dinh
	f = new int[n + 1]; // Cap phat mang de luu thoi diem duyet xong cac dinh
	
	for (int i = 0; i <= n; ++i) { // Khoi tao cac gia tri cho moi dinh
		do_thi.push_back(vector<int>()); // Khoi tao vector cho moi dinh
		da_duyet[i] = false; // Khoi tao trang thai da duyet hay chua cho moi dinh
		d[i] = 0; // Khoi tao thoi diem tim ra moi dinh
		f[i] = 0; // Khoi tao thoi diem duyet xong moi dinh
	}
	for (int i = 0, k = 0, u = 0, v = 0; i < n; ++i) { // Xay dung cac canh cua do thi
		cin >> u; // Doc vao ID cua dinh u
		cin >> k; // Doc vao so dinh ke voi u (bac cua dinh u)

		for (int j = 0; j < k; ++j) { // Doc vao cac dinh lan can cua u, dua vao do thi
			cin >> v; // Doc vao moi dinh lan can
			do_thi[u].push_back(v); // Dua vao vector bieu dien tinh tuong ung
		}
	}
	
//	for (int i = 1; i <= n; ++i) { // Sap xep lai cac dinh lan can cua dinh i
//		sort(do_thi[i].begin(), do_thi[i].end());
//	}
	
	timestamp = 1;
	
	for (int i = 1; i <= n; ++i) { // Duyet tat ca cac dinh cua do thi
		if (da_duyet[i]) continue; // Neu dinh da duyet thi kiem tra tiep
		dfs(i);	// Neu dinh chua duyet thi dua vao ham dfs
	}
	
	for (int i = 1; i <= n; ++i) { // In ra ket qua
		cout << i << " " << d[i] << " " << f[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 3168
/* Author : Aaryan Srivastava ^__^ */ 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define pb push_back
#define popb pop_back
#define mt make_tuple 
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second 
#define ull unsigned long long  
#define pii pair<int, int>
#define piii pair<int,pii>
#define beg begin
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define int ll
using ll = long long;
const int N = 3*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace __gnu_pbds;
using namespace std;
using ordered_set =  tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr 
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#endif


void solve()
{
	int n , ans = 0;
	cin >> n;
	vector<int> a(n) ;
	int sign = 1; 
	rep(i,n) cin >> a[i] ;
	for(int i = 0 ; i < n-1 ; ++i){
		ans = a[i] - ans ;
		sign = sign*-1; 
	}
	ans = a[n-1] - ans; 
	int t[n] = {} ;
	t[0] = ans ;
	repA(i,1,n-1){
		t[i] = (a[i-1] - t[i-1]/2)*2 ;
	}
	rep(i,n) cout << t[i] <<" " ;
}   

     
int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        //cout << endl ;
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}

Measured memory_bytes: 2944
#include<iostream> 
#include<string> 
#include<vector> 
#include<algorithm> 
#include<cmath>
#include<set>
#include<utility>

using namespace std;


int main()
{
	int x;
	cin >> x;
	vector<int> a(100000);
	a[0] = 1;
	int aa = 1;
	for (int i = 2; i*i <= x; i++)
	{
		int y = 1;
		for (;;)
		{
			y *= i;
			if (y > x)
			{
				break;
			}
			a[aa] = y;
			aa++;

		}
		
	}
	sort(a.begin(),a.end());
	reverse(a.begin(), a.end());
	cout << a[0] << endl;


}

Measured memory_bytes: 640
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let x: i64 = sc.cin();
    let mut left = 0;
    let mut right = x;
    for _ in 0..100 {
        let mid = (left + right) / 2;
        if mid * (mid + 1) / 2 >= x {
            right = mid;
        } else {
            left = mid;
        }
    }
    put!(right);
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    int A = 0, B = 0;
    rep(i, n) {
        if (i % 2 == 0) A+=a[i];
        else B+=a[i];
    }
    cout << A-B << endl;
    return 0;
}

Measured memory_bytes: 3600