akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef pair<int,int> P;

const int dice[7][4]={
  {},
  {5,4,2,3}, //1
  {6,3,1,4}, //2
  {5,1,2,6}, //3 
  {5,6,2,1}, //4
  {6,4,1,3}, //5
  {5,3,2,4}  //6
};
int ans[6];
int Fdice[6]; 
/*
0 -> top
1 -> front
2 -> right 
3 -> R-front
4 -> R-right
5 -> R-top
 */


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


P graph[500][500];//first -> roll, second -> height

void CreateFdiceForYou(int top,int front){
  int frontIsHere;
  rep(i,4){
    if(dice[top][i] == front){
      frontIsHere = i;
      break;
    }
  }

  Fdice[0] = top;
  Fdice[5] = 7-top;

  rep(i,4){
    if(frontIsHere == 4)frontIsHere = 0;
    Fdice[i+1] = dice[top][frontIsHere++];
  }
  /*
  rep(i,6){
    cout << i << "番目は" << Fdice[i] << endl;
  }
  */

}


void Display(){

  REP(i,240,260){
      REP(j,240,260){
	cout << graph[i][j].first<< " ";
      }
      cout << endl;
    }

}

int Boxing(int front,int dir){
  if(dir == 1){
    return 0;
  }
  if(dir == 2){
    return 1;
  }
  if(dir == 3){
    return 5;
  }
  if(dir == 4){
    return 1;

  }
}


void decideTheDestinyOfTheDice(int x,int y,int top,int front){
  P choice = P(-1,-1);
  int roll,Here;
  roll = Here = 0;
  CreateFdiceForYou(top,front);
  rep(i,4){
    P p = P(x+dx[i],y+dy[i]);
    if(graph[p.second][p.first].second < graph[y][x].second){
      if(Fdice[i+1] == 4 || Fdice[i+1] == 5 || Fdice[i+1] == 6){
	if(roll < Fdice[i+1]){
	  roll = Fdice[i+1];
	  Here = i+1;
	  choice = P(p.first,p.second);
	}
      }
    }
  }

  if(choice == P(-1,-1)){
    graph[y][x] = P(top,graph[y][x].second+1);
  }
  else{
    int dir = Boxing(front,Here);
    decideTheDestinyOfTheDice(choice.first,choice.second,7-roll,Fdice[dir]);
  }
  return;
}


