akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < n; i++)
#define REPR(i,n) for(int i = n; i >= 0; i--)
#define FOR(i,m, n) for(int i = m-1; i < n; i++)
#define INF 2000000000
#define ALL(v) v.begin(), v.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))
#define FILL2D(A,c) fill(A[0], A[0] +sizeof(A)/sizeof(**A),c)
#define FILL3D(A,c) fill(A[0][0], A[0][0] +sizeof(A)/sizeof(***A),c)
//vector<vector<要素の型>> 変数名(要素数1, vector<要素の型>(要素数2, 初期値))
//vector<intなど> 変数名(要素数,初期値)
using namespace std;
typedef long long ll;
//gcd,lcmセット
ll gcd(ll a, ll b){
   if (a%b == 0) return b;
   else return gcd(b, a%b);
}
ll lcm(ll a, ll b){	
   return a*b/gcd(a, b);
}
bool isPrime(ll x){
    int i;
    if(x < 2)return false;
    else if(x == 2) return true;
    if(x%2 == 0) return false;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return false;
    return true;
}
//dfsではvector<vector<int>> g(n);で◎
int main(){
    ll n,k;
    cin>>n>>k;
    ll ans=1;
    REP(i,n) ans=min(ans+k,ans*2);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
s = input()
n = len(s)

for i in range(n-1):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        exit()

for i in range(n-2):
    if s[i] == s[i+2]:
        print(i+1, i+3)
        exit()

print(-1, -1)


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

#define M_PI    3.14159265358979323846
int main()
{
 int N,M,sum=0;
  int A[10000];
  cin>>N>>M;
  
  for(int i=0;i<M;i++)
  {
    cin>>A[i];
   sum+=A[i];
  }
  
  if((N-sum)>=0)
    cout<<N-sum;
  else
    cout<<"-1";
 return 0;
} 

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

typedef long long lint;
typedef long double louble;

template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}

const char lf = '\n';

namespace ae86
{
	const int bufl = 1<<15;

