akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>
#include <string>
#include <bitset>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define mp(x, y) make_pair((x), (y))
using namespace std;
using lint = long long;
using P = pair<int, int>;
using V = vector<int>;
constexpr int MOD = 1e9 + 7;

template <int MOD>
struct ModInt {
    using lint = long long;
    int val;
 
    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };
 
    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }
 
    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }
 
    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }
 
    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }
 
    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

using mint = ModInt<MOD>;

int A, B, C, F, H, I, J, K, L, M, N, S, T, U, W, X, Y;
// lint A, B, F, H, I, J, K, L, M, N, S, T, U, W, X, Y;
// string A, B;
// int ans;
// string ans;

mint ncr(int n, int r) {
    mint rst = 1;
    rep1(i, r) {
        rst *= n - i + 1;
        rst /= i;
    }
    return rst;
}

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

	cin >> X >> Y;
	if ((X + Y) % 3 != 0) {
        cout << 0 << endl;
        return 0;
    }

    A = Y*2/3 - X/3;
    B = X*2/3 - Y/3;
    if (A < 0 || B < 0) {
        cout << 0 << endl;
        return 0;
    }

	mint ans = ncr(A + B, A);

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

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

//macro-----------------------------------------------------------------------------------------
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i=a;i>b;i--)
#define int long long

//constant--------------------------------------------------------------------------------------
const int inf = 100100100100000;
const int mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//general_method--------------------------------------------------------------------------------
vector<int> cs(vector<int> arr){vector<int> ret = arr;rep(i,1,arr.size()){ret[i] += ret[i-1];}return ret;}
int ceil(int a, int b){if(a%b == 0) return a/b;else return a/b + 1;}
int digitlen(int i){int t = i;int count = 0;while(t){count += 1;t /= 10;}return count;}
int gcd(int m, int n){if((0== m)||(0 == n))return 0;while(m != n){if(m > n)m = m - n;else n = n - m;}return m;}
int lcm(int n, int m){return n*m/gcd(n,m);}

//io_method-------------------------------------------------------------------------------------
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
void print(int n){cout << n << endl;}
void print(vector<int> arr){cout << arr[0];rep(i,1,arr.size()) cout << " " << arr[i];cout << endl;}
void print(string s){cout << s << endl;}
void print(pair<int, int> p){cout << p.first << " " << p.second;}
void print(vector<vector<int>> arr){rep(i,0,arr.size()){print(arr[i]);}}
void print(double n){cout << n << endl;}

//main------------------------------------------------------------------------------------------


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

    int ans = 1;
    int c = 0;
    int n = input();
    rep(i,1,n+1){
        int cnt = 0;
        int t = i;
        while(t % 2 == 0){
            t /= 2;
            cnt++;
        }
        if(c < cnt) {ans = i; c = cnt;}
    }
    print(ans);
    
    
}

Measured memory_bytes: 256
import sys
from math import sqrt
from collections import Counter, defaultdict

input = sys.stdin.readline


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    k, n = MI()
    a_list = LI()

    a_list.sort()
    max = 0
    for i, a in enumerate(a_list):
        if i != n - 1:
            d = a_list[i + 1] - a
        else:
            d = a_list[0] + k - a

        if d > max:
            max = d
            max_i = (i + 1) % n

    l = []
    for a in a_list:
        tmp = a - a_list[max_i]
        if tmp >= 0:
            l.append(tmp)
        else:
            l.append(k + tmp)

    l.sort()
    print(l[n - 1])

    pass


if __name__ == "__main__":
    main()


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

using ll = long long;
#define countof(a) (sizeof(a)/sizeof((a)[0]))
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_v(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << endl; }
template<class T> void cout_h(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << (i==c.size()-1?"\n":" "); }
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
void Yes(bool f){cout<<(f?"Yes":"No")<<endl;}

bool match(const char* qs, const char* s)
{
    bool f = true;
    int i = 0;
    while (*(s + i) != '\0') {
        if (*(qs+i) != '?') {
            if (*(qs+i) == '\0' || *(qs + i) != *(s + i))
                return false;
        }
        i++;
    }
    return f;
}

int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    //cout<<std::fixed<<std::setprecision(10);

    string _S, T; cin >> _S>> T;
    string S;
    for (int i = _S.size() - T.size(); i >= 0; i--) {
        // cout << FMT2(i, T) << endl;
        if (match(_S.c_str() + i, T.c_str())) {
            // cout << FMT2(i, _S) << endl;
            S = _S;
            S.replace(i, T.size(), T);
            for (int j = 0; j < S.size(); j ++) {
                if (S[j] == '?') {
                    S[j] = 'a';
                }
            }
            break;
        } 
    }

    if (S.empty()) {
        cout << "UNRESTORABLE" << endl;
    } else {
        cout << S << endl;
    }
        
}


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

using namespace std;

typedef long long ll;

ll N, A[100005], cnt[100005];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> N;

	memset(cnt, 0, sizeof(cnt));
	for (ll i = 0; i < N; i++) {
		cin >> A[i];
		cnt[A[i]]++;
	}

	ll twos = 0, dist = 0;
	for (ll i = 0; i < 100005; i++) {
		if (cnt[i] > 0) dist++;
		if (cnt[i] % 2 == 0 && cnt[i] != 0) twos++;
	}

	if (twos % 2 == 0) {
		cout << dist << "\n";
	}
	else {
		cout << dist - 1 << "\n";
	}
	
	return 0;
}