int main(){
  int n,t,f;
  while(cin >> n && n){
    rep(i,500)rep(j,500)graph[i][j] = P(0,0);
    rep(i,6)ans[i] = 0;    

    rep(i,n){
      cin >> t >> f;
      decideTheDestinyOfTheDice(250,250,t,f);
    }

    REP(i,100,400){
      REP(j,100,400){
	if(graph[i][j].second != 0){
	  ans[graph[i][j].first-1]++;
	}
      }
    }

    rep(i,6){
      cout << ans[i];
      if(i != 5)cout << " ";
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3116
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>

#define REP(i,n) for(i=0;i<n;i++)

//prototype declaration
int iin();
long long llin();
double din();
char cin();
void stin(char *s);
void iout(int i);
void llout(long long i);
void dout(double i);
void cout(char c);
void stout(char *s);
int gcd(int a, int b);
int lcm(int a, int b);
long long llgcd(long long a, long long b);
long long lllcm(long long a, long long b);
int asc(const void *a, const void *b);
int desc(const void *a, const void *b);

//main function
int main() {
    int a = iin(), b = iin(), c = iin();
    stout((b - a) == (c - b) ? "YES" : "NO");
    return 0;
}

//body function
int iin() {
    int i;
    scanf("%d", &i);
    return i;
}

long long llin() {
    long long i;
    scanf("%lld", &i);
    return i;
}

double din() {
    double i;
    scanf("%lf", &i);
    return i;
}

char cin() {
    char c;
    scanf("%c", &c);
    return c;
}

void stin(char *s) {
    scanf("%s", s);
}

void iout(int i) {
    printf("%d\n", i);
}

void llout(long long i) {
    printf("%lld\n", i);
}

void dout(double i) {
    printf("%lf\n", i);
}

void cout(char c) {
    printf("%c\n", c);
}

void stout(char *s) {
    printf("%s\n", s);
}

/*
    int型の最大公約数
*/

int gcd(int a, int b) {
    int r;

    if (a < b) {
        r = a;
        a = b;
        b = r;
    }

    r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

/*
    int型の最小公倍数
*/

int lcm(int a, int b) {
    int r = llgcd(a, b);
    a /= r;
    return a * b;
}

/*
    long long型の最大公約数
*/

long long llgcd(long long a, long long b) {
    long long r;

    if (a < b) {
        r = a;
        a = b;
        b = r;
    }

    r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

/*
    long long型の最小公倍数
*/

long long lllcm(long long a, long long b) {
    long long r = llgcd(a, b);
    a /= r;
    return a * b;
}

/*
    int型の昇順用比較関数
*/

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

/*
    int型の降順用比較関数
*/

int desc(const void *a, const void *b) {
    return *(int *)b - *(int *)a;
}


Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
typedef long long LL;
int n;
LL ans;
char s[40];
map<pair<string, string>, LL>cnt;
int main() {
	scanf("%d", &n);
	scanf("%s", s);
	string s1, s2;
	for(int i = 0; i < (1 << n); i++) {
		s1 = s2 = "";
		for(int j = 0; j < n; j++) {
			if(i & (1 << j))s1 += s[j];
			else s2 += s[j];
		}
		cnt[make_pair(s1, s2)]++;
	}
	for(int i = 0; i < (1 << n); i++) {
		s1 = s2 = "";
		for(int j = 0; j < n; j++) {
			if(i & (1 << j))s1 += s[2 * n - j - 1];
			else s2 += s[2 * n - j - 1];
		}
		ans += cnt[make_pair(s1, s2)];
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 91904
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<utility>
#include<queue>
#include<cmath>
#include<cstdio>
#include <iomanip>
#include <limits>

using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define REP1(i,b,a) for(i=b-1;i>=a;i--)
#define output(x) cout<<x<<endl;
#define pb(x) push_back(x);
typedef long long int ll;
typedef pair<ll, ll > P;
const int MOD = 1000000007;


int main() {
	ll i, j, k, l, m, n, sum, flag, cc, M, X, H, W, N,Y,Z,K;
	cc = 0;
	flag = 0;
	char S[200009];
	cin >> N;
	cin >> S;
	int kuro[200009] = {};
	int shiro[200009] = {};
	if (S[0] == '.') {
		shiro[0] = 1;
	}
	else {
		kuro[0] = 1;
	}
	REP(i, 1, N) {
		if (S[i] == '.') {
			shiro[i] = shiro[i - 1] + 1;
			kuro[i] = kuro[i - 1];
		}
		else {
			shiro[i] = shiro[i - 1];
			kuro[i] = kuro[i - 1]+1;
		}
	}

	ll kosu[200009];
	REP(i, 0, 200009) {
		kosu[i] = 100000000;
	}
	kosu[0] = shiro[N - 1];
	REP(i, 1, N) {
		kosu[i] = kuro[i - 1] + shiro[N - 1] - shiro[i - 1];
	}
  kosu[N]=kuro[N-1];
	sort(kosu, kosu + N+1);
	output(kosu[0]);
	return 0;
}





Measured memory_bytes: 4092
#include <iostream>
#include <queue>
using namespace std;
int main(void){
    int n,a[300000];
    long long b=0,c[100001],d;
    priority_queue<int,vector<int>,greater<int>> p;
    priority_queue<int> q;
    cin>>n;
    c[n]=0;
    for(int i=0;i<n*3;i++){
        cin>>a[i];
        if(i<n){
            p.push(a[i]);
            b+=a[i];
        }else if(i>=n*2){
            q.push(a[i]);
            c[n]+=a[i];
        }
    }
    for(int i=n-1;i>=0;i--){
        c[i]=c[i+1];
        if(a[n+i]<q.top()){
            c[i]+=a[n+i]-q.top();
            q.pop();
            q.push(a[n+i]);
        }
    }
    d=b-c[0];
    for(int i=n;i<n*2;i++){
        if(a[i]>p.top()){
            b+=a[i]-p.top();
            p.pop();
            p.push(a[i]);
        }
        d=max(d,b-c[i+1-n]);
    }
    cout<<d<<endl;
}


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef long double ld;
 
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    ll a,b;
    cin >> a >> b;
    if ((a+b) % 2 == 0){
        cout << (a+b)/2 << endl;
    } else {
        cout << "IMPOSSIBLE" << endl;
    }
}


Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
using namespace std;
namespace Solve
{
	const int MAXN=105;
	int N,A[MAXN];
	void work()
	{
		scanf("%d",&N);
		for(int i=1;i<=N;i++) scanf("%d",&A[i]);
		int pos=1,mi=0;
		for(int i=1;i<=N;i++)
			mi+=(A[i]-1)*(A[i]-1);
		for(int i=2;i<=100;i++)
		{
			int temp=0;
			for(int j=1;j<=N;j++)
				temp+=(A[j]-i)*(A[j]-i);
			if(temp<mi)
				mi=temp,pos=i;
		}
		printf("%d\n",mi);
		return;
	}
}
int main()
{
	#ifdef LOCAL
	freopen("00test.in","r",stdin);
	freopen("00test.out","w",stdout);
	#endif
	Solve::work(); 
	return 0;
}

Measured memory_bytes: 256
A,B,C = input().split()
A = int(A)
B = int(B)
C = int(C)
if A == 5 and B == 5 and C == 7:
    print('YES')
elif A == 5 and B == 7 and C == 5:
    print('YES')
elif A == 7 and B == 5 and C == 5:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 2940
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::string s){
    ll cntR=0;
    REP(i, s.length()){
        if(s[i]=='R')
            cntR++;
    }
    cout<< (cntR > (s.length()-cntR)? YES: NO)<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::string s;
    std::cin >> s;
    solve(N, s);
    return 0;
}


Measured memory_bytes: 256
from collections import Counter

N = int(input())
N_list = list(str(N))
number = ['3', '5', '7']
count = 0

def iter_p_adic(p, n):
    from itertools import product
    tmp = [range(p)] * n
    return product(*tmp)

for i in range(len(N_list)):
    iterator = iter_p_adic(3, i+1)
    for idxs in iterator:
        num = []
        for j in range(i+1):
            num.append(number[idxs[j]])
        n = int(''.join(num))
        if len(list(Counter(num))) == 3 and n <= N:
            count += 1

print(count)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int X;
  cin >> X;
  srep(k,3,1000000) {
    if(180*(k-2)%360==k*(180-X)%360) {
      cout << k << endl;
      return 0;
    } 
  }
  return 0;
}

Measured memory_bytes: 3632
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

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

int main()
{
        //input->compute->output//
        int A, B, C;
        cin >> A >> B >> C;

        
                cout << (A+B)*C/2 << endl;
        

        return 0;
}


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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl


const int inf = 1e9;
template<typename T> struct segtree {
    
    T merge(T x, T y) {
	return min(x,y);
    }
    int n;
    vector<int> t;
    void init(int n) {
	n += 10;
	this->n = n;
	t.resize(n*4);
    }
 
    void build(int v, int tl, int tr) {
	if (tl==tr) {
	    t[v] = inf;
	} else {
	    int tm = (tl+tr)/2;
	    build(2*v,tl,tm);
	    build(2*v+1,tm+1,tr);
	    t[v] = merge(t[2*v], t[2*v+1]);
	}
    }
 
    void upd(int v, int tl, int tr, int i, T dx) {
	if (tl == tr) {
	    t[v] = merge(t[v], dx);
	} else {
	    int tm = (tl+tr)/2;
	    if (i<=tm) {
		upd(2*v,tl,tm,i,dx);
	    } else {
		upd(2*v+1,tm+1,tr,i,dx);
	    }
	    t[v] = merge(t[2*v], t[2*v+1]);
	}
    }
 
    T qry(int v, int tl, int tr, int l, int r) {
	if (l>tr || r<tl) {
	    return inf;
	}
	if (l <= tl && tr <= r) {
	    return t[v];
	}
	int tm = (tl+tr)/2;
	return merge(qry(2*v,tl,tm,l,r), qry(2*v+1,tm+1,tr,l,r));
    }
};



const int maxn = 1e6 + 5;


int n;
int b[maxn];
vector<int> iv[maxn];

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

    cin>>n;
    int b0=0;
    
    for (int i=0; i<n; i++) {
	cin>>b[i];
	if (b[i]==0) {
	    b0++;
	    b[i]=-1;
	}
    }

    segtree<int> t;
    t.init(n+10);
    t.build(1,1,n+1);


    int q; cin>>q;
    while (q--) {
	int l,r;
	cin>>l>>r;
	--l;
	// [l,r)
	iv[l].push_back(r);
    }

    // dp[i]: min penalty considering first i terms of b.
    auto qry = [&](int l, int r) {
	return t.qry(1,1,n+1,l+1,r+1);
    };


    auto upd = [&](int i, int val) {
	t.upd(1,1,n+1,i+1,val);
    };

    for (int i=0; i<=n; i++) {
	if (i>0) {
	    upd(i, qry(i-1,i-1) + b[i-1]);
	} else {
	    upd(i, 0);
	}

	for (int r: iv[i]) {
	    upd(r, qry(i,r-1));
	}
    }

    int res = b0+qry(n,n);
    cout<<res<<endl;
    
    
    return 0;
}


Measured memory_bytes: 34552
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
// numeric_limits<int>::max()
// cout << setprecision(20) << double << endl;

int main(void)
{
    int A, B;
    cin >> A >> B;
    if (A <= 5)
        cout << 0 << endl;
    else if (A <= 12)
        cout << B/2 << endl;
    else
        cout << B << endl;
    return 0;
}


Measured memory_bytes: 256
function Main(input) {
    var tmp = input.split("\n");
    var first = tmp[0].split(" ");
    var A = tmp[1].split(" ");

    var N = parseInt(first[0],10);
    var M = parseInt(first[1],10);

    var sum =0;

    for(var i=0;i<A.length;i++){
        sum = sum + parseInt(A[i],10);
    }

    //console.log(N+"日間夏休み");
    //console.log(M+"個の宿題");
    //console.log(A);
    //console.log(sum);

   
    if(sum <= N){
        console.log(N-sum);
    }else{
        console.log(-1);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 30688
n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

def search(lst, n, val):
    for i in range(n):
        if lst[i] == val:
            return True
    return False

ans = 0
for i in range(q):
    if search(s, n, t[i]):
        ans += 1

print(ans)



Measured memory_bytes: 6548
/*
 * PictureFrame.cpp
 *
 *  Created on: 2020/03/01
 *      Author: black
 */
#include <iostream>
using namespace std;
int main(){
	int h, w;
	cin >> h >> w;

	char *moji = new char[h*w];

	for (int i = 0; i < h; ++i){
		for (int j = 0; j < w; ++j){
			cin >> moji[i*w+j];
		}
	}

	for (int i = 0; i < w+2; ++i){
		cout << "#";
	}
	cout << "\n";

	for (int i = 0; i < h; ++i){
		cout << "#";
		for (int j = 0; j < w; ++j){
			cout << moji[i*w+j];
		}
		cout << "#" << endl;
	}
	for (int i = 0; i < w+2; ++i){
		cout << "#";
	}

	return 0;
}





Measured memory_bytes: 256
#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()
#define endl "\n"

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; }
typedef long long ll;

const double PI=3.14159265358979323846;
void solve() {
    double d;
    cin >> d;
    cout <<fixed << setprecision(10)  <<  d*2*PI << endl;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 3788
def mat_dot(A, B, mod):
    assert len(A[0]) == len(B), 'invalid_size'
    
    L = len(A)
    M = len(A[0])
    N = len(B[0])
    
    res = [[0]*N for _ in range(L)]
    
    for i in range(L):
        for j in range(N):
            a = 0
            for k in range(M):
                a = (a+A[i][k]*B[k][j]) % mod
            res[i][j] = a
            
    return res

def mat_pow(A, x, mod):
    N = len(A)
    res = [[0]*N for _ in range(N)]
    for i in range(N):
        res[i][i] = 1
    for i in range(x.bit_length()):
        if 2**i & x:
            res = mat_dot(res, A, mod)
        A = mat_dot(A, A, mod)
    return res
      
L, A, B, M = map(int, input().split())

pre = -1
S = []
for k in range(50):
    if len(str(A)) > k+1:
        continue
    j = -((A - 10**(k+1))//B) - 1
    j = min(j, L-1)
    j = j - pre
    pre += j
    if j:
        S.append((j, k+1))

Ans = [[0], [A], [1]]
for p, k in S:
    cmat = [[pow(10, k, M), 1, 0], [0, 1, B], [0, 0, 1]]
    
    Ans = mat_dot(mat_pow(cmat, p, M), Ans, M)
print(Ans[0][0])

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

int main(){
  int N, X;
  cin >> N >> X;
  vector<int> candy(N);
  for(int i = 0; i < N; i++){
    cin >> candy[i];
  }
  sort(candy.begin(), candy.end());
  int i = 0;
  while(i < N - 1){
    if(X >= candy[i]){
      X -= candy[i];
      i++;
    }else{
      break;
    }
 }
 if(i == N - 1 && X == candy[i])i++;
 cout << i << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    int a,b;
    fscanf(stdin, "%d %d", &a, &b);
    printf("%s\n", (a & 1) == 0 || (b & 1) == 0 ? "Even" : "Odd");
    return 0;
}


Measured memory_bytes: 128
//Built by Sabuj Jana(greenindia) from Jadavpur University,Kolkata,India 
// God is Great------------/////\\\\\\\--------------------------------
 #include <bits/stdc++.h>
 using namespace std;
 #define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
 #define endl "\n"
 // #define INF LLONG_M
 #define pb push_back
 #define mp make_pair
 const int INF=1e9+5; //billion
 typedef vector<int> vi;
 typedef long long ll;
 
 	 
 int main() {
 	 
    crap;
     
     int n;cin>>n;  int k;cin>>k;           
     vi arr(n);
     for(int& x:arr) cin>>x;
		//~ for(int x:arr) cout<<x;
	vi dp(n,INF);
	dp[0]=0;
	
	for(int i=0; i<n; i++){
		
		for(int j=i+1; j<=i+k;j++){
			
			if(j<n)
				dp[j]= min( dp[j], dp[i]+ abs(arr[i]-arr[j]));
			
			
		}
		
		
		
	}	
		
		
      cout<<dp[n-1];
      
    return 0;
 }



Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli > plli;
typedef vector<lli> vlli;
typedef vector<plli > vplli;

#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lcm(a, b) ((a * b) / gcd(a, b))
#define sqr(x) (x)*(x)
#define all(a) a.begin(),a.end()
#define UN(v) sort(all(v)), v.resize(unique(all(v))-v.begin())

#define endl '\n'

const long long INF = 100000000000000000;
const long long MOD = 1000000007;
const long long MAXN = 100005;

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

lli gcd(lli a , lli b) {
    if(b == 0) return a;
    a %= b;
    return gcd(b,a);
}

void solve() {
    lli n;
    cin >> n;
    lli odds = ((n + (n & 1)) / 2);
    double chance = (double)odds / n;
    cout << fixed << setprecision(6) << chance << endl;
}

int main()
{
    IOS;
    //comment it out
    //freopen("input.txt", "r", stdin);
    lli t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
program o_rand_
  implicit none
  integer :: n, k, s, t, a(50) = 0, b(50) = 0, m = 0, f(0:262143) = 0, i, j, p
  integer(8) :: c(0:50, 0:50) = 0, g(0:50) = 0, x = 0, y
  read(*,*) n, k, s, t
  read(*,*) a(1:n)
  do i = 1, n
    if (and(a(i), s) /= s .or. and(a(i), t) /= a(i)) cycle
    m = m + 1
    b(m) = xor(a(i), s)
  end do
  c(0, 0) = 1
  do i = 1, m
    c(i, 0) = 1
    do j = 1, i
      c(i, j) = c(i - 1, j) + c(i - 1, j - 1)
    end do
    g(i) = sum(c(i, 1:k))
  end do
  s = xor(s, t)
  i = s
  do
    do j = 1, m
      p = and(b(j), i)
      f(p) = f(p) + 1
    end do
    y = 0
    do j = 1, m
      p = and(b(j), i)
      y = y + g(f(p))
      f(p) = 0
    end do
    x = x + y * merge(-1, 1, btest(popcnt(i), 0))
    if (i == 0) exit
    i = and(i - 1, s)
  end do
  write(*,'(i0)') x
end program o_rand_

Measured memory_bytes: 3856
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int M = 1e9 + 7, N = 1e6 + 5;
int parent[N], sz[N], vis[N];
void make_set(int v){
    parent[v] = v;
    sz[v] = 1;
}
int find_set(int v){
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b){
    a = find_set(a);
    b = find_set(b);
    if (a != b){
        if (sz[a] < sz[b]) swap(a, b);
        parent[b] = a;
        sz[a] += sz[b];
    }
}
 
int32_t main(){
    IOS;
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) make_set(i);
    for (int i = 0; i < m; i++){
        int x, y;
        cin >> x >> y;
        union_sets(x, y);
    }
    for (int i = 1; i <= n; i++) vis[find_set(i)]++;
    int ans = 0;
    for (int i = 1; i <= n; i++) ans = max(ans, vis[i]);
    cout << ans << endl;
}

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

const int N = 1e5 + 5;
const int K = 1e3 + 5;

int n, k;
int w[2][K][K], b[2][K][K];
int ans;

int get(int a[][K], int x0, int y0, int x1, int y1) {
	++x0; ++y0; ++x1; ++y1;
	return a[x1][y1] - a[x0 - 1][y1] - a[x1][y0 - 1] + a[x0 - 1][y0 - 1];
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n >> k;
	for (int i = 1; i <= n; ++i) {
		int x, y; char c; cin >> x >> y >> c;
		int where = ((x / k) + (y / k)) % 2;

		if (c == 'W') w[where][x % k + 1][y % k + 1]++;
		else b[where][x % k + 1][y % k + 1]++;
	}

	for (int id = 0; id <= 1; ++id) {
		for (int i = 1; i <= k; ++i) {
			for (int j = 1; j <= k; ++j) {
				w[id][i][j] += w[id][i - 1][j] + w[id][i][j - 1] - w[id][i - 1][j - 1];
				b[id][i][j] += b[id][i - 1][j] + b[id][i][j - 1] - b[id][i - 1][j - 1];
			}
		}
	}

	for (int inter = 0; inter <= 1; ++inter) { // intersect
		for (int i = 0; i < k; ++i) {
			for (int j = 0; j < k; ++j) {
				// white
				int white = get(w[inter], 0, 0, i, j) + get(w[inter ^ 1], 0, j + 1, i, k - 1) + get(w[inter], i + 1, j + 1, k - 1, k - 1) + get(w[inter ^ 1], i + 1, 0, k - 1, j);
				// black
				int black = get(b[inter ^ 1], 0, 0, i, j) + get(b[inter], 0, j + 1, i, k - 1) + get(b[inter ^ 1], i + 1, j + 1, k - 1, k - 1) + get(b[inter], i + 1, 0, k - 1, j);
				// solve
				ans = max(ans, white + black);
			}
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 16000
def main():
    N =int(input())
    A =list(map(int,input().split()))
    if 0 in A:
        print(0)
        return
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
    print(prod)
main()

Measured memory_bytes: 21648
#include <iostream>
#include <string>

using namespace std;
typedef long long ll;

int main(){
    string s;cin >> s;
    int l = s.size();
    ll ans = 0;
    for(int i=0;i<(1<<(l-1));i++){
        ll tot = 0;
        for(int j=0;j<l;j++){
            tot *= 10;
            tot += s[j] -'0';
            if(!(i&(1<<j))){
                ans += tot;
                tot = 0;
            }
        }
        ans += tot;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int a[200010] = {},cnt[200010];
int main(){
    int i,j,l,n,k;
    cin >> n >> k;
    for(i=0;i<n;i++) cin >> a[i];
    for(i=0;i<min(k,200);i++){
        for(j=0;j<n;j++) cnt[j] = 0;
        for(j=0;j<n;j++){
            cnt[max(j - a[j],0)]++;
            cnt[min(j + a[j] + 1,n)]--;
        }
        for(j=0;j<n;j++){
            cnt[j + 1] += cnt[j];
        }
        for(j=0;j<n;j++){
            a[j] = cnt[j];
        }
    }
    for(i=0;i<n;i++){
        cout << a[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 5196
/**
 * ??????????????????????????¢

???????????????????????????????????????????????????????????????????????¢??§??¬???????????????????????????????????°???????????????????§?????????¨????????§????????????????????????????????§??????????????? n ?¬???????????????? x={x1,x2,...,xn} ??¨ y={y1,y2,...,yn} ????????¢????¨????????????????????????????

????????????????????????????????¢?????¬???????¨?????????¨?????¨??????????¬??????????????????????????????¢?????\?????????????????????
Dxy=(???i=1n|xi???yi|p)1p


p=1 ?????¨???

Dxy=|x1???y1|+|x2???y2|+...+|xn???yn|

??¨?????????????????????????????????????????¢??¨?????°????????????

p=2 ?????¨???

Dxy=(|x1???y1|)2+(|x2???y2|)2+...+(|xn???yn|)2???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

??¨???????????????????????¬?????????????????????????????????????????¢??????????????????

p=??? ?????¨???

Dxy=maxni=1(|xi???yi|)

??¨???????????????????????§????????§????????¢??¨?????°????????????

????????? n ?¬???????????????????????????????????????§???p ??????????????? 1???2???3?????? ?????????????????????????????¢????±???????????????°????????????????????????????????????

Input
??????????????´??° n ???????????????????????????????????????????????? x ???????´? {x1,x2,...xn}??????????????????????????? y ???????´? {y1,y2,...yn} ????????????????????§???????????????????????\?????????????????´??°?????§??????

Output
p ??????????????? 1???2???3?????? ??????????????????????????????????????¢??????????????????????????????????????????0.00001 ??\????????????????????£????????????????????¨????????????

Constraints
1???n???100
0???xi,yi???1000

Sample Input
3
1 2 3
2 0 4
Sample Output
4.000000
2.449490
2.154435
2.000000
 */

#include <iostream>
#include <sstream>
#include <valarray>
#include <iomanip>

int main(int argc, char const *argv[]) {
  std::string Param;
  std::istringstream iss;
  unsigned short n;
  double Manhattan, Euclidean, Chebyshev, D;

  getline(std::cin, Param);
  iss.str(Param);
  iss >> n;
  iss.clear();

  std::valarray<double> x((double)0, n);
  std::valarray<double> y((double)0, n);

  getline(std::cin, Param);
  iss.str(Param);
  for (size_t i = 0; i < n; i++) {
    int xi = 0;
    iss >> xi;
    x[i] = xi;
  }
  iss.clear();

  getline(std::cin, Param);
  iss.str(Param);
  for (size_t i = 0; i < n; i++) {
    int yi = 0;
    iss >> yi;
    y[i] = yi;
  }
  iss.clear();

  Manhattan = abs(x - y).sum();
  Euclidean = sqrt(pow(abs(x - y), 2).sum());
  D = cbrt(pow(abs(x - y), 3).sum());
  Chebyshev = abs(x - y).max();

  std::cout << std::fixed << std::setprecision(8);
  std::cout << Manhattan << std::endl;
  std::cout << Euclidean << std::endl;
  std::cout << D << std::endl;
  std::cout << Chebyshev << std::endl;

  return 0;
}

Measured memory_bytes: 3456
#include <iostream>

using namespace std;

int main()
{
    int sum;
    string s, days[7] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    cin >> s;
    for(int i=0 ; i<7 ; i++)
    {
        if (s == days[i])
        {
            sum = 7-i;
            break;
        }
    }
    cout << sum;
    return 0;
}


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

int main() {
    int n, m;
    cin>>n>>m;

    long long sum = 0;
    int temp;

    while(m--) {
        cin>>temp;
        sum += temp;
    }

    if(sum>n)
     cout<<"-1";
    else cout<<n-sum; 
}

Measured memory_bytes: 3168
r, c = map(int, input().split())

x = []
for _ in range(r):
    x.append(list(map(int, input().split())))

c_line_sum = []
for i in range(c): # 列の総和の計算
    t = []
    for j in range(r):
        t.append(x[j][i])
    c_line_sum.append(sum(t))

for i in range(r): # 行の総和の計算
    x[i].append(sum(x[i]))

c_line_sum.append(sum(c_line_sum))
x.append(c_line_sum)

for m in x:
    print(*m)


Measured memory_bytes: 6228
n = gets.to_i
h = [0, 0, 0]
c = 0

n.times do
    s = gets.chomp
    c += s.scan("AB").size
    
    if s[0] == "B" && s[-1] == "A"
        h[2] += 1
    elsif s[0] == "B"
        h[1] += 1
    elsif s[-1] == "A"
        h[0] += 1
    end
end

if h[2] > 0
    c += h[2] - 1
    if h[0] > 0 && h[1] > 0
        c += 1 + (h[0] < h[1] ? h[0] : h[1])
    elsif h[0] > 0 || h[1] > 0
        c += 1
    end
else
    c += h[0] < h[1] ? h[0] : h[1]
end

puts c

Measured memory_bytes: 1788
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// スペース区切りの整数の入力
		if(a<1200){
		// 出力
		System.out.println("ABC");
}else{System.out.println("ARC");}
	}
}

Measured memory_bytes: 9172
#include <bits/stdc++.h>
#define RI register int
typedef long long LL;

#define FILEIO(name) freopen(name".in", "r", stdin), freopen(name".out", "w", stdout);

using namespace std;

char buf[1000000], *p1 = buf, *p2 = buf;
inline char gc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
  return p1 == p2 ? EOF : *(p1++);
}
template <class T> inline void read(T &n) {
  n = 0; RI ch = gc(), f;
  while ((ch < '0' || ch > '9') && (ch != '-')) ch = gc();
  f = (ch == '-' ? ch = gc(), -1 : 1);
  while (ch >= '0' && ch <= '9') n = n * 10 + (ch ^ 48), ch = gc();
  n *= f;
}

int a[505][505];

int main() {

#ifdef LOCAL
  FILEIO("a");
#endif

  int k, n; read(k);
  if (k <= 500) {
    n = k;
    for (RI i = 1; i <= n; ++i)
      for (RI j = 1; j <= n; ++j)
        a[i][j] = i;
  }
  else {
    n = 500;
    for (RI i = 1; i <= n; ++i)
      for (RI j = 1; j <= n; ++j)
        a[j][(i + j - 1) % n + 1] = i + 500 * ((j & 1) && i + 500 <= k);
  }
  printf("%d\n", n);
  for (RI i = 1; i <= n; ++i, puts(""))
    for (RI j = 1; j <= n; ++j)
      printf("%d ", a[i][j]);

  cerr << (double)(clock()) / CLOCKS_PER_SEC * 1000 << "ms" << endl;

  return 0;
}

// created by Daniel yuan

Measured memory_bytes: 2176
// Last Change: 03/26/2019 23:50:37.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

int main() {
  ll a, b, diff;
  cin >> a >> b;
  diff = b - a;

  ll hight = 0;
  for (ll i = 0; i < diff; ++i) {
    hight += i;
  }

  cout << hight - a << endl;

  //NS::LoopUntilZeroInpput();
}


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

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

    vector<ll> a(n + 1);
    rep(i, n) cin >> a[i];
    a[n] = 0;

    pint ms(1000, 0);
    rep(i, n)
    {
        if (a[i] <= a[i + 1])
        {
            ll num = ms.first / a[i];
            ms.second += num;
            ms.first -= num * a[i];
        }
        else
        {
            ms.first += a[i] * ms.second;
            ms.second = 0;
        }
    }
    cout << ms.first << endl;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;

int main(){
  ll n;
  cin >> n;

  vector<pair<ll, int>> vec;
  for (ll i=2; i*i<=n; i++){
    int x = 0;
    while (n % i == 0){
      n /= i;
      x++;
    }
    if (x != 0) vec.emplace_back(i, x);
  }
  if (n != 1) vec.emplace_back(n, 1);

  int ans = 0;
  for (auto ele : vec){
    int x = ele.second;
    int b = 1;
    while (b <= x){
      x -= b;
      b++;
      ans++;
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3636
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			boolean f[] = new boolean[105];
			int c = 0;
			for(;;) {
				int a = sc.nextInt(), b = sc.nextInt();
				if( (a|b) == 0 ) break;
				f[a] = !f[a]; f[b] = !f[b]; c += f[a]? 1: -1; c += f[b]? 1: -1;
			}
			System.out.println((c == 2 && (f[1]&f[2])? "OK": "NG"));
		}
	}
}

Measured memory_bytes: 12000
N = int(input())
a = []
a = input().split(' ')
a = [int(i) for i in a]
a = sorted(a, reverse=True)
Alice = 0
Bob = 0
for i in range(N):
  if i == 0:
    Alice += a[i]
  elif i%2 == 0:
    Alice += a[i]
  elif i%2 == 1:
    Bob += a[i]

print(Alice - Bob)

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

int Euclid(int a, int b){
  if (a<b) Euclid(b,a);
  if (b==0) return a;

  return Euclid(b, a%b);
}

int main(){
  int a, b; cin >> a >> b;
  
  cout << Euclid(a,b) << endl; 

  return 0;
}

 


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

typedef long long ll;
const ll INF=1e12;
using namespace std;
int main()
{
	string s1,s2;cin>>s1>>s2;
	vector< vector<ll> > dp(1001,vector<ll>(1001,0));
	int len1=s1.length(),len2=s2.length();
	
	for(int i=1;i<=len1;i++) dp[i][0]=i;
	for(int j=1;j<=len2;j++) dp[0][j]=j;
	for(int  i=1;i<=len1;i++){
			for(int j=1;j<=len2;j++){
				dp[i][j] = min(min(dp[i-1][j]+1,dp[i][j-1]+1),dp[i-1][j-1]+(s1[i-1]!=s2[j-1]));
			}
	}
	cout<<dp[len1][len2]<<endl;
}


Measured memory_bytes: 10856
import java.util.Scanner;

/**
 * @author: Happy
 * @date:2020年8月2日 下午8:18:34
 */
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int x=in.nextInt();
		if(x>=30){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}	

}

Measured memory_bytes: 35644
#include <iostream>
#include <fstream>

using namespace std;

ifstream f("1.in");

const int N=(1e5)+5;
int n;
long long a[N], ans, sum, k;
//1 - 0001
//6 - 0110
//3 - 0011

int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i++) cin >> a[i];

    for (int bit = 62; bit >= 0; bit--)
    {
        int unu=0, zero=0;
        for (int i = 1; i <= n; i++)
        {
            if (a[i]&(1LL<<bit)) unu++;
            else zero++;
        }
        if (zero >= unu && (1LL<<bit)+ans <= k) ans+=(1LL<<bit);
    }
    for (int i = 1; i <= n; i++) sum+=ans^a[i];

    cout << sum;

    return 0;
}


Measured memory_bytes: 1024
N,M,C=map(int,input().split())
B=[int(_) for _ in input().split()]
A=[]
count=0
sum=0
for i in range(N):
    A=[int(_) for _ in input().split()]

    for j in range(M) :
       sum+=B[j]*A[j]

    sum+=C
    if sum>0:
       count+=1
    sum=0
    A=[]

print(count)


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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

const int mod = 1000000007;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}

    mint &operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }

    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }

    mint &operator/=(const mint a) {
        return (*this) *= a.inv();
    }

    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

char wall[1000][1000];
mint dp[1000][1000];

int main() {
    int H, W;
    cin >> H >> W;
    rep(i, H) rep(j, W) cin >> wall[i][j];

    dp[0][0] = 1;
    rep(i, H) {
        rep(j, W) {
            if (wall[i][j] == '#') continue;

            if (j + 1 != W && wall[i][j + 1] != '#') dp[i][j + 1] += dp[i][j];
            if (i + 1 != H && wall[i + 1][j] != '#') dp[i + 1][j] += dp[i][j];
        }
    }

    cout << dp[H - 1][W - 1].x << endl;
}


Measured memory_bytes: 9088
/**************
*	???????????????
*************/
//for?????????while?????????vector?????????list??????


#include <iostream>
#include <cmath>		//	????§???¢??°
using namespace std;

struct Dot{
	double x;
	double y;
};

//??????
void output_xy(Dot a){
	cout << a.x  <<" "<< a.y << endl;
}

	//2?????????????????¨3????????§?¨??????¨???????????¢??°
void koch(Dot start, Dot end, int n )
{
	if(n == 0){
		return;
	}
	
	
	Dot v;//???
	v.x = (end.x-start.x)/3;
	v.y = (end.y-start.y)/3;
	
	Dot s;//?????¨????????????
	s.x = start.x+v.x;
	s.y = start.y+v.y;
	
	Dot t;
	t.x = start.x+2*v.x;
	t.y = start.y+2*v.y;
	
	Dot u;
	u.x = s.x + v.x*cos(M_PI*60/180)-v.y*sin(M_PI*60/180);
	u.y = s.y + v.x*sin(M_PI*60/180)+v.y*cos(M_PI*60/180);
	
	n --;
	koch(start, s, n);
	output_xy(s);		//????????????????????????
	koch(s, u, n);
	output_xy(u);
	koch(u, t, n);
	output_xy(t);
	koch(t, end, n);

}
//-------------------------------------------------------------
int main()
{
	int n;
	cin >> n;
	
	Dot start;
	start.x =0;
	start.y =0;
	
	Dot end;
	end.x = 100;
	end.y =   0;
	
	output_xy(start);
	koch(start, end, n);
	output_xy(end);
	
	return 0;
}

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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;


bool check(string s){

    int n=s.size();

    int left=0;
    int right=n-1;
    while(left<=right){
        if(s[left]!=s[right])return false;
        left++;
        right--;
    }
    return true;
}
//status unsolved
int main(){
    string s;
    cin>>s;
    int n=s.size();
    int one=(n-1)/2;
    int two=(n+3)/2;
    string s1="";
    for(int i=0;i<one;i++)s1.append(1,s[i]);

    string s2="";
    for(int i=two-1;i<n;i++)s2.append(1,s[i]);

    if(check(s)&& check(s1)&& check(s2) ){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }

    return 0;

}
/*


*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,m,i,j,k=1000000,Min1=1000000,Min2=1000000;
    cin>>a>>b>>m;
    long long r[a],mi[b],x[m],y[m],c[m],ans[m];
    for(i=1;i<=a;i++)
    {
        cin>>r[i];
        Min1=min(Min1,r[i]);
    }
    for(i=1;i<=b;i++)
    {
        cin>>mi[i];
        Min2=min(Min2,r[i]);
    }
    for(i=1;i<=m;i++)
    {
        cin>>x[i]>>y[i]>>c[i];
        ans[i]=r[x[i]]+mi[y[i]]-c[i];
    }
    ans[0]=Min1+Min2;
    for(i=0;i<=m;i++)
    {
        k=min(k,ans[i]);
    }
    cout<<k<<endl;
    return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int X, Y, Z, K;
    cin >> X >> Y >> Z >> K;
    vector<int> A[3];
    rep(i, X) { int a; cin >> a; A[0].push_back(a);}
    rep(i, Y) { int a; cin >> a; A[1].push_back(a);}
    rep(i, Z) { int a; cin >> a; A[2].push_back(a);}
    rep(i, 3) sort(A[i].begin(), A[i].end(), greater<int>());
    vector<int> v1, v2;
    rep(i, X) {
        rep(j, Y) {
            v1.push_back(A[0][i] + A[1][j]);
        }
    }
    sort(v1.begin(), v1.end(), greater<int>());
    rep(i, min((int)v1.size(), K)) {
        rep(j, Z) {
            v2.push_back(v1[i] + A[2][j]);
        }
    }
    sort(v2.begin(), v2.end(), greater<int>());
    rep(i, K) cout << v2[i] << endl;





    return 0;
}
// 8 6 5 4 3 1

Measured memory_bytes: 43384
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1 LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

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

    if(x == 0)cout << 1 << endl; 
    else cout << 0 << endl;
}

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

int main(void){
  string s,t; cin >> s >> t;
  int a,b; cin >> a >> b;
  string u;  cin >> u;
  rep(i,10){
    if(s.at(i) != t.at(i)){
      if(u.at(i) == s.at(i)) a--;
      else b--;
      break;
    }
  }
  cout << a << " " << b << endl;
  return 0;
}


Measured memory_bytes: 256
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

if n % 2 == 0:
    print(n)
else:
    print(2 * n)


Measured memory_bytes: 3696
#include <stdio.h>

int main() {
	int i, x = 0;
	char a[10], b[10], c[10];

	scanf("%s %s %s", a, b, c);

	for (i = 0; i < 10; i++) {
		if (a[i] == '\0') {
			break;
		}
	}

	if (a[i - 1] == b[0])x++;

	for (i = 0; i < 10; i++) {
		if (b[i] == '\0') {
			break;
		}
	}

	if (b[i - 1] == c[0])x++;

	printf(x == 2 ? "YES\n" : "NO\n");

	return 0;
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 30;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int n, m;
vector<double> l, a, b;

double distance(int i, int j) {
  return pow(l[i] - l[j], 2) + pow(a[i] - a[j], 2) + pow(b[i] - b[j], 2);
}

double solve(vector<bool> sel, int i, int k) {  
  if(k == m) {
    double su = 0;
    REP(i, n) {
      REP(j, n) {
        if(sel[i] && sel[j]) {
          su += distance(i, j);
        }
      }
    }
    return su/2.0;
  } else if(i == n) {
    return 0;
  } else {
    double tmp1 = solve(sel, i+1, k);
    sel[i] = true;
    double tmp2 = solve(sel, i+1, k+1);
    return max(tmp1, tmp2);
  }
}

int main () {
  cin.tie(0);
  cout << setprecision(20);
  
  cin >> n >> m;
  l.resize(n);
  a.resize(n);
  b.resize(n);
  REP(i, n) {
    cin >> l[i] >> a[i] >> b[i];
  }
  vector<bool> sel(n, false);
  cout << solve(sel, 0, 0) << endl;
}



Measured memory_bytes: 3296
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    int N;
    cin >> N;
    if(N > 81){
        cout << "No" <<endl;
    }
    else if(N < 11){
        cout << "Yes" << endl;
    }
    else{
        if(N % 2 == 0 && N < 19){
            cout << "Yes" << endl;
        }
        else if(N % 3 == 0 && N < 28){
            cout << "Yes" << endl;
        }
        else if(N % 4 == 0 && N < 37){
            cout << "Yes" << endl;
        }
        else if(N % 5 == 0 && N < 46){
            cout << "Yes" << endl;
        }
        else if(N % 6 == 0 && N < 55){
            cout << "Yes" << endl;
        }
        else if(N % 7 == 0 && N < 64){
            cout << "Yes" << endl;
        }
        else if(N % 8 == 0 && N < 73){
            cout << "Yes" << endl;
        }
        else if(N % 9 == 0){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" <<endl;
        }
    }
}

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

int main() {
	// your code goes here
	int t;
	cin>>t;
	unordered_map<string,int>m;
	m["AC"]=m["WA"]=m["TLE"]=m["RE"]=0;
	while(t--){
		string str;
		cin>>str;
		m[str]++;
	}
	cout<<"AC x "<<m["AC"]<<endl;
	cout<<"WA x "<<m["WA"]<<endl;
	cout<<"TLE x "<<m["TLE"]<<endl;
	cout<<"RE x "<<m["RE"]<<endl;
	return 0;
}

Measured memory_bytes: 3592
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace atcoder115_A
{
    class Program
    {
        static void Main(string[] args)
        {
            int D = int.Parse(Console.ReadLine());

            string result = "Christmas";

            if (D == 24) result = "Christmas Eve";
            if (D == 23) result = "Christmas Eve Eve";
            if (D == 22) result = "Christmas Eve Eve Eve";

            Console.WriteLine(result);




        }
    }
}


Measured memory_bytes: 11092