	char buf[bufl],*s=buf,*t=buf;

	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}

	inline int ty()
	{
		int a=0,b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

#define pick(a,b) (((a)>>(b))&1)

const int _ = 17 , __ = _ + _ , _s = 1 << 16 , mo = 1000000007;

inline lint powa(lint a,lint t)
{
	lint b=1;
	while(t){if(t&1)b=b*a%mo;a=a*a%mo,t>>=1;}
	return b;
}

inline lint inva(lint a)
{
	return powa(a,mo-2);
}

const lint inv9 = inva(9);

int bfa[__]={0},col[__]={0},ccnt=0,cc;
int findbfa(int x){return bfa[x]==x?x:bfa[x]=findbfa(bfa[x]);}
inline void linka(int a,int b){bfa[findbfa(b)]=findbfa(a);}

int n,m,ql[_],qr[_],xl[__],xr[__],ha[__],lha;
lint val[__]={0},f[9][_s]={0},coef[_s]={0};

int main()
{
	ios::sync_with_stdio(0),cout.tie(nullptr);

	n=ty(),m=ty(),lha=0;
	for(int i=0;i<m;i++)ha[lha++]=ql[i]=ty()-1,ha[lha++]=qr[i]=ty();
	
	ha[lha++]=0,sort(ha,ha+lha),lha=unique(ha,ha+lha)-ha;

	for(int i=0;i<lha;i++)bfa[i]=i;
	for(int i=0;i<m;i++)
	{
		ql[i]=lower_bound(ha,ha+lha,ql[i])-ha;
		qr[i]=lower_bound(ha,ha+lha,qr[i])-ha;
		linka(ql[i],qr[i]);
	}

	for(int i=0;i<lha;i++)if(findbfa(i)==i)col[i]=ccnt++;
	for(int i=0;i<lha;i++)col[i]=col[findbfa(i)];
	
	lint bas=inv9;
	for(int i=1;i<lha;i++)
	{
		xl[i]=col[i],xr[i]=col[i-1];
		lint temp=(powa(10,ha[i]-ha[i-1])-1+mo)%mo*inv9%mo;
		bas=bas*temp%mo,val[i]=(temp+1)*inva(temp)%mo;
	}
	if(ha[lha-1]<n)bas=bas*powa(10,n-ha[lha-1])%mo;
	
	cc=1<<ccnt;
	for(int i=0;i<cc;i++)
	{
		coef[i]=1;
		for(int j=1;j<lha;j++)if(pick(i,xl[j]) && pick(i,xr[j]))coef[i]=coef[i]*val[j]%mo;
		f[0][i]=coef[i];
	}

	for(int i=0;i<8;i++)
		for(int j=0;j<cc;j++)
			for(int k=cc-1-j;k>=0;k=(k-1)&(cc-1-j))
			{
				f[i+1][j+k]=(f[i+1][j+k]+f[i][j]*coef[k]%mo)%mo;
				if(k<=0)break;
			}
	
	cout<<bas*f[8][cc-1]%mo<<lf;
	
	return 0;
}


Measured memory_bytes: 5376
//Badwaper gg
#include<bits/stdc++.h>
#define inf 1e9
#define eps 1e-6
#define mp make_pair
#define pb push_back
#define re register ll
#define fr first
#define sd second
#define FOR(i,a,b) for(re i=a;i<=b;i++)
#define REP(i,a,b) for(re i=a;i>=b;i--)
#define lowbit(x) x&(-x)
#define Z(x) (x>=mod?x-mod:x)
#define N 510
#define pa pair<int,int>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline ll read()
{
	char ch=getchar();
	ll s=0,w=1;
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
	return s*w;
}
pa a[N];int n,mod;
int f[N][N];
inline int Solve(int t)
{
	memset(f,0,sizeof(f));
	int c1=0,c2=0;f[0][0]=1;
	FOR(i,0,2*n-1)
	{
		if(a[i].sd==0){FOR(j,0,c2)f[i+1][j]=Z(f[i+1][j]+1LL*f[i][j]*(a[i].fr-(j+c1)+1)%mod);c1++;}
		else
		{
			FOR(j,0,c2)f[i+1][j]=Z(f[i+1][j]+1LL*f[i][j]*(a[i].sd-(n+c2+t-j)+1)%mod);
			FOR(j,0,c2)f[i+1][j+1]=Z(f[i+1][j+1]+1LL*f[i][j]*(a[i].fr-(c1+j)+1)%mod);
			c2++;
		}
	}
	return f[2*n][t];
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	n=read(),mod=read();
	FOR(i,0,n-1)
	{
		a[i].fr=0,a[i].sd=2*n-1;
		while(a[i].fr*a[i].fr+i*i<n*n)a[i].fr++;a[i].fr--;
		while(a[i].sd*a[i].sd+i*i>4*n*n)a[i].sd--;
	}
	FOR(i,n,2*n-1)
	{
		a[i].fr=2*n-1,a[i].sd=0;
		while(a[i].fr*a[i].fr+i*i>4*n*n)a[i].fr--;
	}
	sort(a,a+2*n);int c=1,ans=0;
	FOR(i,0,n)ans=Z(ans+1LL*c*Solve(i)%mod),c=mod-c;
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 4784
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>  // std::setprecision()
using namespace std;
using ll = long long;
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define pai 3.14159265358979323846
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main() {
    int a,b,h,m;
    cin >> a >> b >>h >>m;
    double diff = abs((double)h/12 * 360 + (double)m/60 * 30 - (double) m/60 * 360);
    double ans = sqrt(pow(b,2) + pow(a,2) -2 * a * b * cos(diff*(pai/180)));
    cout << setprecision(20) << ans << endl;

}

Measured memory_bytes: 3608
# FROM : https://atcoder.jp/contests/abc076/submissions/3723095
N = int(input()) 
T = list(map(lambda x: int(x)*2, input().split()))
V = list(map(lambda x: int(x)*2, input().split())) + [0]

sumt = sum(T)
maxv  = [min(i,sumt-i) for i in range(sumt+1)]

ct = 0
for t,v in zip(T,V):
    for i in range(ct, ct+t+1):
        maxv[i] = min(maxv[i], v)
    ct += t

for i in range(sumt):
    maxv[i+1] = min(maxv[i+1], maxv[i]+1)

for i in reversed(range(sumt)):
    maxv[i] = min(maxv[i], maxv[i+1] + 1)

print(float( sum(maxv) ) / 4)



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

int main()
{
	string s;
	cin>>s;
	
	char a;
	for(a='a';a<='z';a++){
		bool f=1;
		for(int i=0;i<s.length();i++){
			if(a==s[i]){
				f=0;
				break;
			}
		}
		if(f==1) break;
	}
	
	if('a'<=a&&a<='z') cout<<a<<endl;
	else cout<<"None"<<endl;
	
	return 0;
}


Measured memory_bytes: 512
n,k = map(int,input().split())
dice = list(map(int,input().split()))

dice_cumsum = [0]*(n+1)

for i in range(1,n+1):
    dice_cumsum[i] = dice_cumsum[i-1] + dice[i-1]
    
max_n = 0
max_i = 0
for i in range(n-k+1):
    sum_dice = dice_cumsum[k+i] - dice_cumsum[i]
    if sum_dice > max_n:
        max_n = sum_dice
        max_i = i

sum_odds = 0
for i in range(k):
    sum_odds += (dice[max_i+i]-1)*0.5+1

print(sum_odds)

Measured memory_bytes: 25060
#!/usr/bin/env python3

#from collections import defaultdict
#from heapq import heappush, heappop
#import numpy as np
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7

debug_indent = 0


def debug(*x):
    global debug_indent
    x = list(x)
    indent = 0
    if x[0].startswith("enter") or x[0][0] == ">":
        indent = 1
    if x[0].startswith("leave") or x[0][0] == "<":
        debug_indent -= 1
    x[0] = "  " * debug_indent + x[0]
    print(*x, file=sys.stderr)
    debug_indent += indent


def solve(N, XS):
    return sum([1 for x in range(0, N, 2) if XS[x] % 2])


def main():
    # parse input
    N = int(input())
    XS = list(map(int, input().split()))
    print(solve(N, XS))


# tests
T1 = """
15
13 76 46 15 50 98 93 77 31 43 84 90 6 24 14
"""


def test_T1():
    """
    >>> as_input(T1)
    >>> main()
    result
    """
# add tests above


def _test():
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())

    def input():
        return bytes(f.readline(), "ascii")

    def read():
        return bytes(f.read(), "ascii")


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import solve  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        print("testing")
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()


Measured memory_bytes: 9280
import os

def main():
	num_strings = ""
	a,b = map(int, input().split())
	if a <= b:
		for i in range(b):
			num_strings += str(a) 
	else:
		for i in range(a):
			num_strings += str(b)
	
	print(num_strings)

if __name__ == '__main__':
	main()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(register int i = a; i <= b; i++)
#define per(i, a, b) for(register int i = a; i >= b; i--)
typedef long long LL;
const LL mod = 1e9 + 7;
const int N = 3e5 + 5;

LL a[N], ans;
int n;

int main() {
	cin>>n;
	rep(i, 1, n) {
		cin>>a[i];
		ans = (ans + a[i - 1]*a[i])%mod;
		a[i] = (a[i] + a[i - 1]%mod);
	}
	cout<<ans<<endl;
}

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

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

    long long a[300000];
    long long b[300000];

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

    sort(a, a+N);
    sort(b, b+N);

    long long ans;
    if( N % 2 == 0){
        ans = (b[N/2] + b[N/2 -1])  -  (a[N/2] + a[N/2 -1]) +1;
    }else{
        ans = ( b[N/2]  - a[N/2] ) + 1;
    }

    cout << ans << endl;

}