Measured memory_bytes: 1792
n = int(input())
a = list(map(int, input().split()))

x = [0] * n
x[0] = sum(a) - sum([a[i] for i in range(1, n, 2)]) * 2
for i in range(n-1):
    x[i+1] = 2 * a[i] - x[i]

print(' '.join(map(str, x)))


Measured memory_bytes: 99024
#include<iostream>
#include<algorithm>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<vector>
#include<deque>
#include<map>
#include<set>

using namespace std;

long A,B,C,K;

int input(){
  cin >> A >> B >> C;
  cin >> K;
  return 0;
}

int run(){
  vector<long> x({A, B, C});
  sort(x.begin(), x.end());
  cout << (x[0] + x[1] + (x[2]<<K)) << endl;
  return 0;
}

int main(){
  input();
  run();
  return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define _GLIBCXX_DEBUG

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvd = vector<vd>;
using vvvi = vector<vvi>;
using vvvll = vector<vvll>;
using vvvd = vector<vvd>;

const double pi=acos(-1);
const ll MOD=1e9+7;
const ll INF=(1LL<<60);

int n;
ll a[410];
ll s[410];
ll dp[410][410];
int flag[410][410];

ll ddpp(int l,int r){
    if (flag[l][r])return dp[l][r];
    flag[l][r]=1;
    if (l==r)dp[l][r]=0;
    else{
        ll ans=INF;
        for (int i=l;i<r;i++){
            ll ans1=s[r]-s[l-1];
            ans=min(ans,ddpp(l,i)+ddpp(i+1,r)+ans1);
        }
        dp[l][r]=ans;
    }
    return dp[l][r];
}

int main() {
    cin>>n;
    rep(i,n)cin>>a[i+1];
    s[0]=0;
    rep(i,n)s[i+1]=s[i]+a[i+1];
    ddpp(1,n);
    cout<<dp[1][n]<<endl;

    

    return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const int nmax = 8;
bool graph[nmax][nmax];
const int INF = 1e9;
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll calc(ll A)
{
    //return f(A,0)
    //f(A,0)
    ll a;
    if (A % 2 == 0)
    {
        if ((A / 2) % 2 == 0)
        {
            a = 0;
        }
        else
        {
            a = 1;
        }
    }
    else
    {
        if ((A / 2) % 2 == 0)
        {
            a = 0;
        }
        else
        {
            a = 1;
        }
        a = a ^ (A - 1);
    }
    return a;
}
void solve(long long A, long long B)
{
    ll ans = calc(A) ^ calc(B+1);
    cout << ans << endl;
}

int main()
{
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>

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

using namespace std;

typedef	long long	ll;

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

int w,h,sx,sy;
ll endstat,nbr[7][7];
ll vline[7],vline_above[7],vline_below[7];
ll hline[7],hline_above[7],hline_below[7];

bool findHamiltonCycle(ll stat,int x,int y){
	stat|=1LL<<(y*w+x);

	if((hline[y]&stat)==hline[y]){
		if((hline_above[y]&stat)!=hline_above[y]
		&& (hline_below[y]&stat)!=hline_below[y])	return false;
	}
	if((vline[x]&stat)==vline[x]){
		if((vline_above[x]&stat)!=vline_above[x]
		&& (vline_below[x]&stat)!=vline_below[x])	return false;
	}

	if(stat==endstat){
		rep(i,4){
			int xx=x+dx[i],yy=y+dy[i];
			if(0<=xx && xx<w && 0<=yy && yy<h){
				if(yy==sy && xx==sx)	return true;
			}
		}
	}
	else{
		if((nbr[sy][sx]&stat)==nbr[sy][sx])	return false;
		rep(i,4){
			int xx=x+dx[i],yy=y+dy[i];
			ll nextstat=stat|(1LL<<(yy*w+xx));
			if(0<=xx && xx<w && 0<=yy && yy<h && stat!=nextstat){
				if(findHamiltonCycle(nextstat,xx,yy))	return true;
			}
		}
	}

	return false;
}

int main(){
	for(;scanf("%d%d",&w,&h),w;){
		int even=0,odd=0;
		ll inistat=0;
		endstat=(1LL<<(w*h))-1;
		rep(i,h)rep(j,w){
			int t;	scanf("%d",&t);
			if(!t){
				sx=j,sy=i;
				if((i+j)%2)	odd++;
				else		even++;
			}
			else	inistat|=1LL<<(i*w+j);
		}
		if(even!=odd){ puts("No"); continue; }

		bool deg1=false;
		rep(y,h)rep(x,w)if((inistat&(1LL<<(y*w+x)))==0){
			int deg=0;
			rep(i,4){
				int xx=x+dx[i],yy=y+dy[i];
				if(0<=xx && xx<w && 0<=yy && yy<h && (inistat&(1LL<<(yy*w+xx)))==0)	deg++;
			}
			if(deg==1)	deg1=true;
		}
		if(deg1){ puts("No"); continue; }

		rep(y,h)rep(x,w){
			nbr[y][x]=0;
			rep(i,4){
				int xx=x+dx[i],yy=y+dy[i];
				if(0<=xx && xx<w && 0<=yy && yy<h)	nbr[y][x]|=1LL<<(yy*w+xx);
			}
		}
		rep(x,w){
			vline[x]=vline_above[x]=vline_below[x]=0;
			rep(y,h){
				vline[x]|=1LL<<(y*w+x);
				rep(i,x)				vline_above[x]|=1LL<<(y*w+i);
				for(int i=x+1;i<w;i++)	vline_below[x]|=1LL<<(y*w+i);
			}
		}
		rep(y,h){
			hline[y]=hline_above[y]=hline_below[y]=0;
			rep(x,w){
				hline[y]|=1LL<<(y*w+x);
				rep(i,y)				hline_above[y]|=1LL<<(i*w+x);
				for(int i=y+1;i<h;i++)	hline_below[y]|=1LL<<(i*w+x);
			}
		}

		puts(findHamiltonCycle(inistat,sx,sy)?"Yes":"No");
	}

	return 0;
}

Measured memory_bytes: 0
import java.io.*;
import java.text.DecimalFormat;

class Main
{
  public static void main(String[] args) throws IOException
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] str = br.readLine().split(" ",0);
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);

    int d = a / b;
    int r = a % b;
    double f = (double)a/b;

    DecimalFormat df = new DecimalFormat("0.00000000");
    System.out.println(d + " " + r + " " + df.format(f));
  }
}

