akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define bitsz(x) int(__builtin_popcount(x))
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb(x) push_back(x)
#define INF 1e9
#define LINF 1e18
#define mod 1000000007
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const int di[4] = {1,0,-1,0};
const int dj[4] = {0,1,0,-1};


int main() {
    int n; cin >> n;
    int k; cin >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int lb=0, ub=INF;
    auto C = [&](int x) {
        int num = 0;
        rep(i,n) {
            int tmp = a[i]/x;
            if (a[i]%x==0) tmp--;
            num += tmp;
        }
        if (num <= k) return true;
        else return false;
    };
    while (ub-lb>1) {
        int mid = (lb+ub)/2;
        if (C(mid)) ub = mid;
        else lb = mid;
    }
    cout << ub << endl;
}

Measured memory_bytes: 4040
#include<iostream>

using namespace std;

int main(){

    int input, i=1;

    while(1){

        cin >> input;
        
        if(input == 0){
            break;
        }else{
            cout << "Case " << i << ": " << input << endl;
        }

        i++;

    }

    return 0;

}


Measured memory_bytes: 2984
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long LL;
typedef pair<LL,LL>PL;
const LL INF=1e18;
const LL MAXV=1e5+10;
LL N,M,s,e,i;
vector<LL>adj[MAXV];
vector<LL>V;
bool chk;
LL cnt;
LL disc[MAXV];
LL dfs(LL x)
{
    LL ret=disc[x]=++cnt;
    for(LL i=0;i<adj[x].size();i++)
    {
        if(disc[adj[x][i]]>0)
            ret=min(ret,disc[adj[x][i]]);
        else
        {
            LL t=dfs(adj[x][i]);
            if(t>=disc[x]&&x>0)
            {
                chk=true;
                return INF;
            }
            ret=min(ret,t);
        }
    }
    return ret;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>N>>M;
    for(i=0;i<M;i++)
    {
        cin>>s>>e;
        adj[--s].push_back(--e);
        adj[e].push_back(s);
    }
    for(i=0;i<N;i++)
    {
        if(adj[i].size()&1)
            return cout<<"No"<<endl,0;
        if(adj[i].size()>2)
            V.push_back(adj[i].size());
    }
    dfs(0);
    sort(V.begin(),V.end());
    if(V.empty())
        cout<<"No";
    else if(V.size()==1)
    {
        if(V[0]==4)
            cout<<"No";
        else
            cout<<"Yes";
    }
    else if(V.size()==2)
    {
        if(V[0]==4&&V[1]==4&&!chk)
            cout<<"No";
        else
            cout<<"Yes";
    }
    else
        cout<<"Yes";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 9728
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
#include <list>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define F first
#define S second


int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};



string str;
int pos;

int S[20];
int n;
int ans;

int getnum(){
  int l=0,r=0;
  char c;
  if(str[pos]=='('){
    ++pos;
    l=getnum();
  }else{
    ++pos;
    return S[str[pos-1]-'0'];
  }


  c=str[pos];
  ++pos;

  r=getnum();

  ++pos;

  switch(c){
  case 'A':
    return l&r;
  case 'O':
    return l|r;
  }
  return l^r;
}
  
void dfs(int idx){
  while(idx<str.size() && str[idx]!=' ')++idx;
  if(idx==str.size()){
    //cout<<str<<endl;
    pos=0;
    int st=getnum();
    //cout<<st<<endl;
    if(st==15)++ans;
    return;
  }

  str[idx]='A';
  dfs(idx);
  str[idx]='O';
  dfs(idx);
  str[idx]='X';
  dfs(idx);
  str[idx]=' ';
}