Measured memory_bytes: 6776
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

const int MOD=1e9+7;
const int N=1e5;
int dp[N][2];
vector<int>g[N+1];
int n;

void dfs(int u,int p){
	dp[u][0]=1;
	dp[u][1]=1;
	for(auto v:g[u])
	{
		if(v!=p)
		{
			dfs(v,u);
			dp[u][0]*=dp[v][1];
			dp[u][0]%=MOD;
			dp[u][1]*=(dp[v][0]+dp[v][1]);
			dp[u][1]%=MOD;
		}
	}
}
int32_t main()
{
   IOS
   cin>>n;
   for(int i=1;i<n;i++)
   {
	   int u,v;cin>>u>>v;
	   g[u].push_back(v);
	   g[v].push_back(u);
   }
   dfs(1,0);
   cout<< (dp[1][0]+dp[1][1])%MOD << endl;
}


Measured memory_bytes: 14208
function Dice(labels) {
    this.top = labels[0];
    this.back = labels[1];
    this.right = labels[2];
    this.left = labels[3];
    this.front = labels[4];
    this.bottom = labels[5];
};

Dice.prototype.roll = function(direction) {
    switch (direction) {
        case 'W':
            var tmp = this.left;
            this.left = this.top;
            this.top = this.right;
            this.right = this.bottom;
            this.bottom = tmp;
            break;
        case 'N':
            var tmp = this.front;
            this.front = this.top;
            this.top = this.back;
            this.back = this.bottom;
            this.bottom = tmp;
            break;
        case 'E':
            var tmp = this.right;
            this.right = this.top;
            this.top = this.left;
            this.left = this.bottom;
            this.bottom = tmp;
            break;
        case 'S':
            var tmp = this.back;
            this.back = this.top;
            this.top = this.front;
            this.front = this.bottom;
            this.bottom = tmp;
            break;
    }
};