Measured memory_bytes: 25940
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define x first
#define y second
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
template <typename T> void chkmax(T &x,T y){x<y?x=y:T();}
template <typename T> void chkmin(T &x,T y){x>y?x=y:T();}
template <typename T> void readint(T &x)
{
	x=0;int f=1;char c;
	for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-1;
	for(;isdigit(c);c=getchar())x=x*10+c-'0';
	x*=f;
}
const int MOD=998244353;
inline int dmy(int x){return x>=MOD?x-MOD:x;}
inline void inc(int &x,int y){x=dmy(x+y);}
int qmi(int x,int y)
{
	int ans=1;
	for(;y;y>>=1,x=1ll*x*x%MOD)
		if(y&1)ans=1ll*ans*x%MOD;
	return ans;
}
const int MAXN=25005,MAXM=200005,INF=0x3f3f3f3f;

int n,m;
char a[55][55];

struct Edge
{
	int v,f,c;
	Edge *next,*rev;
}pool[MAXM],*h[MAXN],*pe[MAXN];
int etot=0;
inline void addEdge(int u,int v,int f,int c)
{
	Edge *p=&pool[++etot],*q=&pool[++etot];
	p->v=v,p->f=f,p->c=c,p->next=h[u],h[u]=p,p->rev=q;
	q->v=u,q->f=0,q->c=-c,q->next=h[v],h[v]=q,q->rev=p;
}
int src,sink;
int q[MAXM],dis[MAXN],pv[MAXN];
bool inq[MAXN];
bool spfa()
{
	int front=1,rear=0;
	memset(dis,0x3f,sizeof(dis));
	dis[src]=0;q[++rear]=src;inq[src]=1;
	while(front<=rear)
	{
		int u=q[front++];
		inq[u]=0;
		for(Edge *p=h[u];p;p=p->next)
			if(p->f && dis[p->v]>dis[u]+p->c)
			{
				dis[p->v]=dis[u]+p->c;
				pv[p->v]=u,pe[p->v]=p;
				if(!inq[p->v])q[++rear]=p->v;
			}
	}
	return dis[sink]<INF;
}
int augment()
{
	int t=INF;
	for(int u=sink;u!=src;u=pv[u])chkmin(t,pe[u]->f);
	for(int u=sink;u!=src;u=pv[u])pe[u]->f-=t,pe[u]->rev->f+=t;
	return t;
}

int main()
{
	#ifdef LOCAL
	freopen("code.in","r",stdin);
//	freopen("code.out","w",stdout);
	#endif
	readint(n),readint(m);
	for(int i=0;i<n;++i)scanf("%s",a[i]);
	src=n*m,sink=n*m+1;
	for(int i=0;i<n;++i)
		for(int j=0;j<m;++j)
		{
			if(a[i][j]=='#')continue;
			if(a[i][j]=='o')addEdge(src,i*m+j,1,0);
			if(i<=n-2)addEdge(i*m+j,(i+1)*m+j,INF,-1);
			if(j<=m-2)addEdge(i*m+j,i*m+j+1,INF,-1);
			addEdge(i*m+j,sink,1,0);
		}
	int cost=0,t;
	while(spfa())t=augment(),cost+=t*dis[sink];
	printf("%d\n",-cost);
	return 0;
}

Measured memory_bytes: 4392
#include<stdio.h>
 
#define MAX 101
#define BLACK 0
#define WHITE 2
#define GRAY 1


int f[MAX];
int c=0;
int col[MAX];
int depth[MAX];



int dfs[MAX][MAX];
int k[MAX];