main(){
  while(getline(cin,str)){
    if(str=="END")break;
    rep(i,str.size()){
      if(isdigit(str[i]))str[i]--;
    }

    string tss;
    getline(cin,tss);
    stringstream tsin(tss);
    tsin>>n;
    rep(i,n){

      getline(cin,tss);
      stringstream sin(tss);
      S[i]=0;
      rep(j,4){
	int t;
	sin>>t;
	S[i]|=t<<j;
      }
    }
    ans=0;
    dfs(0);
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 0
function main()
  
  (N,X) = map(x -> parse(Int,x), split(readline()))
  L = map(x -> parse(Int,x), split(readline()))
  
  D = zeros(Int,N+1)
  
  for i in 2:N+1
    D[i] = D[i-1] + L[i-1]
  end
  
  count = 0
  
  for i in 1:N+1
    if X >= D[i]
      count += 1
    end
  end
  
  println(count)
  
end

main()

Measured memory_bytes: 112520
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <numeric>
#include <list> 

using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(),x.end()
#define INF (1e9)

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

long long dp(int l ,ll x, vector<ll> vi,  vector<ll> ci) {
    if (x <= 0) return 0;
    if (l == 0) return 1;
    if (vi[l - 1] + 1 >= x) {
        return dp(l - 1, x - 1, vi, ci);
    } else {
        return 1 + ci[l - 1] + dp(l - 1, x - 2 - vi[l-1], vi, ci);
    }
    return 0;
}
int main() {
	int n;
    ll x;
	cin >> n >> x;
    vector<ll> vi(n + 2);
    vector<ll> ci(n + 2);
    REP(i, n + 2) {
        if (i == 0) vi[i] = 1;
        else vi[i] = vi[i - 1] * 2 + 3;
        if (i == 0) ci[i] = 1;
        else ci[i] = ci[i - 1] * 2 + 1;
    }
    printf("%lld", dp(n, x, vi, ci));
}

Measured memory_bytes: 256
Module Program
  Sub Main
    Dim s = Gets()
    Dim a=s(0)
    Dim ans=700
    ans+=If(a(0)="o"c,100,0)
    ans+=If(a(1)="o"c,100,0)
    ans+=If(a(2)="o"c,100,0)
    Console.WriteLine(ans)
  End Sub
  
  '/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  Function Gets() As String()
    Gets = Console.ReadLine().Split(" "c)
  End Function
  Function GetInts() As Integer()
    Dim s = Gets(), r(UBound(s)) As Integer
    For i As Integer=0 To UBound(s): r(i)=s(i): Next i
    GetInts = r
  End Function
End Module

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

int main() {
  int n,k,x,y;cin>>n>>k>>x>>y;
  int ans=0;
  for(int i=1;i<=n;++i){
    if(i<=k) ans+=x;
    else ans+=y;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define re(n) for (int i = 0; i < (n); ++i)
#define rej(n) for (int j = 0; j < (n); ++j)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef pair <int, int> pii;
typedef vector <pair <int, int>> vii;

const ld PI = acos((ld)-1);

int main() {
    #ifndef LOCALDEBUG
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #endif  // LOCALDEBUG
    int a, b, c;
    cin >> a >> b >> c;
    if (a + b + c >= 22) cout << "bust";
    else cout << "win";
    return 0;
}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000000000000000000000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)                                                                             
#define seg_size 524288
vector<pair<long long, long long>> vertexs[200000];
long long already[200000] = {};
int main() {
#define int long long
	int n;
	cin >> n;
	vector<tuple<long long, long long, long long>> wow, aa;
	REP(i, n) {
		int a, b;
		cin >> a >> b;
		wow.push_back(make_tuple(a, b, i));
		aa.push_back(make_tuple(b, a, i));
	}
	sort(wow.begin(), wow.end());
	long long ans = 0;
	for (int i = 0;i < n - 1;++i) {
		vertexs[get<2>(wow[i])].push_back(make_pair(get<2>(wow[i + 1]), get<0>(wow[i + 1]) - get<0>(wow[i])));
		vertexs[get<2>(wow[i + 1])].push_back(make_pair(get<2>(wow[i]), get<0>(wow[i + 1]) - get<0>(wow[i])));
	}
	sort(aa.begin(), aa.end());
	for (int i = 0;i < n - 1;++i) {
		vertexs[get<2>(aa[i])].push_back(make_pair(get<2>(aa[i + 1]), get<0>(aa[i + 1]) - get<0>(aa[i])));
		vertexs[get<2>(aa[i + 1])].push_back(make_pair(get<2>(aa[i]), get<0>(aa[i + 1]) - get<0>(aa[i])));
	}
	priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> tmp;
	tmp.push(make_pair(0, 0));
	while (tmp.empty() == false) {
		pair<int, int> now = tmp.top();
		tmp.pop();
		if (already[now.second] == false) {
			ans += now.first;
			already[now.second] = true;
			for (int i = 0;i < vertexs[now.second].size();++i) {
				if (already[vertexs[now.second][i].first] == false) {
					tmp.push(make_pair(vertexs[now.second][i].second, vertexs[now.second][i].first));
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main(void) {
  int n, t, a;
  cin >> n >> t >> a;
  double mindiff = 1e18;
  int mini = -1;
  for (int i = 0; i < n; i++) {
    int h;
    cin >> h;
    double diff = abs(a - (t - h * 0.006));
    if (diff < mindiff) {
      mindiff = diff;
      mini = i;
    }
  }
  cout << mini + 1 << endl;
  return 0;
}

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    if (A > B) {
        int tmp = A;
        A = B;
        B = tmp;
    }
    if (B > C) {
        int tmp = B;
        B = C;
        C = tmp;
    }
    if (A > B) {
        int tmp = A;
        A = B;
        B = tmp;
    }
    cout << A << " " << B << " " << C << endl;
}


Measured memory_bytes: 3096
import java.io.*;
import java.util.*;

public class Main{
    public static void main(String args[]) throws IOException{
	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

	int n=Integer.parseInt(br.readLine());
	System.out.println("0.000000 0.000000");
	koch(new double[]{0,0}, new double[]{100,0},n);
	System.out.println("100.000000 0.000000");
    }
    static void koch(double[] p,double[] q,int n){
	double pi=Math.PI/3;
        if(n==0)
	    return;
        double[] s={(2*p[0]+q[0])/3,(2*p[1]+q[1])/3};
        double[] t={(p[0]+2*q[0])/3,(p[1]+2*q[1])/3};
	
        double[] u={(t[0]-s[0])*Math.cos(pi)-(t[1]-s[1])*Math.sin(pi)+s[0],(t[0]-s[0])*Math.sin(pi)+(t[1]-s[1])*Math.cos(pi)+s[1]};

        koch(p.clone(),s.clone(),n-1);
	System.out.println(s[0]+" "+s[1]);
	
        koch(s.clone(),u.clone(),n-1);
        System.out.println(u[0]+" "+u[1]);
	
        koch(u.clone(),t.clone(),n-1);
        System.out.println(t[0]+" "+t[1]);
	
        koch(t.clone(),q.clone(),n-1);   
   }
}



Measured memory_bytes: 31860
#include<iostream>
#include<string>
#include<vector>

int main()
{
    int h, w;
    int bomb = 0;
    std::string in;
    std::cin >> h >> w;
    std::vector<std::string> field;
    for(int i = 0; i < h; i++){
        std::cin >> in;
        field.push_back(in);
    }
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(field[i][j] == '.'){
                bomb = 0;
                if(j > 0){
                    if(i > 0){
                        if(field[i-1][j-1] == '#'){
                            bomb = bomb + 1;
                        }
                    }
                    if(i < h-1){
                        if(field[i+1][j-1] == '#'){
                            bomb = bomb + 1;
                        }
                    }
                        if(field[i][j-1] == '#'){
                            bomb = bomb + 1;
                        }
                }
                if(j < w-1){
                    if(i > 0){
                        if(field[i-1][j+1] == '#'){
                            bomb = bomb + 1;
                        }
                    }
                    if(i < h-1){
                        if(field[i+1][j+1] == '#'){
                            bomb = bomb + 1;
                        }
                    }
                        if(field[i][j+1] == '#'){
                            bomb = bomb + 1;
                        }
                }
                if(i > 0){
                        if(field[i-1][j] == '#'){
                            bomb = bomb + 1;
                        }
                }
                if(i < h-1){
                        if(field[i+1][j] == '#'){
                            bomb = bomb + 1;
                        }
                }
                field[i][j] = (char)('0' + bomb);
            }
        }
    }
    for(int i = 0; i < h; i++){
        std::cout << field[i] << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
int i,l;
char s[100010];
int main()
{
	scanf("%s",s);
	l=strlen(s);
	for (i=0;i<l;i++)
	{
		if (i%2==0) printf("%c",s[i]);
	}
	printf("\n");
}

Measured memory_bytes: 256
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'

void solve(){
  int n;
  cin >> n;
  vector<int> a(n);
  int s = 0;
  forn(i,n) {
    cin >> a[i];
    s += a[i];
  }
  sort(all(a));
  int al = 0;
  for (int i =0;i<n;i+=2){
    al += a[i];
  }
  cout << abs(s - 2 * al);
}

int main() {
  ios::sync_with_stdio(false);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

1
322123


n - 1
0 ... (n-1) [res ... res] S - (n-1) ... S


 */

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));



signed main(){
cin.tie(0);
ios::sync_with_stdio(false);

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	cout << max(a*b, c*d) << endl;
	return 0;
}



Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**7)

debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)



def solve():
    N = int(input())
    p_list = list(map(int, input().split()))

    cnt = 0
    for i in range(1, N-1):
        pre = p_list[i-1]
        p = p_list[i]
        pos = p_list[i+1]

        if p < pre and p > pos:
            cnt += 1
        elif p > pre and p < pos:
            cnt += 1

    print(cnt)

solve()

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

using namespace std;

int main() {
  int n;
  int a,b;
  cin >> n >> a >> b;

  if((abs(a - b) - 1) % 2 == 1) {
    cout << "Alice" << endl;
  }
  else cout << "Borys" << endl;
}


Measured memory_bytes: 256
def main():
    n,k=map(int,input().split())
    a=input()
    i=0
    cnt=1
    l=[]
    while i<n-1:
        if a[i]!=a[i+1]:
            l.append(cnt)
            cnt=1
        else:
            cnt+=1
        i+=1
    l.append(cnt)
    print(min(n-len(l)+2*k,n-1))
main()

Measured memory_bytes: 3956
import sys
from collections import Counter

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = list(sr())
counter = Counter(S)
bool = True
for v in counter.values():
    if v != 2:
        bool = False

print('Yes' if bool else 'No')
# 20

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

const long double EPS = 1e-10;
const long long INF = 1e18;
const int MOD = (int)1e9 + 7;
const long double PI = acos(-1.0L);

int main() {  // TODO
  rep(i, 5) {
    int x;
    cin >> x;
    if (x == 0) {
      cout << i + 1 << endl;
      return 0;
    }
  }

  return 0;
}

Measured memory_bytes: 3580
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> T gcd(T a, T b){return !b?a:gcd(b,a%b);}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 66666;
ll k,f[N],g[N];int cnt=600;
ll C(ll n, ll m){
	ll r=1;rep(i,1,m)r=r*(n-i+1)/i;return r;
}
int main() {
	read(k);
	rep(i,1,cnt)f[i]=C(6+i,7);
	per(i,cnt,1)while(k>=f[i])k-=f[i],g[i]++;
	rep(i,1,cnt){
		cout<<"FESTIVA";
		while(g[i]--)cout<<"L";
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
 
using namespace std;
using ll = long long;
 
void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
 
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), string{})
#define Cusum(T, n, xs, sxs) vector<T> sxs(n+1); For(i, n) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) for(const auto &e : xs) cout << e << "\n"; cout << "\n"
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")

int sd2(int n){
    unsigned int x = (n & 0x55555555) + ((n >> 1) & 0x55555555);
    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
    x = (x & 0x0f0f0f0f) + ((x >> 4) & 0x0f0f0f0f);
    x = (x & 0x00ff00ff) + ((x >> 8) & 0x00ff00ff);
    return (x & 0x0000ffff) + ((x >> 16) & 0x0000ffff);
}

int main(void){
    Cin(int, n);
    vector<int> f(n);
    For(i, n){
        For(j, 10){
            f[i] <<= 1;
            Cin(int, t);
            f[i] += t;
        }
    }
    Cinss(int, n, 11, p);
    
    int ans = -2e9;
    for(int b = 1; b < 1024; b ++){
        int a = 0;
        For(i, n) a += p[i][sd2(b & f[i])];
        ans = max(ans, a);
    }
    Cout(ans);
}


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

int main(){
	int a, b, c;
	int arr [3];

	cin >> a >> b >> c;
	arr[0] = a;
	arr[1] = b;
	arr[2] = c;

	for(int i=0; i<2; i++) {
		for(int j=1; j<3; j++) {
			if(arr[i] > arr[j]) {
				int temp = arr[i];
				arr[i] = arr[j];
				arr[j] = temp;
			}
		}
	}

	for(int i=0; i<3; i++) {
		cout << arr[i];
		if(i==2) {
			cout << endl;
		}else{
			cout << ' ';
		}
	}

	return 0;
}


Measured memory_bytes: 3104
#include<stdio.h>
int main(void){
    int x,a,b;
    int A,B;
    scanf("%d %d %d",&x,&a,&b);
    A = x-a;
    B = x-b;
    if(A<0){
        A = -A;
    }
    if(B<0){
        B = -B;
    }
    if(A>B){
        printf("B");
    }
    if(B>A){
        printf("A");
    }
    return 0;
}

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

int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  char pre, post;
  for(auto a : S){
    post = pre;
    pre = a;
    if(pre == post) continue;
    ans++;
  }
  cout << ans << endl;
}
  

Measured memory_bytes: 512
#include<stdio.h>
#define MAX 44

int makeFibonacci(int);

int main()
{
  int n;

  scanf("%d",&n);

  printf("%d\n",makeFibonacci(n));

  return 0;
}

int makeFibonacci(int n){

  int i,F[MAX];

  F[0] = 1;
  F[1] = 1;

  for(i = 2; i <= n; i++){
 
    F[i] = F[i-2] + F[i-1];
  }

  return F[n];
}

Measured memory_bytes: 596
n=gets.to_i
h=gets.split.map(&:to_i)
#大きい数をとりあえずおいておく
INF=10000000

#題よりとりあえず大きい値をdpテーブルに入れる(箱のサイズはとりあえず大きくしておく)
dp=Array.new(n,INF)


#初期条件
dp[0]=0

#ループ
for i in 1..n-1
    if i==1
        dp[i]=(h[i]-h[i-1]).abs
    elsif i>1
        dp[i]=[dp[i-2]+(h[i-2]-h[i]).abs,dp[i-1]+(h[i-1]-h[i]).abs].min
    end
    
end
p dp[-1]


Measured memory_bytes: 20968
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( stdin . lock ( ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[allow(unused_macros)]
macro_rules ! for_ { ( $ init : stmt ; $ cond : expr ; $ incr : expr , $ body : block ) => { $ init ; while $ cond { $ body $ incr ; } } ; }

fn main() {
    input! {
        n: usize,
        a: [u64; n]
    }

    let mut b = vec![0;n];
    for i in 0..n {
        let j = n-i;
        let mut sum = 0;
        for_!(let mut k = j; k <= n; k += j, {
            sum += b[k-1];
        });
        if sum % 2 != a[j-1] {
            b[j-1] = 1;
        }
    }
    let mut m = 0;
    let mut ret = vec![];
    for i in 0..n {
        if b[i] > 0 {
            m += 1;
            ret.push(i+1);
        }
    }
    println!("{}", m);
    if m > 0 {
        println!("{}", join(&ret, " "));
    }
}

#[allow(dead_code, deprecated)]
fn join<T: std::fmt::Display>(slice: &[T], sep: &str) -> String {
    let strings = slice.iter().map(|t| format!("{}", t)).collect::<Vec<_>>();
    strings.connect(sep)
}

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

int main() {
    int N;
    cin >> N;
    vector<int> lie(N);

    rep(i, N) {
        cin >> lie[i];
    }

    int zuida = lie[0];
    long long ans = 0;

    rep(i, N - 1) {
        if(lie[i] < lie[i + 1]) {
            zuida = lie[i + 1];
        }
        if(lie[i] > lie[i + 1]) {
            ans += zuida - lie[i + 1];
            lie[i + 1] += zuida - lie[i + 1];
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 4012
#include<iostream>

int N;
int A[210];

int main(){
    std::cin>>N;
    for (int i =0; i<N; ++i){
        std::cin>>A[i];
    }
    int res = 0;
    while(true){
        bool exist_odd = false; 
        for(int i = 0; i<N;++i){
            if(A[i]%2 !=0){
                exist_odd = true;
            }
        }
        if(exist_odd) break;
        for(int i = 0; i<N;++i){
            A[i] /=2;
        }
        ++res;
    }
    std::cout<<res<<std::endl;
}


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

using namespace std;
#define intMax 2147483647
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repp(i, a, b) for (int i = a; i >= b; i--)
#define be(a) (a.begin(), a.end())
#define rbe(p) (p.rbegin(), p.rend())
#define pb push_back

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, m;
    cin >> n >> m;
    map<int, pair<int, int>> A;
    int ans = 0 , ans1 = 0;
    rep(i, 0, m)
    {
        int a;
        cin >> a;
        string b;
        cin >> b;
        if (b == "AC")
        {
            if (A[a].first == 0)
            {
                ans++;
                A[a].first = 1;
                A[a].second++;
            }
        }
        else if (A[a].first == 0)
        {
            ans1++;
            A[a].second++;
        }
    }
    rep(i,1,n+1){
        if ( A[i].first == 0 ){
            ans1 -= A[i].second;
        }
    }
    cout << ans << " "<< ans1;
}

Measured memory_bytes: 6528
import sys
from collections import deque
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    H, W = read_values()
    F = [input().strip() for _ in range(H)]
    A = [False] * (H * W)
    Q = deque() 

    for h in range(H):
        for w in range(W):
            if F[h][w] == "#":
                Q.append((h, w, 0))
                A[h * W + w] = True

    res = V(max)
    while Q:
        h, w, d = Q.popleft()
        res.ud(d)

        for hh, ww in ((h + 1, w), (h - 1, w), (h, w + 1), (h, w - 1)):
            if 0 <= hh < H and 0 <= ww < W:
                if A[hh * W + ww]:
                    continue
                Q.append((hh, ww, d + 1))
                A[hh * W + ww] = True
    
    print(res)


if __name__ == "__main__":
    main()


Measured memory_bytes: 184528
#include <stdio.h>

int main(int argc, char const *argv[])
{
  int a, b;
  if (scanf("%d %d", &a, &b) == -1) return -1;
  int c = a - b * 2;
  printf("%d\n", c < 1 ? 0 : c);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	auto powll = [&](int n, int k){
		ll res = 1;
		for(; k; k--) res *= n;
		return res;
	};
	
	int n, k; cin >> n >> k;
	ll ans = powll(n / k, 3);
	if(k % 2 == 0){
		ans += powll((n + k / 2) / k, 3);
	}
	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 vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, a, b) for (ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())
#define PRINT(V) for (auto v:(V)) {cerr << v << " ";} cerr << endl
#define dump(x) cerr << #x << " : " << (x) << endl
#define dump2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){return b ? GCD(b, a % b) : a;}
inline ll LCM(ll a, ll b){return a / GCD(a, b) * b;}
inline ll powint(ll x, ll y){ll r=1;while(y){if(y&1)r*=x;x*=x;y>>=1;}return r;}
inline ll powmod(ll x, ll y, ll m = MOD){ll r=1;while(y){if(y&1)r*=x;x*=x;r%=m;x%=m;y>>=1;}return r;}
/* END OF TEMPLATE */

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n;
    cin >> n;
    string s;
    cin >> s;
    if(count(ALL(s), 'R') > count(ALL(s), 'B')){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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

typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007;

int main(){
    
    string S;cin>>S;
    int N=S.size();
    
    if(N%2==0){
        int x=N/2;
        for(int i=1;i<N;i++){
            if(S[i]!=S[i-1]){
                x=min(x,abs(N/2-i));
            }
        }
        cout<<N/2+x<<endl;
    }else{
        /*int x=N/2;
        for(int i=1;i<N;i++){
            if(S[i]!=S[i-1]){
                x=min(x,abs(N/2+1-i));
            }
        }
        cout<<N/2+1+x<<endl;*/
        char a=S[N/2-1],b=S[N/2+1],c=S[N/2];
        int cnt1=0,cnt2=0;
        for(int i=N/2-1;i>=0;i--){
            if(S[i]==a) cnt1++;
            else break;
        }
        for(int i=N/2+1;i<N;i++){
            if(S[i]==b) cnt2++;
            else break;
        }
        if(a!=c||b!=c) cout<<N/2+1<<endl;
        else cout<<N/2+1+min(cnt1,cnt2)<<endl;
    }
}


Measured memory_bytes: 512
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, c, d; cin>>a>>b>>c>>d;

    if(a == c) cout << 0 << endl;
    else cout << 1 << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int vecc[50];
  int vecv[50];
  
  int N;
  int max;
  
  max=0;
  
  cin >> N;
  
  for(int i=0;i<N;i++){
    cin >> vecv[i];
  }
  for(int j=0;j<N;j++){
    cin >> vecc[j];
    
    if(vecv[j]>vecc[j])
      max+=vecv[j]-vecc[j];
  }
  
  cout << max << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n;i>=0;i--)
#define For(i,m,n) for(int i=m;i<n;i++)
#define Forr(i,m,n) for(int i=m;i>n;i--)
#define Sort(a) sort(a.begin(),a.end())
#define pb push_back
#define vl vector<ll>
#define vll vector<vector<ll>>
#define INF 999999999999

int main(){
  int A,B;
  cin>>A>>B;
  cout<<max({A*B,A+B,A-B})<<endl;
return 0;
}


Measured memory_bytes: 256
s = input()
n = len(s)
num = int((n-1)/2)-1
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
num = int(num /2 -1)
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()

num = int(len(s) * 0.5 - 1.5)
index = int((n + 3) /2 -1 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("No")
    exit()
   
  
print("Yes")

    

    
    

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    int a[3] = {A, B, C};
    sort(a, a + 3, greater<int>());
    int ans = 10 * a[0] + a[1] + a[2];
    cout << ans << endl;
   
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(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 tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    cin >> n;
    if(n%2 == 0) {
        if(n >= 6) cout << 4*(n/2) << endl;
        else cout << 4*(n/2-1) << endl;
        vp v;
        rep(i,n/2) v.eb(i+1,n-i);
        rep(i,v.size()-1) {
            cout << v[i].first << " " << v[i+1].first << endl;
            cout << v[i].first << " " << v[i+1].second << endl;
            cout << v[i].second << " " << v[i+1].first << endl;
            cout << v[i].second << " " << v[i+1].second << endl;
        }
        if(n >= 6) {
            cout << v[v.size()-1].first << " " << v[0].first << endl;
            cout << v[v.size()-1].first << " " << v[0].second << endl;
            cout << v[v.size()-1].second << " " << v[0].first << endl;
            cout << v[v.size()-1].second << " " << v[0].second << endl;
        }
    } else {
        n--;
        if(n >= 4) cout << 4*(n/2-1)+4 << endl;
        else cout << 4*(n/2-1)+2 << endl;
        vp v;
        rep(i,n/2) v.eb(i+1,n-i);
        rep(i,v.size()-1) {
            cout << v[i].first << " " << v[i+1].first << endl;
            cout << v[i].first << " " << v[i+1].second << endl;
            cout << v[i].second << " " << v[i+1].first << endl;
            cout << v[i].second << " " << v[i+1].second << endl;
        }
        cout << 1 << " " << n+1 << endl;
        cout << n << " " << n+1 << endl;
        if(n >= 4) {
            cout << n/2 << " " << n+1 << endl;
            cout << n/2+1 << " " << n+1 << endl;
        }
    }
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int w,h;
    
    while(1){
        scanf("%d %d",&w,&h);
        
        if(w==0&&h==0){
            break;
        }
        for(int y=1;y<=w;y++){
            for(int x=1;x<=h;x++){
//                if(x==1 && y==1){
//                    printf("#");
//                }
                 if((x%2==0 && y%2==0) ||(x%2==1 && y%2==1)  ){
                    printf("#");
                }else{
                    printf(".");
                }
            }
            printf("\n");
            
        }
        
        printf("\n");
        
    }
    return 0;
}


Measured memory_bytes: 2104
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<tuple>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
#define mp(a1,a2) make_pair(a1,a2)
#define YMAX 250001
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	int D[200001],T[200001];
	map<int,int> mondai;
	int M;
	scan(N);
	rep(i,N){
		scan(D[i]);
		mondai[D[i]]++;
	}
	scan(M);
	int flag=1;
	rep(i,M){
		scan(T[i]);
		if(mondai[T[i]]>=1){
			mondai[T[i]]--;
		}
		else{
			flag=0;
		}
	}
	if(flag) prin("YES");
	else prin("NO");
	return 0;
}


Measured memory_bytes: 11136
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vd = vector<double>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vii = vector<pair<int, int>>;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
ll LCM(ll a, ll b) { return (a * b) / GCD(a, b); }
int round_int(int a, int b) { return (a + (b - 1)) / b; }

constexpr array<int, 9> dx = { 0, 1, 0, -1, -1, 1, 1, -1, 0 };
constexpr array<int, 9> dy = { 1, 0, -1, 0, 1, 1, -1, -1, 0 };
constexpr auto MAX = 100010;

// ──────────────────────────────────────────────────────────────────────────────

int main() {
	int n;
	cin >> n;
	vi p(n), q(n);
	rep(i, n) cin >> p[i];
	rep(i, n) cin >> q[i];

	vi p_sorted = p, q_sorted = q;
	sort(ASC(p_sorted));
	sort(ASC(q_sorted));

	int i = 0;
	do {
		i++;
		if (p_sorted == p) {
			break;
		}
	} while (next_permutation(ASC(p_sorted)));

	int j = 0;
	do {
		j++;
		if (q_sorted == q) {
			break;
		}
	} while (next_permutation(ASC(q_sorted)));
	cout << abs(i - j) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<math.h>
#include<time.h>
#include<stack>

using namespace std;
#define INF 1000000007

#define LINF (1LL << 62)

typedef long long i64;
typedef pair<i64,i64> P;


i64 a,b,c;

int main(){
	cin >> a >> b >> c;
	
	cout << max(a-c,0LL) << " " << max(min(a+b-c, b), 0LL) << endl;
	
	return 0;
}

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

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            var lr = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
            int l = lr[0], r = lr[1];
            if (r - l >= 2018) Console.WriteLine(0);
            else
            {
                int[] du = new int[r - l + 1];
                for (int i = l; i <= r; i++)
                    du[i - l] = i % 2019;
                int kq = 2019;
                for (int i = 0; i < du.Length - 1; i++)
                    for (int j = i + 1; j < du.Length; j++)
                        kq = Math.Min(du[i] * du[j] % 2019, kq);
                Console.WriteLine(kq);
            }
        }
    }
}


Measured memory_bytes: 11204
<?php
list($N,$M,$X,$Y) = explode(" ",trim(fgets(STDIN)));
$x = explode(" ",trim(fgets(STDIN)));
$y = explode(" ",trim(fgets(STDIN)));
rsort ($x);
sort ($y);

$spotnum = 0;
for($Z=-100;$Z<=100;$Z++){
if ($x[0]<$Z and $Z<=$y[0]){
  $spot[] = $Z;
  $spotnum++;
}
}
if ($spotnum = 0){
  echo 'War';
  exit;
}

for ($i=0;$i<=$spotnum;$i++){
  if ($X<$spot[$i] and $spot[$i]<=$Y){
    echo 'No War';
    exit;
  }
}
echo 'War';


Measured memory_bytes: 3576
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <map>
using namespace std;

int MOD=1e9 + 7;

int main() {
    int N, M;
    long long ansX=0, ansY=0, ans;
    cin >> N >> M;
    for (int i = 0; i < N; i++) {
        long x;
        cin >> x;
        ansX += x*(2 * i - N + 1);
    }
    for (int i = 0; i < M; i++) {
        long y;
        cin >> y;
        ansY += y*(2 * i - M + 1);
    }
    ansX = abs(ansX) % MOD;
    ansY = abs(ansY) % MOD;
    
    ans = ansX*ansY%MOD;
    cout << ans;
    
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int h,m,s,n,ha;
	scanf("%d",&n);
	h=n/3600;
	ha=n%3600;
	m=ha/60;
	s=ha%60;
	printf("%d:%d:%d\n",h,m,s);
	return 0;
}

Measured memory_bytes: 592
from sys import stdin
input = stdin.readline

n = int(input())
flag = 0
a = []

for x in range(201):
    a.append(x ** 5)

for x in range(201):
    for y in range(201):
        if a[x] - a[y] == n:
            print(x, y)
            flag = 1
            break
        if a[x] + a[y] == n:
            print(x, -y)
            flag = 1
            break
        if -a[x] - a[y] == n:
            print(-x, y)
            flag = 1
            break
        if -a[x] + a[y] == n:
            print(-x, -y)
            flag = 1
            break

    if flag == 1:
        break

Measured memory_bytes: 9224
n = int(input())
w = list(map(int, input().split()))

s1 = 0
s2 = 0
dif = 0
ans = 1000000

for i in range(n):

    s1 = sum(w[:i+1])
    s2 = sum(w[i+1:])
    dif = abs(s1 - s2)


    #print("S1 : " + str(s1) + " S2 : " + str(s2) + " abs : " + str(dif))

    if ans > dif:
        ans = dif

    if ans < dif:
        break

    s1 = 0
    s2 = 0

print(ans)


Measured memory_bytes: 3064