(function(input) {
    var p = input.split('\n');
    var labels = p.shift().split(' ').map(Number);
    var rolls = p.shift().split('');
    var dice = new Dice(labels);
    rolls.forEach(function(e) {
        dice.roll(e);
    });
    console.log(dice.top);
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int main() {
  long long H,N,X=0;
  cin >> H >> N;
  vector<long long>vec(N);
  for(int i=0; i<N; i++){
    cin >> vec[i];
    X += vec[i];
  }
  if(X<H){
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 3984
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a,c=0;
    cin>>n;
    for(int i=1;i<=n;i++){
    	cin>>a;
    	if(a%2!=0 && i%2!=0){
    		c++;
		}
	}
	cout<<c;

}


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

unsigned int gcd(unsigned int n1, unsigned int n2)
{
    unsigned int tmp;
    while (n2 != 0) {
        tmp = n1;
        n1 = n2;
        n2 = tmp % n2;
    }
    return n1;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, x[100000];
    cin >> n;
    for (int i = 0; i <= n; i++) {
        cin >> x[i];
    }
    sort(x, x + n + 1);
    if (n == 1) {
        cout << x[1] - x[0] << endl;
        return 0;
    }
    ll ans = gcd(x[2] - x[1], x[1] - x[0]);
    for (int i = 2; i < n; i++) {
        ans = gcd(x[i + 1] - x[i], ans);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.Collections;
import java.util.Arrays;
import java.lang.Math;

public class Main {
	public static void main(String[] args) {
		FS reader = new FS();
		// write reader
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		if (A <= C && C <= B) System.out.println("Yes");
		else System.out.println("No");
	}
	
	public static void solver(long K, long[] A) {
		// write logic
	}
	
	// Read Class
	static class FS {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
	
		private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
		private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
		private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
	
		public boolean hasNext() { skipUnprintable(); return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public int nextInt() {
			return (int)nextLong();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if(b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}


Measured memory_bytes: 23124
#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    int a, b;
    cin >> a >> b;
    for (int p = 1, nr = 1; nr < 999; p += nr + 1, ++nr)
    {
        int d = p + nr + 1;
        if (p - a == d - b)
        {
            cout << p - a;
            return 0;
        }
    }
}


Measured memory_bytes: 256
import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

void main(){

    int n = readln().chomp().to!int;
    for(int i=0;i<n;i++){
	int point,o,r;
	while(true){
	    string s = readln().chomp();
	    if(s == "HIT"){
		r = 2 * r + 1;
		if(r & (1<<3)){
		    r ^= 1 << 3;
		    point++;
		}
	    }else if(s == "OUT"){
		o++;
		if(o == 3) break;
	    }else if(s == "HOMERUN"){
		point += 1 + (r & 1) + (r & 2)/2 + (r & 4)/4;
		r = 0;
	    }
	}
	writeln(point);
    }

}

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

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

            var rest = (x % 10) + (x / 10 % 10) * 10;
            while (x >= 100)
            {
                if (rest >= 5)
                {
                    x -= 105;
                    rest -= 5;
                }
                else
                {
                    x = 0;
                }
            }

            Console.WriteLine(x == 0 ? 1 : 0);
        }
    }
}


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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    int t = c - a - b;
    if (t <= 0)
        print("No");
    else
        yn(4 * a * b < t * t);

    return 0;
}


Measured memory_bytes: 256
#147_C
n = int(input())
ans = 0

pr = [[] for i in range(n)]
for i in range(n):
    a = int(input())
    for _ in range(a):
        x, y = map(int, input().split())
        pr[i].append((x-1, y))

for i in range(2 ** n):
    flg = True
    res = 0
    for j in range(n):
        if (i >> j) & 1:
            res += 1
            for k in range(len(pr[j])):
                x, y = pr[j][k]
                if ((i >> x) & 1 and y == 0) or (not((i >> x) & 1) and y == 1):
                    flg = False
                    break
    if flg:
        ans = max(ans, res)
        
print(ans)
                    

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

int main() {
	// your code goes here
	int n;
	string s, t;
	cin >> n;
	cin >> s >> t;
	for(int i=0; i<n; i++){
		cout << s.at(i) << t.at(i);
	}
	return 0;
}

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

int main()
{
	int n, k, q;
	cin >> n >> k >> q;
	vector<int> count(n + 1, 0);

	int a;
	for (int i = 0; i < q; ++i) {
		cin >> a;
		++count[a];
	}

	int lim = q - k + 1;
	for (int i = 1; i <= n; ++i) {
		if (lim <= count[i]) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <tuple>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cmath>

using namespace std;

int main() {
    string s, t, u;
    int a, b;
    cin >> s >> t >> a >> b >> u;

    if (u == s) {
        a--;
    } else {
        b--;
    }

    cout << a << " " << b << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,l,r) for(int (i)=(l);(i)<(r);(i)++)
#define ll long long
using namespace std;
int main(){
    int n;
    string s;
    cin>>s;
    
    if(s!="AAA"&&s!="BBB")cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

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

int main() {
    int N;
    string S;
    cin >> N;
    cin >> S;
    if(N%2 == 1){
    	cout << "No\n";
    	return 0;
    }
    
    int ans = 1;
    for(int i=0;i<N/2;i++){
    	if(S[i] != S[i+N/2]){
    		ans = 0;
    	}
    }
    if(ans==0){
    	cout << "No\n";
    }else{
    	cout << "Yes\n";
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int k = sc.nextInt();
        if (e - a <= k)
            System.out.println("Yay!");
        else
            System.out.println(":(");
    }
}

Measured memory_bytes: 21972
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

int main()
{
    int n, t;
    std::cin >> n >> t;
    std::vector<std::pair<int, int>> vec(n);
    int a, b;
    for (int i = 0; i < n; ++i)
    {
        std::cin >> a >> b;
        vec[i].first = a;
        vec[i].second = b;
    }

    std::sort(vec.begin(), vec.end(), [](std::pair<int, int> l, std::pair<int, int> r) { return l.second < r.second; });
    std::vector<int> vec2;
    for (int i = 0; i < n; ++i)
    {
        if (vec[i].second <= t) { vec2.push_back(vec[i].first); }
    }
    std::sort(vec2.begin(), vec2.end());
    if (vec2.size() == 0)
    {
        std::cout << "TLE" << std::endl;
        return 0;
    }
    else
    {
        std::cout << vec2[0] << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
function main(input){
  var n = parseInt(input.split("\n")[0]);
  var s = input.split("\n")[1];
  var cnt = 0;
  var ans = [0];
  
  for (i=0; i<n; i++){
    if (s[i] == "I"){
      cnt = cnt+1;
    }else{
      cnt = cnt-1;
    }
    ans.push(cnt);
  }
  
  console.log(Math.max.apply(null, ans))
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

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

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

#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
// end of Template

ll r;
int main(){

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

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>r;
    cout<<3*r*r<<newl;

}


Measured memory_bytes: 256
package main

import (
	"fmt"
  	"os"
  	"bufio"
  	"strconv"
)

var sc = bufio.NewScanner(os.Stdin) 

func tran() string{  
  sc.Scan()
  
  return sc.Text()
}

func main(){
  var num_str = tran()
  N, _ := strconv.Atoi(num_str)
  cnt := 0
  for i:= 1; i <= N; i++{
    s := strconv.Itoa(i)
    if len(s) % 2 == 1{
    	cnt++
    }
    
  }
 	fmt.Println(cnt)
}

Measured memory_bytes: 1152
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N = get_int

test = []
0.step(25) do |four|
  0.step(15) do |seven|
    test << 4 * four + 7 * seven
  end
end

if test.include?(N)
  puts 'Yes'
else
  puts 'No'
end


Measured memory_bytes: 14448
n,m=map(int,input().split())
S=[]
for i in range(m):
  S.append([int(i) for i in input().split()])
P=[int(i) for i in input().split()]
ans=0
for i in range(2**n):
  t=0
  for j in range(m):
    p=0
    for k,s in enumerate(S[j]):
      if k==0:
        continue
      else:
        if i&(1<<(s-1)):
          p+=1
    if p%2==P[j]:
      t+=1
  if t==m:
    ans+=1
print(ans)





Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?2e18:1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	int out=0;
	cin>>n;
	rep(i,n){
		int a,b;
		cin>>a>>b;
		out+=b-a+1;
	}
	cout<<out<<endl;
}








Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        String s = sc.next();
        PrintWriter out = new PrintWriter(System.out);

        if (a >= 3200) {
            out.println(s);

        } else {
            out.println("red");
        }

        out.flush();
        sc.close();

    }
}

Measured memory_bytes: 35832
function Main(input) {
    input = input.trim();
    input = input.split("\n")
    input = input.map(e=>e.split(" ").map(f=>parseInt(f)))

    var sunuke = []

    input.forEach((e,i)=>{        
        if(i!=0 && i%2==0){            
            e.forEach(f=>{                
                sunuke.push(f)
            })
        }   
    })

    var b = sunuke.filter(function (x, i, self) {
        return self.indexOf(x) === i;
    });

    console.log(input[0][0]-b.length)

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 30364
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int x, a, b, c, d;
    int aa = 0;
    while(cin >> x, x){
        if(aa) puts("");
        aa++;
        scanf("%d%d%d%d", &a, &b, &c, &d);
        array<int, 4> ans{};
        int sum = 400;
        for (int i = 0; i <= a; ++i) {
            for (int j = 0; j <= b; ++j) {
                for (int k = 0; k <= c; ++k) {
                    for (int l = 0; l <= d; ++l) {
                        int s = 10*i+50*j+100*k+500*l;
                        if(x > s) continue;
                        int p = s-x, f = a+b+c+d-(i+j+k+l);
                        f += p/500; p %= 500;
                        f += p/100; p %= 100;
                        f += p/50; p %= 50;
                        f += p/10;
                        if(sum > f) ans = {i, j, k, l}, sum = f;
                    }
                }
            }
        }
        if(ans[0]) printf("10 %d\n", ans[0]);
        if(ans[1]) printf("50 %d\n", ans[1]);
        if(ans[2]) printf("100 %d\n", ans[2]);
        if(ans[3]) printf("500 %d\n", ans[3]);
    }
    return 0;
}



Measured memory_bytes: 3076
// キョウプロ.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#pragma once

#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

long long A, B, C, D, M, N, X, Y, Z;


int main()
{

	cin >> A >> B;

	if (A == B) {
		C = A + B;
	}
	else {
		C = max(A, B) * 2 - 1;
	}

	cout << C << endl;

    return 0;
}



Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n := nextInt(sc)
	a := make([]int, n)
	for i := range a {
		a[i] = nextInt(sc)
	}
	m := nextInt(sc)
	b := make([]int, m)
	for i := range b {
		b[i] = nextInt(sc)
	}
	wtr := bufio.NewWriter(os.Stdout)
	for i := 0; i < min(n, m); i++ {
		if a[i] > b[i] {
			fmt.Fprintln(wtr, "0")
			wtr.Flush()
			return
		} else if b[i] > a[i] {
			fmt.Fprintln(wtr, "1")
			wtr.Flush()
			return
		}
	}
	if m > n {
		fmt.Fprintln(wtr, "1")
	} else {
		fmt.Fprintln(wtr, "0")
	}
	wtr.Flush()
}



Measured memory_bytes: 1120
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

LL N, L, origin;

int main()
{
	in >> N >> L;
	std::vector<LL>a(N);
	rep(i, N) in >> a[i];
	rep(i, N - 1)
	{
		if (a[i] + a[i + 1] >= L)
		{
			origin = i + 1;
			break;
		}
	}
	if (origin == 0) out << "Impossible" << std::endl;
	else
	{
		out << "Possible" << std::endl;
		for (LL i = 1; i < origin; ++i) out << i << std::endl;
		for (LL i = N - 1; i > origin; --i) out << i << std::endl;
		out << origin << std::endl;
	}
	return 0;
}


Measured memory_bytes: 1664
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;

public class Main {

    static long ans = 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        Map<Integer, Set<Integer>> map = new TreeMap<>();
        for (int i = 0; i < m; i++) {
            int a = Integer.parseInt(sc.next()) - 1;
            int b = Integer.parseInt(sc.next()) - 1;
            if (map.containsKey(a)) {
                map.get(a).add(b);
            } else {
                Set<Integer> set = new HashSet<>();
                set.add(b);
                map.put(a, set);
            }
            if (map.containsKey(b)) {
                map.get(b).add(a);
            } else {
                Set<Integer> set = new HashSet<>();
                set.add(a);
                map.put(b, set);
            }
        }
        int ans = 0;
        for (Map.Entry<Integer, Set<Integer>> e : map.entrySet()) {
            int num = e.getKey();
            boolean isHigh = true;
            for (Integer s : map.get(num)) {
                if (h[num] <= h[s]) {
                    isHigh = false;
                    break;
                }
            }
            if (isHigh) {
                ans++;
            }
        }
        ans += n - map.size();
        System.out.println(ans);
    }
}

Measured memory_bytes: 98428
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
const double PI  = 3.1415926535897932384626433832795028841971;
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll n, x;
ll ans = 0;

ll f(ll a, ll b){
	if(b > a) swap(a,b);
	ll ret = b*(a/b)*2;
	a %= b;
	if(a == 0) return ret-b;
	else return ret + f(b,a);
}

int main(){
	cin >> n >> x;
	ans = n;
	ans += f(x,n-x);
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import java.math.*;

public class Main {
	public void run(){
		Scanner sc = new Scanner(System.in);
		char[] in = sc.next().toCharArray();
		int size = in.length;
		int ret = 0;
		for(int i = 0; i < (size+1)/2;i++){
			if(in[i] == 'i'){
				if(in[size-i-1] != 'i'){
					ret++;
				}
			}
			if(in[i] == 'w'){
				if(in[size-i-1] != 'w'){
					ret++;
				}
			}
			if(in[i] == '('){
				if(in[size-i-1] != ')'){
					ret++;
				}
			}
			if(in[i] == ')'){
				if(in[size-i-1] != '('){
					ret++;
				}
			}
		}
		System.out.println(ret);
	}
	public static void main(String Args[]){
		Main t = new Main();
		t.run();
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <fstream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <algorithm>

#define MOD_BIG 1000000007
using std::string;
using std::cin;
using std::cout;
using std::endl;
typedef long long ll;
using std::vector;
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) {
    vec.resize(len);
    for (auto &v : vec) ndarray(v, args...);
}

//////////////////////////////////////



//////////////////////////////////////

int main() {
    
    int N;
    cin >> N;
    vector<ll> H(N);
    for (int i = 0; i < N; i++) {
        ll h;
        cin >> h;
        H[i] = h;
    }
    bool ans = true;
    ll migi = std::numeric_limits<ll>::max();
    for (int i = N-1; i >= 0; i--) {
        ll h = H[i];
        //cout << h << ", " << migi << endl;
        
        if (h > migi) {
            if (h-1 == migi) {
                h -= 1;
            } else {
                ans = false;
                break;
            }
        }
        
        migi = h;
    }
    
    if (ans) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main(){
  int d,t,s;
  cin>>d>>t>>s;
  
if(d-t*s<=0)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}

Measured memory_bytes: 3048
#include<iostream>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
#include<set>
#include<map>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
#pragma unused(M)

string s;
int pos;

bool judge(string str){
    if(s.find(str, pos) == pos){
        pos += str.size();
        if(str == "dreamer" && pos != s.size() && s[pos] == 'a'){
            pos -= str.size();
            return false;
        }
        return true;
    }
    return false;
}

int main(){
    cin >> s;
    while(1){
        int ppos = pos;
        if(judge("dreamer")){ continue; }
        if(judge("dream")){ continue; }
        if(judge("eraser")){ continue; }
        if(judge("erase")){ continue; }
        if(pos == s.size()){
            cout << "YES" << endl;
            return 0;
        }
        if(pos == ppos){ break; }
    }
    cout << "NO" <<endl;
    return 0;
}


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

using namespace std;

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false); cin.tie(0);
	int h, w, k;
	cin >> h >> w >> k;
	vector<string> a(h);
	for (int i = 0; i < h; i++) cin >> a[i];

	int ans = 0;
	for (int x = 0; x < (1 << h); x++)
		for (int y = 0; y < (1 << w); y++) {
			int c = 0;
			for (int i = 0; i < h; i++)
				for (int j = 0; j < w; j++)
					if (a[i][j] == '#' && (x & (1 << i)) == 0 && (y & (1 << j)) == 0)
						c++;
			if (c == k) ans++;
		}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<cmath>
using namespace std;
long long A, B, C;
long long mm, box1, box2, ans;

int main()
{
	cin>>A>>B>>C;
	mm = A>>1;
	box1 = mm*B*C;
	box2 = (A-mm)*B*C;
	ans = abs(box1-box2);
	
	mm = B>>1;
	box1 = mm*A*C;
	box2 = (B-mm)*A*C;
	if(abs(box1-box2)<ans)	ans = abs(box1-box2);
	
	mm = C>>1;
	box1 = mm*B*A;
	box2 = (C-mm)*B*A;
	if(abs(box1-box2)<ans)	ans=abs(box1-box2);
	
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7

def main():
    N, K = (int(_) for _ in input().split())

    fact = [0] * (N + 1) # fact[n] = n!
    ifact = [0] * (N + 1)
    
    for i in range(N+1):
        if i == 0:
            fact[i] = 1
            continue
        fact[i] = i * fact[i-1]
        fact[i] %= MOD
    ifact[N] = pow(fact[N], MOD-2, MOD)
    for i in range(N)[::-1]:
        ifact[i] = ((i+1) * ifact[i+1])%MOD

    ret = 0
    for m in range(min(K, N-1) + 1):
        ret += (fact[N] * ifact[m] * ifact[N-m])%MOD * (fact[N-1] * ifact[N-m-1] * ifact[m])%MOD
        ret %= MOD
    print(ret%MOD)

    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 18804
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,n) for (int i=(n-1);i >= 0;i--)
#define all(v) v.begin(),v.end()
#define sz(v) (int)((v).size())
#define MAX(v) *max_element(all(v))
#define MIN(v) *min_element(all(v))
using namespace std; using ll = long long; using P = pair<int,int>;
using vl = vector<ll>; using vvl = vector<vl>;
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
template<class T>bool chmax(T &a, const T &b) {if(a<b){a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a){a=b; return 1;} return 0;}
const ll INF = 1LL << 60;
const int dx[8] = {1,0,-1,0,1,1,-1,-1}; const int dy[8] = {0,1,0,-1,1,1,-1,-1};

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    ll n,m;
    cin >> n >> m;
    vl a(n);
    rep(i,n) cin >> a[i];
    ll sum = 0;
    rep(i,n){
        sum += a[i];
    }
    double th = sum/(4.0*m);
    // cout << fixed <<setprecision(10) <<th << endl;
    ll cnt = 0;
    rep(i,n){
        if((double)a[i] >= th) cnt++;
    }
    if(cnt >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int 
#define append push_back
#define mp make_pair
#define endl "\n"
#define MOD 1e9+7 

template <typename T>
void print(T AA[], int nn){for(int ii=0; ii<nn; ii+=1){cout<<AA[ii]<<" ";}cout<<endl;}
template <typename T> inline void print(T nn){ cout << nn << endl;}
/* ----------------------------------------------------------------------------------- */

const int N = 1e5+1;
int A[N], cache[N], n;

int fn(int i){
    if(i==n-1) return 0;
    if(cache[i] != -1) return cache[i];
    int ans = LONG_MAX;
    for(int j=1; j<=2; j+=1){
        if(i+j<n) ans = min(ans, abs(A[i]-A[i+j])+fn(i+j));
    }
    cache[i] = ans;
    return ans;
}

int32_t main(){

    IOS
    
    memset(cache, -1, sizeof(cache));
    cin >> n;
    for(int i=0; i<n; i+=1) cin >> A[i];
    print(fn(0));  
    return 0;
}

Measured memory_bytes: 6528
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for a in range(0, A + 1):
    for b in range(0, B + 1):
        for c in range(0, C + 1):
            res = 500 * a + 100 * b + 50 * c
            if (X == res):
                ans += 1

print(ans)


Measured memory_bytes: 39664
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 2e5 + 10;
const int INF = 0x3f3f3f3f;
double x;
int main() {
	cin >> x;
	printf("%.12f\n", (x / 3)*(x / 3)*(x / 3));
	return 0;
}

Measured memory_bytes: 256
import sys

input = sys.stdin.readline

h, w, k = map(int, input().split())
s = [input() for _ in range(h)]

cs = [[0] * (w + 1) for _ in range(h + 1)]
for i in range(h):
    for j in range(w):
        cs[i + 1][j +
                  1] = cs[i][j + 1] + cs[i + 1][j] - cs[i][j] + int(s[i][j])


def f(i1, j1, i2, j2):
    return cs[i1][j1] - cs[i1][j2] - cs[i2][j1] + cs[i2][j2]


ans = h + w
for bit in range(1 << (h - 1)):
    border = [0]
    cand = 0
    for i in range(h):
        if (bit >> i) & 1:
            border.append(i + 1)
            cand += 1
    border.append(h)

    j0 = 0
    for j in range(w):
        for i in range(len(border) - 1):
            if f(border[i + 1], j + 1, border[i], j0) > k:
                cand += 1
                j0 = j

    is_possible = True
    for i in range(len(border) - 1):
        if f(border[i + 1], w, border[i], j0) > k:
            is_possible = False
            break

    if is_possible:
        ans = min(ans, cand)
print(ans)


Measured memory_bytes: 43612
N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7

class mod_pack:

    def __init__(self, MOD, MAX):
        self.MOD = MOD
        self.MAX = MAX
        self.fac, self.ifac = [1]*(MAX+1), [1]*(MAX+1)
        for i in range(1, MAX+1):
            self.fac[i] = self.fac[i-1]*i % MOD
            self.ifac[i] = self.ifac[i-1] * self.mpow(i, MOD-2) % MOD
    
    def mpow(self, x, n):
        ans = 1
        while n!=0:
            if n&1: ans = ans*x % self.MOD
            x = x*x % self.MOD
            n = n >> 1
        return ans

    def mcomb(self, m, n):
        if (m==0 and n==0): return 1
        return (self.ifac[m-n] * self.ifac[n] % self.MOD) * self.fac[m] % self.MOD

    def mperm(self, m, n):
        if (m < n): return 0
        return self.ifac[m-n] * self.fac[m] % MOD
    

mp = mod_pack(10**9+7, M)

tot = mp.mperm(M, N)
ans = 0
for k in range(1, N+1):
#    print(k, mp.mcomb(N, k), mp.mperm(M-k, N-k))
    ans = (ans + (-1)**(k-1) * mp.mcomb(N, k) * mp.mperm(M-k, N-k)) % MOD


print((tot * (tot - ans))%MOD)



Measured memory_bytes: 83296
#include <stdio.h>
#include <string.h>

int main(void)
{
	char c1[10];
	char c2[1000];
	int c=0,a;
	
	scanf("%s",c1);
	//printf("%s",c1);
	
	while(1){
	scanf("%s",c2);
		if(strcmp(c2,"END_OF_TEXT")==0){
		break;
		}
	for(a=0;a<1000;a++){
		if(c2[a]=='A'){
		c2[a]='a';
		}
		if(c2[a]=='B'){
		c2[a]='b';
		}
		if(c2[a]=='C'){
		c2[a]='c';
		}
		if(c2[a]=='D'){
		c2[a]='d';
		}
		if(c2[a]=='E'){
		c2[a]='e';
		}
		if(c2[a]=='F'){
		c2[a]='f';
		}
		if(c2[a]=='G'){
		c2[a]='g';
		}
		if(c2[a]=='H'){
		c2[a]='h';
		}
		if(c2[a]=='I'){
		c2[a]='i';
		}
		if(c2[a]=='J'){
		c2[a]='j';
		}
		if(c2[a]=='K'){
		c2[a]='k';
		}
		if(c2[a]=='L'){
		c2[a]='l';
		}
		if(c2[a]=='M'){
		c2[a]='m';
		}
		if(c2[a]=='N'){
		c2[a]='n';
		}
		if(c2[a]=='O'){
		c2[a]='o';
		}
		if(c2[a]=='P'){
		c2[a]='p';
		}
		if(c2[a]=='Q'){
		c2[a]='q';
		}
		if(c2[a]=='R'){
		c2[a]='r';
		}
		if(c2[a]=='S'){
		c2[a]='s';
		}
		if(c2[a]=='T'){
		c2[a]='t';
		}
		if(c2[a]=='U'){
		c2[a]='u';
		}
		if(c2[a]=='X'){
		c2[a]='x';
		}
		if(c2[a]=='Y'){
		c2[a]='y';
		}
		if(c2[a]=='Z'){
		c2[a]='z';
		}
	}

		if(strcmp(c2,c1)==0){
		c++;
		}
	}
printf("%d\n",c);
	return 0;
}

Measured memory_bytes: 548
# coding: UTF-8
from collections import deque

dll = deque()

n = int(input())
for _ in range(n):
  raw = input().split()
  command = raw[0]
  if command == 'delete': 
    value = raw[1]
    try:
      dll.remove(value)
    except ValueError as err:
      continue
  elif command == 'insert':
    value = raw[1]
    dll.appendleft(value)
  elif command == 'deleteFirst':
    try:
      dll.popleft()
    except IndexError as err:
      continue
  elif command == 'deleteLast':
    try:
      dll.pop()
    except IndexError as err:
      continue

print(" ".join(dll))


Measured memory_bytes: 69740
package main

import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    r := bufio.NewReader(os.Stdin)
    w := bufio.NewWriter(os.Stdout)
    defer w.Flush()

    var a int
    var b int
    fmt.Fscan(r, &a, &b)
    if (a + b) % 2 == 0 {
      fmt.Fprintln(w, (a + b) / 2)
    } else {
      fmt.Fprintln(w, "IMPOSSIBLE")
    }
}


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

int main()
{
	int N, K;
	int64_t S;
	scanf("%d%d%lld", &N, &K, &S);
	int rest{1'000'000'000};
	if (S > N) rest = 1;
	for (int i{}; i < N; i++)
	{
		if (i < K) printf("%d", S);
		else printf("%d", rest);
		putchar(i + 1 == N? '\n': ' ');
	}

	return 0;
}

Measured memory_bytes: 1280