void dfsvisit(int u)
{
  int i;
  col[u] = GRAY;
 


depth[u] =  c++;
  for(i = 0;i < k[u]; i++)
    {
      if(col[dfs[u][i]] == WHITE)
    {
     

      dfsvisit(dfs[u][i]);
   

    }
    }
  col[u] = BLACK;
  f[u] = c++;
}

 







int main(){
int n,i=0;
  
 
 
  for(i=0;i<101;i++)
    {
      col[i] = WHITE;
} 




int j;
int tmp;
 
  scanf("%d",&n);
 
  for(i=1;i<=n;i++)
    {
      scanf("%d",&tmp);

      scanf("%d",&k[i]);

      for(j = 0;j < k[i]; j++)
    {
      scanf("%d",&dfs[i][j]);
    }
    }
  
  for(i = 1;i <= n; i++){
      if(col[i] == WHITE){
     

dfsvisit(i);
    }
    }
  for(j = 1;j <= n; j++)
    {
      /*出力が合わないので補正*/
      printf("%d %d %d\n",j,depth[j]+1,f[j]+1);
    }
 
  return 0;
}
 

Measured memory_bytes: 1064
N = int(input())
L = [0] * (N+1)
L[0] = 2
L[1] = 1

if N == 1 :
    print(L[1])
else :
    for i in range(2,N+1):
        L[i] = L[i - 1] + L[i - 2]
    print(L[N])


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,A,B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

const int INF = (1e+9)+7;
int main() {
    cin>>N>>M;
    mat G(N+1,vec(0));//1-indexed
    for(int i = 0; i < M; i++) {
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        //G[t].push_back(s);
    }
    mat min(3,vec(N+1,INF));
    typedef pair<ll,ll> P;//g,dist
    queue<P> que;
    cin>>A>>B;
    que.push(mp(A,0));
    /*ll mayans = INF;
    ll ans = INF;
    bool ansF = false;*/
    while(que.size()){
        P p = que.front();
        p.se += 1;
        que.pop();
        for(ll v : G.at(p.fi)){
            if(min[p.se%3][v] == INF){
                min[p.se%3][v] = p.se;
                que.push(mp(v,p.se));
            }
        }
        if(min[0][B] != INF) break;
    }
    //cout<<ansF<<endl;
    if(min[0][B] == INF){
        cout<<-1<<endl;
        return 0;
    }
    /*if(!ansF){
        cout<<(mayans/3)+2<<endl;
        return 0;
    }
    if(ans%3) cout<<(ans/3)+1<<endl;*/
    cout<<min[0][B]/3<<endl;
}

Measured memory_bytes: 8832
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <sstream>
#include <map>
#include <cstring>
#include <vector>
#include <queue>
#include <iomanip>

using namespace std;
typedef long long ll;

ll ans, mx, sum, mn = 1e8, cnt;
int main(){
	ll n,k;
	cin>>n>>k;
	ll a[n];
	for(ll i=0; i<n; i++){
		cin>>a[i];
	}
	sort(a,a+n);
	for(ll i=0; i<k; i++) sum+=a[i];
	cout<<sum<<endl;
}


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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

int n, k;
string s;

vector<int> block;
int num[MAX_N];

int ans;

int main(void) {
  // Here your code !
  scanf("%d %d", &n, &k);

  cin >> s;

  for (int i = 0; i < n; ++i) {
    if (s[i] == '0') {
      if (i == 0 || s[i - 1] == '1') {
        num[i] = 1;
      }
    }
  }

  for (int i = 1; i < n; ++i) {
    num[i] += num[i - 1];
  }

  num[n] = num[n - 1] + 1;

  int cnt = num[n - 1];

  if (k >= cnt) {
    printf("%d\n", n);
    return 0;
  }

  ans = -1;

  for (int i = 0; i < n; ++i) {
    int add = (s[i] == '0') ? k - 1 : k; // already using 0 part

    auto itr = upper_bound(num + i, num + n + 1, num[i] + add);

    int ind = (itr - num) - 1;
    int tmp = num[ind];
    if (tmp - num[i] != add) break;

    int score = ind - i + 1;

    ans = max(ans, score);
  }

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

  return 0;
}


Measured memory_bytes: 896
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

int N, A, B;

void MAIN() {
    scanf("%d%d%d", &N, &A, &B);

    if (abs(A-B)&1) puts("Borys");
    else puts("Alice");

}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 256
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define INTINF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	ll ans = 0;
	int tmp;
	int n, m;
	cin >> n >> m;
	vector<ll> x(m);
	REP(i, m) cin >> x[i];
	sort(x.begin(), x.end());
	vector<ll> dx;
	REP(i, m-1){
		dx.push_back(x[i+1] - x[i]);
	}
	sort(dx.begin(), dx.end());
	ans = x[m-1] - x[0];
	REP(i, n-1) if(m-2-i >= 0)ans -= dx[m-2-i];
	cout << ans << endl;
}

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

int main() {
  ll N = 0,ans = 0;
  cin >> N;
  vector<ll>A(N);
  rep(i,N){
    cin >> A[i];
  }
  ans = 10000000000000;
  for(ll a = -100; a < 101; a++){
    ll tmp = 0;
    rep(i,N){
      tmp += (A[i]-a)*(A[i]-a);
    }
    ans = min(ans,tmp);
  }
  cout << ans;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
  #define debug(...) printf(__VA_ARGS__)
#else
  #define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

ll ff(ll x1, ll y1, ll x2, ll y2) {
  ll r = 0;
  ll b = 1;
  for (int i = 1; i <= 30; i++) {
    if (x1 % 3 == 1 && x2 % 3 == 1 && x1 == x2) {
     // if ((y1 % 3 == 0 && y2 % 3 == 2) || (y1 % 3 == 2 && y2 % 3 == 0)) {
      if (abs(y1 - y2) > 1) {
        r = b;
      }
    }

    x1 /= 3;
    y1 /= 3;
    x2 /= 3;
    y2 /= 3;
    b *= 3;
  }

  return r;
}

ll solve(ll x1, ll y1, ll x2, ll y2) {
  ll big = ff(x1, y1, x2, y2);
  debug("big %lld\n", big);

  ll ans = abs(x2 - x1) + abs(y2 - y1);
  if (big > 0) {
    x1 %= big;
    x2 %= big;
    ans += min(min(x1, x2) * 2 + 2, min(big - x1, big - x2) * 2); 
  }
  return ans;
}

int main() {
  int Q;
  scanf("%d", &Q);
  while (Q--) {
    ll x1, y1, x2, y2;
    scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
    x1--, y1--, x2--, y2--;
    ll r1 = solve(x1, y1, x2, y2);
    ll r2 = solve(y1, x1, y2, x2);
    printf("%lld\n", max(r1, r2));
  }
  return 0;
}


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


int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	long long int a,b;
	cin>>a>>b;
	
	cout<< (a*b/ __gcd(a,b));
	
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    return 0;
}


Measured memory_bytes: 256
N=int(input())

A=[]
B=[]
C=[]
for i in range(1,26):
    A.append(i*4)
for i in range(1,16):
    B.append(i*7)
for i in range(1,26):
    for j in range(1,16):
        C.append(4*i+7*j)
        
D=A+B+C

if D.count(N)>=1:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
typedef long long ll;
typedef multiset<ll> S;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}

int main(){
    int n;cin>>n;
    vector<P> v(n);
    vector<P> a(n);
    rep(i,n)cin>>v[i].second;
    rep(i,n)cin>>v[i].first;
    sort(all(v));
    rep(i,n){
        a[i].first=v[i].second;
        a[i].second=i;
    }
    auto k=a;
    sort(all(k));
    rep(i,n){
        if(k[i].first>v[i].first){
            cout<<"No"<<endl;
            return 0;
        }
    }
    vector<bool> used(n,false);
    int w=0;
    used[0]=true;
    while(true){
        w=k[w].second;
        if(used[w])break;
        used[w]=true;
    }
    rep(i,n){
        if(!used[i]){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    reverse(all(k));
    rep(i,n-1){
        if(k[i].first<=v[n-2-i].first){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}


Measured memory_bytes: 4992
S = input()
if S == "SAT":
  print(1)
elif S == "SUN":
  print(7)
elif S == "MON":
  print(6)
elif S =="TUE":
  print(5)
elif S =="WED":
  print(4)
elif S == "THU":
  print(3)
elif S == "FRI":
  print(2)
else:
  print(0)

Measured memory_bytes: 2940
Q=int(input())

def prime_sieve(n):
  prime_list=[True]*n
  prime_list[0]=False
  prime_list[1]=False
  for i in range(2,int(n**0.5)+1):
    if not prime_list[i]:
      continue
    else:
      for j in range(i**2,n,i):
        prime_list[j]=False
  
  return prime_list
  #return [i for i in range(n) if is_prime_list[i]]

prime_list=prime_sieve(10**5+1)
#print(prime_list[:10])
  
plist=[0]*(10**5+1)
for i in range(3,10**5+1,2):
  if prime_list[i] and prime_list[(i+1)//2]:
    plist[i]=1
#print(plist[:10])

slist=[0]*(10**5+1)
for i in range(3,10**5+1):
  slist[i]=plist[i]+slist[i-1]
#print(slist[:10])
  
for i in range(Q):
  l,r=map(int,input().split())
  print(slist[r]-slist[l-1])

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

int main()
{
    int k,x;
    cin>>k>>x;
    for(int i=x-k+1;i<x+k-1;i++)
        cout<<i<<" ";
    cout<<x+k-1<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long[] name = new long[5];
        for(int i = 0; i < n; i++){
            String str = scanner.next();
            char f = str.charAt(0);
            if(f == 'M'){name[0]++;}
            else if(f == 'A'){name[1]++;}
            else if(f == 'R'){name[2]++;}
            else if(f == 'C'){name[3]++;}
            else if(f == 'H'){name[4]++;}
        }
        long count = 0;
        for(int i = 0; i < 5; i++){
            if(name[i] != 0){count++;}
        }
        if(count < 2){System.out.println(0);return;}
        long sum = 0;
        for(int i = 0; i < 3; i++){
            for(int j = i+1; j < 4; j++){
                for(int k = j+1; k < 5; k++){
                    if(name[i] != 0 && name[j] != 0 && name[k] != 0){
                        sum += name[i] * name[j] * name[k];
                    }  
                }
            }
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 44756
use std::io::*;
use std::str::FromStr;
use utils::*;

pub fn main() {
    let i = stdin();
    let mut o = Vec::new();
    run(i.lock(), &mut o);
    stdout().write_all(&o).unwrap();
}

fn run<R: BufRead, W: Write>(i: R, o: &mut W) {
    let mut i = CpReader::new(i);
    let n = i.read::<usize>();
    let mut c = [0; 5];
    for idx in 0..5 {
        c[idx] = i.read();
    }
    writeln!(o, "{}", solve(n, c)).unwrap();
}
fn solve(n: usize, c: [usize; 5]) -> usize {
    let c_min = c.iter().min().unwrap();
    (n + c_min - 1) / c_min + 4
}

mod utils {
    use super::*;

    pub struct CpReader<R: BufRead> {
        r: R,
        s: String,
    }

    macro_rules! fn_read {
        { $f:ident($($t:ident),*) } => {
            #[allow(dead_code)]
            pub fn $f<$($t: FromStr),*>(&mut self) -> ($($t),*) {
                let i = &mut self.read_line().split(' ');
                ($(read_next::<$t,_>(i)),*)
            }
        };
    }

    impl<R: BufRead> CpReader<R> {
        pub fn new(r: R) -> Self {
            CpReader {
                r: r,
                s: String::new(),
            }
        }
        pub fn read_line(&mut self) -> &str {
            self.s.clear();
            self.r.read_line(&mut self.s).unwrap();
            self.s.trim()
        }

        pub fn read<T: FromStr>(&mut self) -> T {
            self.read_line().parse().ok().unwrap()
        }
        fn_read! { read2(T1, T2) }
        fn_read! { read3(T1, T2, T3) }
        fn_read! { read4(T1, T2, T3, T4) }
        fn_read! { read5(T1, T2, T3, T4, T5) }
    }
    fn read_next<'a, T: FromStr, I: Iterator<Item = &'a str>>(i: &mut I) -> T {
        i.next().unwrap().parse().ok().unwrap()
    }

}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main() {
    int n;
    cin >> n;
    string s;
    map<string, int> ans;
    REP(i,n){
        cin>>s;
        ans[s]=0;
    }
    cout << ans.size() << endl;
    return 0;
}

Measured memory_bytes: 19204
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ull = unsigned long long; 
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
void print() { cout << "\n"; }
template <class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int H,W; cin >> H >> W;
    vector<string> S(H);
    rep(i,H) cin >> S[i];

    auto R = S;
    auto B = S;
    rep(i,H) {
        R[i][0] = '#';
        B[i][W-1] = '#';
    }
    rep(i,H) {
        for (int j = 1; j < W-1; j++) {
            (i&1 ? R[i][j] : B[i][j]) = '#';
        }
    }
    rep(i,H) cout << R[i] << ln;
    cout << ln;
    rep(i,H) cout << B[i] << ln;
}


Measured memory_bytes: 1536
#include "bits/stdc++.h"
 
using namespace std;
 
//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
#define fir first
#define sec second
 
const int INF = 1e9 + 10;
//const ll INF = 1e18 + 10LL;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
const double EPS = 1e-10;
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)
ll MOD = 1e9 + 7;
 
ll n, k;
 
void solve() {
	ll ans = 0;
	for (ll b = 1; b <= n; b++) {
		ans += n / b * max(0LL, b - k);
		ans += max(0LL, n % b + 1 - k);
	}
 
	if (k == 0) ans -= n;
 
	printf("%lld\n", ans);
}
 
int main(void){
	cin>>n>>k;
 
	solve();
	
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[N];
  for(int i=0;i<N;i++) cin >> a[i];

  sort(a,a+N);

  cout << a[N-1] - a[0] << endl;
  return 0;
}


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

// ???
int main(){
    auto f = [](int val)->char{
        if(val <= 9)    return (char)('0'+val);
        return (char)('A'+val-10);
    };

    int n, m, q;
    while(cin >> n >> m >> q, n+m+q){
        vector<string> s(q+1), b(q+1);
        s[0] = b[0] = "";
        for(int i = 0; i < n; i++)  s[0] += "0";
        for(int i = 0; i < m; i++)  b[0] += "0";
        for(int i = 1; i <= q; i++)  cin >> s[i] >> b[i];
        vector<int> cnt(m, 0);
        vector<bool> push(n, 0);
        vector<vector<int>> tmp(n, vector<int>(m, 0));
        vector<vector<bool>> flag(n, vector<bool>(m,0));
        for(int i = 1; i <= q; i++){
            for(int j = 0; j < m; j++){
                if(b[i-1][j] != b[i][j])    cnt[j]++;
                for(int k = 0; k < n; k++){
                    if(s[i][k] == '1'){
                        push[k] = true;
                        tmp[k][j] += b[i-1][j] != b[i][j];
                        if(b[i-1][j]==b[i][j])  flag[k][j] = true;
                    }
                }
            }
        }
        int notpushed = 0, ind = -1;
        for(int i = 0; i < n; i++)  if(!push[i]) notpushed++, ind = i;
        for(int i = 0; i < m; i++){
            if(cnt[i] == 0){
                cout << (notpushed==1 ? f(ind) : '?');
            }else{
                int tmpcnt = 0, ind = -1;
                for(int j = 0; j < n; j++){
                    if(!flag[j][i] && cnt[i] == tmp[j][i]){
                        tmpcnt++, ind = j;
                    }
                }
                cout << (tmpcnt==1 ? f(ind) : '?');
            }
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 4352
#include<stdio.h>
int main(){
  char s[4];
  scanf("%s",&s);
  if(s[0] != s[1] && s[1] != s[2] && s[2] != s[0]){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(x) (x).erase(unique(all(x)), (x).end());
#define REPIT(x) for(auto it=(x).begin(), end=(x).end(); it!=end; ++it)
#define perm(c) sort(all(c)); for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
  cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
	cout << a;
	if (&a != &vec.back()) cout << " ";
  }
  cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
	print(vec);
  }
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

signed solve()
{
	int x, y;
	cin >> x >> y;

	if (x == 2)
	{
		if (y == 2) print("Yes");
		else print("No");
	}
	else if (x == 4 || x == 6 || x == 9 || x == 11)
	{
		if (y == 4 || y == 6 || y == 9 || y == 11) print("Yes");
		else print("No");
	}
	else
	{
		if (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12) print("Yes");
		else print("No");
	}
	return 0;
}

#ifndef LOCALCODE
signed main()
{
	return solve();
}
#endif


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int x,y,z;
    cin>>x>>y>>z;
    cout<<z<<sp<<x<<sp<<y<<endl;
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back

int main()
{
    ll N;
    cin >> N;
    mat D(N, vec(2));
    REP(i,0,N) cin >> D[i][0] >> D[i][1];

    ll cnt = 0;
    REP(i,0,N) {
        if(D[i][0] == D[i][1]) ++cnt;
        else cnt = 0;
        if(cnt == 3) break;
    }

    if(cnt == 3) PR("Yes");
    else PR("No");

    return 0;
}

/*



*/

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
    char a[100], b[100];
    int s;
    scanf("%d",&s);
    scanf("%s%s",&a,&b);
    for(int i=0;i<s;i++){
        printf("%c%c",a[i],b[i]);
    }

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
using namespace std;
int main(void){
  int n,sum=0,min,sec;
  for(int i=0;i++<4;){
    scanf("%d",&n);
    sum+=n;min=sum/60;sec=sum%60;
  }
  printf("%d\n%d\n",min,sec);
  return 0;
}

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

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int maxi = max(a, max(b, c));
    if(maxi == a) cout << "A" << endl;
    if(maxi == b) cout << "B" << endl;
    if(maxi == c) cout << "C" << endl;
    return 0;
}


Measured memory_bytes: 3072
import java.util.*;

public class Main {
	
	/*
	 * default function
	 * */	
	int ni() {
		return cin.nextInt();
	}
	
	long nl() {
		return cin.nextLong();
	}
	
	String line() {
		return cin.nextLine();
	}
	
	void println(String str) {	
		System.out.println(str);
	}
	
	void print(String str) {
		System.out.print(str);
	}
	
	/*
	 * default variable
	 */
	
	static final int MOD = 1000000007;
	
	Scanner cin = new Scanner(System.in);	
	String  output;
	
	public static void main(String[] args) {			
		new Main().run();						
	}
	/* default above */
		
	public void run() {
			
		input();
		/* 
		 * start
		 */	
		
		solve();
		
		/*
		 * finish
		 */
		
		output = res +"";
		println(output);
			
	}
	/* 
	 * define variable
	 */
	
	int N;
	int[] nums;
	
	long res;
	
	
	void input() {
		
		res = Long.MIN_VALUE;		
		
		N = ni();
		nums = new int[N * 3];
		
		for (int i = 0; i < nums.length; i ++) {
			nums[i] = ni();
		}		
	}
	
	void solve() {
		
		PriorityQueue<Integer> pq1 = new PriorityQueue<>();
		PriorityQueue<Integer> pq2 = new PriorityQueue<>(Collections.reverseOrder());
		
		
		long[] maxLeft  = new long[N + 1];
		long[] minRight = new long[N + 1];
		
		// init
		for (int i = 0; i < N; i ++) {
			maxLeft[0] += nums[i];
			pq1.offer(nums[i]);
			
			minRight[0] += nums[3 * N - 1 - i];
			pq2.offer(nums[3 * N - 1 - i]);
		}
		
		
		// get mid
		for (int i = 1; i <= N; i ++) {
			
			pq1.offer(nums[N + i - 1]);		
			maxLeft[i] = maxLeft[i-1] + nums[N + i - 1] - pq1.peek();				
			pq1.poll();
			
			pq2.offer(nums[2 * N - i]);			
			minRight[i] = minRight[i-1] + nums[2 * N - i] - pq2.peek();
			pq2.poll();			
		}
		
		// get ans
		for (int i = 0; i <= N; i ++) {
			res = Math.max(res, maxLeft[i] - minRight[N - i]);
		}
		
	}
	
}


Measured memory_bytes: 95732
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>

using namespace std;

typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define Fst first
#define Snd second
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repv(t,it,v) for(vector<t>::iterator it = v.begin() ; it != v.end() ; ++it)

int N;
char s[111];
char t[111];
int a;

int main(){
	scanf("%d" , &N);
	scanf(" %s %s" , s , t);
	repm(i,N,0){
		repp(j,0,i){
			if(s[N - i + j] != t[j]) break;
			if(j + 1 == i){
				printf("%d\n", N + N - i);
				return 0;
			}
		}
	}
	printf("%d\n" , N * 2);
	return 0;
}


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

int main() {
  int H, W;
  cin >> H >> W;
  for (int i = 0; i < (W + 2); i++) {
    cout << "#";
  }
  cout << endl;
  for (int i = 0; i < H; i++) {
    string a;
    cin >> a;
    cout << "#" << a << "#" << endl;
  }
  for (int i = 0; i < (W + 2); i++) {
    cout << "#";
  }
  cout << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 2e5 + 10;
int n;
ll a[N], ans;
int main() {
    scanf("%d", &n);
    for(int i = 1 ; i <= n ; ++ i) scanf("%lld", &a[i]), a[i] -= i;
    sort(a + 1, a + 1 + n);
    ll b = a[n / 2 + 1];
    for(int i = 1 ; i <= n ; ++ i) {
        ll t = a[i] - b;
        ans += t < 0 ? -t : t;
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 1792
if isfile("mystdin.txt");mystdin=open("mystdin.txt","r");redirect_stdin(mystdin);end
pI(x)=parse(Int,x)
pM(x::Array{SubString{String},1})=map(pI,x)
function main()
  n=pI(readline())
  a1=pM(split(readline()))
  a2=pM(split(readline()))
  println(maximum([sum(a1[1:i])+sum(a2[i:end]) for i=1:n]))
end
main()
if isdefined(Base, :mystdin);close(mystdin);end

Measured memory_bytes: 167084
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int a[100010],L[100010];	int n;
int lis(){
	L[0]=a[0];
	int l=1;
	for(int i=1;i<n;i++){
		if(a[i]>L[l-1]) L[l++]=a[i];
		else{
			*lower_bound(L,L+l,a[i])=a[i];
		}
	}
	return l;
}
int main(){

	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	printf("%d\n",lis());
}


Measured memory_bytes: 3968
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m =sc.nextInt();
		int[] number = new int[n];
		List<Integer> chohukuList = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			int s = sc.nextInt();
			int c = sc.nextInt();
			if(s == 1 && c ==0 && n !=1) {
				System.out.println(-1);
				return;
			}
			if(chohukuList.indexOf(s-1) != -1 && number[s-1] != c) {
				System.out.println(-1);
				return;
			}
			number[s-1] = c;
			chohukuList.add(s-1);
		}
		StringBuilder answer = new StringBuilder();
		for(int i = 0; i < n; i++) {
			if(i == 0 && number[i] ==0 && n !=1) {
				answer.append(1);
			}else {
				answer.append(number[i]);
			}
		}
		System.out.println(answer);

	}
}

Measured memory_bytes: 24148
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#define rep(i, n) rep2(i,0,n)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using namespace std;


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

	double b = n - int(n / 2);

	double a = b / n;
	cout << a << endl;
}

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

int N, arr[100];

int main(){		
	int m = INT_MAX;
	scanf("%d", &N);
	for(int i = 0; i < N; i++) scanf("%d", &arr[i]);
	for(int i = 0; i < N - 1; i++){
		int a = 0, b = 0;
		for(int j = 0; j < N; j++)
			if(j <= i) a += arr[j];
			else if(j > i) b += arr[j];
		m = min(m, abs(a - b));
	}
	printf("%d\n", m);
	return 0;
}


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

main()
{
    int W,H,x,y,r;
    cin >> W >> H >>x >> y >> r;
    if (W - x >= r and H - y >= r and x >= r and y >= r)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N,M;
    cin >> N >> M;

    vector<bool> a(N),b(N);
    for(int i = 0;i < M;i++){
        int x,y;
        cin >> x >> y;
        if(x == 1)a[y-1] = true;
        if(y == N)b[x-1] = true;
    }
    for(int i = 0;i < N;i++){
        if(a[i]&&b[i]){
            cout <<"POSSIBLE"<< endl;
            return 0;
        }
    } 
    cout << "IMPOSSIBLE" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
long long n;
long long find(long long n){
	long long sum=0;
	while(n){
		int tem=n%10;
		n/=10;
		sum+=tem;
	}
	return sum;
}
int getsum(long long n){
	int sum=0,flag=0;
	while(n){
		sum++;
		flag=n%10;
		n/=10;
	}
	return (sum-1)*9+flag-1;
}
int main(){
	long long i,j,ans;
	scanf("%lld",&n);
	ans=find(n);
	for(i=n-1;i>=n-10;i--){
		long long temp=find(i);
		if(temp>ans)
			ans=temp;
	}
	long long tt=getsum(n);
	if(ans<tt) ans=tt;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 128