akhauriyash/Code-Regression huggingface dataset:
/*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D
 */
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <numeric>
#include <algorithm>

using namespace std;

double
cubic(const double a)
{
    return a * a * a;
}

double
square(const double a)
{
    return a * a;
}

int
main()
{
    ios::sync_with_stdio(false);

    int n;
    cin >> n; cin.ignore();

    vector<double> x(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i]; cin.ignore();
    }
    vector<double> y(n);
    for (int i = 0; i < n; i++) {
        cin >> y[i]; cin.ignore();
    }

    vector<double> d;
    for (int i = 0; i < n; i++) {
        d.push_back( abs( x[i] - y[i] ) );
    }
    x.clear();
    y.clear();

    cout << setprecision(6) << fixed;

    cout << accumulate(d.cbegin(), d.cend(), 0.0) << endl;

    vector<double> d2;
    transform(d.begin(), d.end(), back_inserter(d2), square);
    cout << sqrt( accumulate(d2.cbegin(), d2.cend(), 0.0) ) << endl;
    d2.clear();

    transform(d.cbegin(), d.cend(), back_inserter(d2), cubic);
    cout << cbrt( accumulate(d2.cbegin(), d2.cend(), 0.0) ) << endl;
    d2.clear();

    sort(d.begin(), d.end(), greater<double>());
    cout << d[0] << endl;
    d.clear();

    return 0;
}

Measured memory_bytes: 3400
import sys

# sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    s = read_str()
    res = s[0::2]
    print(res)


main()


Measured memory_bytes: 3188
#include<iostream>
using namespace std;
int main(){
    int i = 1;
    while(1){
      int a;
      cin>>a;
      if(a==0){
          break;
      }
      else{
          cout<<"Case "<<i<<": "<<a<<endl;
      }
      i++;
    }
    return 0;
}


Measured memory_bytes: 3016
n = int(input())
h = list(map(int, input().split()))
hmax = max(h)
ans = 0
for i in range(0, hmax):
	hnow = hmax - i
	lastover = -2
	for j in range(0, n):
		if h[j] >= hnow:
			if j - lastover > 1:
				ans += 1
			lastover = j
print(ans)

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

int main()
{
    int H, W;
    string S;
    cin >> H >> W;
    int h, w;
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            cin >> S;
            if(S == "snuke") {
                h = i;
                w = j;
            }
        }
    }

    cout << (char)('A' + w) << h+1 << endl;
    //cout << h << w << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Inf 0x3f3f3f3f
#define rg register
using namespace std;
typedef long long ll;
inline ll min(ll x, ll y) { return x < y ? x : y; }
inline ll max(ll x, ll y) { return x > y ? x : y; }
const int Maxn = 1e5 + 5;
inline int read()
{
	rg int res = 0, sign = 1;
	rg char ch = getchar();
	while (!isdigit(ch))
	{
		if (ch == '-')
			sign = -1;
		ch = getchar();
	}
	do
	{
		res = (res << 3) + (res << 1) + (ch ^ 48);
		ch = getchar();
	} while (isdigit(ch));
	return res * sign;
}
int n,a,b;
int main()
{
	cin>>n>>a>>b;
	cout<<min(n*a,b)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <stack>
#include <cmath>

using namespace std;

const double EPS=1e-10;
bool EQ(double a,double b){
	return abs(a-b)<EPS;
}
typedef pair<int,int> pii;
int h,w,s;
pii dp[40][40][40][40];
int sums[40][40];
int field[101][101];
int allDemands;

int getRangeNum(int minx,int miny,int maxx,int maxy){
	minx++;miny++;maxx++;maxy++;
	return sums[maxy][maxx]-sums[miny-1][maxx]-sums[maxy][minx-1]+sums[miny-1][minx-1];
}

pii dfs(int minx,int miny,int maxx,int maxy){
	if(dp[minx][miny][maxx][maxy].first>=0)return dp[minx][miny][maxx][maxy];
	pii res=pii(0,0);
	bool fin=false;
	// split y
	for(int i=miny+1;i<=maxy;i++){
		int a=getRangeNum(minx,miny,maxx,i-1);
		int b=getRangeNum(minx,i,maxx,maxy);
		if(allDemands-a>s||allDemands-b>s)
			continue;
		fin=true;
		pii p1=dfs(minx,miny,maxx,i-1);
		pii p2=dfs(minx,i,maxx,maxy);
		pii cand=pii(p1.first+p2.first,min(p1.second,p2.second));
		res=max(res,cand);
	}
	// split x
	for(int i=minx+1;i<=maxx;i++){
		int a=getRangeNum(minx,miny,i-1,maxy);
		int b=getRangeNum(i,miny,maxx,maxy);
		if(allDemands-a>s||allDemands-b>s)
			continue;
		fin=true;
		pii p1=dfs(minx,miny,i-1,maxy);
		pii p2=dfs(i,miny,maxx,maxy);
		pii cand=pii(p1.first+p2.first,min(p1.second,p2.second));
		res=max(res,cand);
	}
	if(!fin)
		res=pii(1,getRangeNum(minx,miny,maxx,maxy));
	return dp[minx][miny][maxx][maxy]=res;
}

void solve(){

	while(cin>>h>>w>>s&&(h|w|s)){
		for(int i=0;i<33;i++)
			for(int j=0;j<33;j++)
				for(int k=0;k<33;k++)
					for(int l=0;l<33;l++)
						dp[i][j][k][l]=pii(-1,-1);
		allDemands=0;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				cin>>field[i][j];
				allDemands+=field[i][j];
			}
		}
		memset(sums,0,sizeof(sums));
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				sums[i+1][j+1]=sums[i][j+1]+sums[i+1][j]-sums[i][j]+field[i][j];
			}
		}
		pii p=dfs(0,0,w-1,h-1);
		cout<<p.first<<" "<<s-(allDemands-p.second)<<endl;
	}

}
int main(){

	solve();

	return 0;
}

Measured memory_bytes: 20000
#include <cstdio>
#define MAX 10000
#define NIL -1

struct Node {int parent, left, right;};

Node T[MAX];
int n,D[MAX],H[MAX];

void setDepth(int u, int d){
    if(u==NIL)return;
    D[u]=d;
    setDepth(T[u].left,d+1);
    setDepth(T[u].right,d+1);
}
int setHeight(int u){
    int h1=0,h2=0;
    if(T[u].left!=NIL)
    h1=setHeight(T[u].left)+1;
    if(T[u].right!=NIL)
    h2=setHeight(T[u].right)+1;
    return H[u]=(h1>h2?h1:h2 );
}

int getSibling(int u){
    if(T[u].parent==NIL)return NIL;
    if(T[T[u].parent].left!=u&&T[T[u].parent].left!=NIL)
    return T[T[u].parent].left;
    if(T[T[u].parent].right!=u&&T[T[u].parent].right!=NIL)
    return T[T[u].parent].right;
    return NIL;
}
void print(int u){
    printf("node %d: ",u);
    printf("parent = %d, ",T[u].parent);
    printf("sibling = %d, ",getSibling(u));
    int deg=0;
    if(T[u].left!=NIL)deg++;
    if(T[u].right!=NIL)deg++;
    printf("degree = %d, ", deg);
    printf("depth = %d, ", D[u]);
    printf("height = %d, ", H[u]);

    if(T[u].parent==NIL){
        printf("root\n");
    }else if(T[u].left==NIL&&T[u].right==NIL){
        printf("leaf\n");
    } else{
        printf("internal node\n");
    }
}
int main(){
    int v,l,r,root=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)T[i].parent=NIL;
    for(int i=0;i<n;i++){
        scanf("%d %d %d", &v, &l, &r);
        T[v].left=l;
        T[v].right=r;
        if(l!=NIL)T[l].parent=v;
        if(r!=NIL)T[r].parent=v;
    }
    for(int i=0;i<n;i++)if(T[i].parent==NIL)root=i;
    setDepth(root,0);
    setHeight(root);
    for(int i=0;i<n;i++)print(i);
    return 0;
}


Measured memory_bytes: 2768
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
using P = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int Inf = (1 << 30);
ll inf = (1LL << 60);
const int MOD = 1e9 + 7;
int main() {
	int n;
	cin >> n;
	int sum = 0;
	rep(i, n) {
		int a;
		cin >> a;
		sum += a;
	}
	cout << sum - n << endl;
	return 0;
}

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

int main() {
	int n; cin >> n;
	int ans = 0;
	vector<int>P(n);
	for (int i = 0; i < n; i++) {
		cin >> P[i];
	}
	for (int i = 0; i < n - 2; i++) {
		if (P[i+1] < P[i] && P[i+1] > P[i + 2]) {
			++ans;
		}
		else if(P[i+1] > P[i] && P[i+1] < P[i + 2]){
			++ans;
		}
	}
	cout << ans;
}

Measured memory_bytes: 384
N,M,K=map(int,input().split())
 
par=[-1]*N
num=[0]*N
 
def find(x):
    if par[x]<0:
        return x
    else:
        par[x]=find(par[x])
        return par[x]
 
def union(x,y):
    p,q=find(x),find(y)
    if p==q:
        return
    if p>q:
        p,q=q,p
    par[p]+=par[q]
    par[q]=p   
 
def size(x):
    return -par[find(x)]
 
def same(x,y):
    return find(x)==find(y)
        
 
for _ in range(M):
    a,b=map(int,input().split())
    a-=1
    b-=1
    union(a,b)
    num[a]+=1
    num[b]+=1
 
for _ in range(K):
    c,d=map(int,input().split())
    c-=1
    d-=1
    if same(c,d):
        num[c]+=1
        num[d]+=1
 
for i in range(N):
    print(size(i)-1-num[i],end=" ")

Measured memory_bytes: 11384
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=2e9;
const double EPS=1e-10;
//int mod=1000000007
 

const int MAX_N = 100000;
int n, a[MAX_N];
int dp[MAX_N];


int solve() {
	fill(dp, dp + n, INF);
	for(int i = 0; i < n; i++){
		*lower_bound(dp, dp + n, a[i]) = a[i];
	}
	return lower_bound(dp, dp + n, INF) - dp;
}


int main(){
	cin>>n;
	rep(i, n) cin>>a[i];
	cout<<solve()<<endl;
}

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

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int m[101]={};
  for(int i=a;i<b;++i)m[i]++;
  for(int i=c;i<d;++i)m[i]++;
  int ans=0;
  for(int i=0;i<100;++i){
    if(m[i]==2)ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;

void prvec(vector<ll> vec){ //for debug
    ll n = vec.size();
    cout << "------------------------------------\n" ;
    rep(i,n) cout << i << " " << vec.at(i) << "\n";
    cout << "------------------------------------\n" ;
}

void pr2d(vector<vector<ll>> vec){ // for debug
    ll h = vec.size();
    ll w = vec.at(0).size();
    cout << "------------------------------------\n" ;
    rep(i,h){
        rep(j,w){
            cout << vec.at(i).at(j) << " ";
        }
        cout << "\n";
    }
    cout << "------------------------------------\n" ;
}

int main(){
    ll n , m ; cin >> n >> m;
    vector<vector<ll>> dp(m+1,vector<ll>(1<<n,INF));
    dp.at(0).at(0) = 0;
    for(int i=1;i<=m;i++){
        ll cost,keynum; cin >> cost >> keynum;
        ll keycomb = 0;
        rep(j,keynum){
            ll x; cin >> x;
            keycomb+=(1<<(x-1));
        }
        //cout << i << " " << keycomb << endl;
        rep(j,1<<n){
            bitset<12> jb(j),key(keycomb);
            ll z = (jb|key).to_ullong();
            //cout << j << " " << z << endl;
            dp.at(i).at(z) = min(dp.at(i).at(z),dp.at(i-1).at(j) + cost);
            dp.at(i).at(j) = min(dp.at(i).at(j),dp.at(i-1).at(j));            
        }
    }
    //pr2d(dp);
    if(dp.at(m).at((1<<n)-1) == INF){
        cout << -1 << endl;
    }else{
        cout << dp.at(m).at((1<<n)-1) << endl;
    }
    return 0;
}

Measured memory_bytes: 32384
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]

####
MOD = 10**9 + 7
YES, NO, IMP = "YES", "NO", "IMPOSSIBLE"
from collections import defaultdict as ddic

def solve(N):
    # AB + C = N
    # C = 1.. N-1
    ds = [2] * (N + 1)
    ds[0] = ds[1] = 1
    for i in xrange(2, N + 1):
        for j in xrange(2*i, N + 1, i):
            ds[j] += 1

    return sum(ds[i] for i in xrange(1, N))
    
N = rri()
print solve(N)


Measured memory_bytes: 86276
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define pb push_back
#define sz(x) (int)(x).size()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;


int main() {
  vi v(5);
  rep(i,5){
    cin >> v[i];
  }
  int ans=0;
  rep(i,5){
    if(v[i]%10==0){
      ans+=v[i];
    }
    else{
      ans+=(v[i]/10+1)*10;
    }
  }
  int x=0;
  int y=10;
  bool b=false;
  rep(i,5){
    if(v[i]%10!=0 && v[i]%10<y){
      x=v[i];y=v[i]%10;
      b=true;
    }
  }
  if(b){
    ans=ans-((x/10+1)*10-x);
  }
  cout << ans << endl;
  return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string S;
int N,K;
vector<string> V;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>S>>K;
	N=S.size();
	FOR(i,N) {
		for(j=1;i+j<=N && j<=5;j++) V.push_back(S.substr(i,j));
	}
	sort(ALL(V));
	V.erase(unique(ALL(V)),V.end());
	cout<<V[K-1]<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 1660
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#define N 1001000
#define INF 10000000000
#define mem(a,b) memset(a,b,sizeof(a))
#define sqr(x)   return x*x
#define abs(x)   return x>0?x:(-x)
typedef long long ll;
//coding........
ll w[N];
 int n;
ll a,b;
ll maxn=-INF;
using namespace std;
ll Check(ll ans)
{
    int sum=0;
    for (int i=0;i<n;i++)
    {
        ll temp=w[i]-ans*b;
        if (temp>0)
        {
              sum+= temp/(a-b);
              if (temp%(a-b))
                sum++;
            if (sum>ans||sum<0)
                return 0;
        }
    }
     return 1;
}

void solve()
{
    ll left=0,right=maxn;
    while (left<right)
    {
        ll mid=(left+right)/2;
        if (Check(mid))
         right=mid;
        else
            left=mid+1;
    }
    printf("%lld\n",right);
}
int main()
{
    scanf("%d%lld%lld",&n,&a,&b);
    for (int i=0;i<n;i++)
       {
            scanf("%lld",&w[i]);
            maxn=max(maxn,w[i]);
       }
       solve();

    return 0;
}

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

int main() {
    int n; cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    int e = 0, o = 0;
    int cnt = 1;
    for (int i = 1; i < n; i++) {
        if (a[i] == a[i - 1]) {
            cnt++;
        } else {
            if (cnt % 2 == 0) e++;
            else o++;
            cnt = 1;
        }
    }
    if (cnt % 2 == 0) e++;
    else o++;
    int ans = e + o;
    if (e % 2 == 1) ans--;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
import collections

n = int(input())
#c = 0
#sort_dict = dict()
sort_list = list()
for i in range(n):
  i_sort = "".join(sorted(input()))
  #sort_dict[i] = i_sort
  sort_list.append(i_sort)
  #if not sort_dict[0]:
  #  if sort_dict[i] == sort_dict[i-1]:
  #    c += 1
counts = 0
cc = collections.Counter(sort_list)
v, c = zip(*cc.most_common())
#print(c)
for c_ in c:
  counts += (c_ * (c_ - 1)) / 2
print(int(counts))
"""
values, counts = zip(*cc.most_common())
if counts != 1:
  print(counts)
 """



Measured memory_bytes: 31748
import Data.List

-- All subsets of [0 .. n-1]
subsets :: Int -> [[Int]]
subsets 0 = [[]]
subsets n = let xs = subsets (n-1) in xs ++ [x ++ [n-1] | x <- xs]

-- Intersection.  Assume that two lists are sorted
intersection :: [Int] -> [Int] -> [Int]
intersection _ [] = []
intersection [] _ = []
intersection xs@(x:xs1) ys@(y:ys1)
  | x == y = x : intersection xs1 ys1
  | x < y  = intersection xs1 ys
  | x > y  = intersection xs ys1

-- Whether a lamp with spec (ks,p) is on when switched in xs are on
check :: (Int, [Int]) -> Int -> [Int] -> Bool
check (k, ss) p xs = length (intersection (sort ss) xs) `mod` 2 == p

-- Whether all lamps are on when switches in xs are on
all_on :: [(Int, [Int])] -> [Int] -> [Int] -> Bool
all_on lst_ks lst_p xs = and [check ks p xs | (ks, p) <- zip lst_ks lst_p]

solve :: Int -> Int -> [(Int, [Int])] -> [Int] -> Int
solve n m lst_ks lst_p
  = length (filter (all_on lst_ks lst_p) (subsets n))

parse_ks :: String -> (Int, [Int])
parse_ks str = let k : lst_s = map read (words str)
               in (k, map (+ (-1)) lst_s)   -- 1-indexed -> 0-indexed

main :: IO()
main = do
  cont <- getContents
  let line1 : line_rest = lines cont
      lines_ks = init line_rest
      line_p = last line_rest
      [s_n, s_m] = words line1
      n = read s_n
      m = read s_m
      lst_ks = map parse_ks lines_ks
      lst_p = map read (words line_p)
      answer = solve n m lst_ks lst_p
  putStrLn (show answer)


Measured memory_bytes: 1020
#include <iostream>
#include <string>
using namespace std;
 
int main() {
 
  while(1) {
  int n;
  cin >> n;
  if(n == 0) break;
  int ok[3] = {};
  int cnt[3] = {};
  for(int q=0;q<n;q++) {
    string str;
    int num;
    cin >>str >> num;
 
    int lun,di,mid;
 
    int t=0;
    int hr,mn;
    for(int i=0;i<str.size();i++) {
      if(str[i] == ':') {
    hr = t;
    t = 0;
    continue;
      }
      t*=10;
      t+= str[i]-'0';
    }
    mn = t;
 
    int wait;
    if(t > num)  wait = num - t+60;
    else wait = num -t;
 
    int flg = 0;
    if(hr>=11 && hr<=14) {
      cnt[0]++;
      if(wait <= 8) ok[0]++;
    }
    else if(hr>=18 && 20>=hr) {
      cnt[1]++;
      if(wait <= 8) ok[1]++;
    }
    else if((21<=hr && hr<=23) || hr<=1) {
      cnt[2]++;
      if(wait <= 8) ok[2]++;
    }
  }
 
    if(cnt[0] == 0) cout << "lunch no guest"<<endl;
    else cout <<"lunch "<< (int)(100.0*ok[0]/cnt[0])<<endl;
        
    if(cnt[1] == 0) cout << "dinner no guest"<<endl;
    else cout <<"dinner "<< (int)(100.0*ok[1]/cnt[1])<<endl;
    if(cnt[2] == 0) cout << "midnight no guest"<<endl;
    else cout << "midnight "<<(int)(100.0*ok[2]/cnt[2])<<endl;
}
  return 0;
 
}

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

int main() {
	int n;
	cin >> n;
	int *arr = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	int temp;
	int i = 1;
	for (; i < n; i++) {
		for (int i=0; i < n; i++) {
			cout << arr[i];
			if (i != n - 1)
				cout << ' ';
			else
				cout << endl;
		}
		int j = i - 1;
		temp = arr[j+1];
		while (arr[j] > temp&&j>=0) {
			arr[j + 1] = arr[j];
			j--;
		}
		arr[j+1] = temp;
	}
	for (int i = 0; i < n; i++) {
		cout << arr[i];
		if (i != n - 1)
			cout << ' ';
		else
			cout << endl;
	}
return 0;
}


Measured memory_bytes: 3076
#include<cstdio>
#include<algorithm>
using namespace std;

int a, b, c, d, e, f, answ, anss;
int main() {
	scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
	double mx = 0;
	for(int i = 0; i <= 100 && i * a * 100 <= f; i++) {
		for(int j = 0; j <= 100 && j * b * 100 <= f; j++)
			for(int k = 0; k * c <= (i * a + j * b) * e; k++) {
				if(i * a * 100 + j * b * 100 + k * c <= f) {
				///	printf("%d %d %d\n", i,j, k );
					int wat = i * a * 100 + j * b * 100;
					int sug = min(k * c + (wat / 100 * e - k * c) / d * d, f - wat);
				//	printf("%d %d\n", wat, sug);
					if(100.0 * sug / (1.0 * wat + sug) >= mx) {
						mx = 100.0 * sug / (1.0 * wat + sug);
						answ = wat + sug;
						anss = sug;
					}
				}
			}
	}
	printf("%d %d\n", answ, anss);
} 

Measured memory_bytes: 128
#include <iostream>
#include <cassert>
#include <algorithm>
#include <functional>
using namespace std;
int main(void){
    int n,w[100],ans;
    cin >> n;
    int s1=0,s2=0;
    for (int i = 0; i < n; ++i){
        cin >> w[i];
        s2+=w[i];
    } 
    ans=s2;
    for (int i = 0; i < n-1; ++i){
        s1+=w[i];
        s2-=w[i];
        ans=min(ans,abs(s1-s2));
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int H,W,i,j;
    while(1){
    scanf("%d%d",&W,&H);
    if(H==0&&W==0)break;
    for(i=1;i<=W;i++){
    for(j=1;j<=H;j++){
        printf("#");
    }
    printf("\n");
    }
    printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2000
import java.io.PrintWriter

fun main() {
    val pw = PrintWriter(System.out)

    val x = readInputLine().toLong()

    var current = 100L
    var year = 0L

    while (current < x) {
        current += current / 100
        year++
    }

    pw.println(year)

    pw.flush()
}

fun readInputLine(): String {
    return readLine()!!
}


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

int main() {
  int n;
  cin >> n;
  vector<ll>z(n),w(n);
  rep(i,0,n){
    ll x,y;
    cin >> x >> y;
    z[i] = x+y;w[i] = x-y;
  }
  sort(z.begin(),z.end());
  sort(w.begin(),w.end());
  ll ans = max(abs(z[n-1]-z[0]),abs(w[n-1]-w[0]));
  cout << ans << endl;
}

Measured memory_bytes: 6388
N, K = map(int, input().split())
E = [set() for i in range(N+1)]
Er = []
for i in range(N-1):
    a, b = map(int, input().split())
    E[a].add(b)
    E[b].add(a)
    Er.append({a, b})
ma = 0
Start = []
if K&1 == 1:
    Start = Er
else:
    Start = [{i} for i in range(1, N+1)]
for st in Start:
    L = list(st)
    Closed = st
    for j in range(K//2):
        S = []
        for l in L:
            S += E[l]
        L = []
        for s in S:
            if s not in Closed:
                L.append(s)
                Closed.add(s)
    ma = max(ma, len(Closed))
print(N-ma)


Measured memory_bytes: 228488
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
 
int main() {
  int n;
  string r = "YES";
  bool f = false;
  
  cin >> n;
  
  unsigned int arr[n] = {0};

  rep(i, n) cin >> arr[i];
  
  sort(arr, arr + n);
  
  rep2(i, 1, n){
    if(arr[i-1] == arr[i]){
      r = "NO";
      break;
    }
  }
    
  cout << r << endl;
}

Measured memory_bytes: 1152
N, M, X = list(map(int, input().split()))

C = [list() for _ in range(N)]
for i in range(N):
    C[i] = list(map(int, input().split()))

INF = 10**9 + 7
minpr = INF
for i in range(2**N):
    buy = list()
    for j in range(N):
        if i&1==1: buy.append(j)
        i >>= 1
    skill = [0]*M
    price = 0
    for k in range(len(buy)):
        price += C[buy[k]][0]
        for l in range(M):
            skill[l] += C[buy[k]][l+1]
    for m in range(M):
        if skill[m] < X: break
    else:
        if minpr > price: minpr = price
if minpr==INF:
    print(-1)
else:
    print(minpr)



Measured memory_bytes: 68796
import java.util.Scanner;

/**
 * 
 */

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		String T ="";
		String P ="";
		String TT = "";
		
		int point = 0;
		int hyouj = 0;
		
		T = as.next();
		P = as.next();
		
		TT = T;
		
		point = T.indexOf(P);
		if(point == 0){
			
			System.out.println(String.valueOf(point));
			T = T.substring(point+1);
			
		}
		while(point != -1){
			
			point = T.indexOf(P);
			//System.out.println("!!"+point);
			//if(point == 0)
				//hyouj++;
			
			//hyouj += point;
			if(point != -1){
			
				T = T.substring(point+1);
				hyouj = (TT.length()-T.length())-1;
				System.out.println(String.valueOf(hyouj));
			//System.out.println(T);
				
			}
		}

	}

}

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

using namespace std;

class XorBase {
public:
    explicit XorBase(){}
    long long reduce(long long t) const {
        for(auto& b : base) t = min(t, t^b);
        return t;
    }
    bool add(long long t){
        t = reduce(t);
        if(!t) return false;
        base.push_back(t);
        for(int i=base.size()-2;i>=0;i--) if(base[i] < base[i+1]) swap(base[i], base[i+1]);
        return true;
    }
    long long getMax() const {
        long long res = 0;
        for(auto& b : base) res = max(res, res^b);
        return res;
    }
    bool represent(long long t) const { return reduce(t) == 0; }
private:
    vector<long long> base;
};

int solve(const vector<long long>& A, const string& S){
    const int N = A.size();
    XorBase xb;
    for(int i=N-1;i>=0;i--){
        if(S[i] == '0'){
            xb.add(A[i]);
        } else {
            if(!xb.represent(A[i])) return 1;
        }
    }
    return 0;
}

int main(){
    int T; cin >> T;
    while(T--){
        int N; cin >> N;
        vector<long long> A(N);
        for(auto& t : A) cin >> t;
        string S; cin >> S;
        cout << solve(A, S) << endl;
    }
}

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

using namespace std;

int n;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    bool ok = false;
    while (n > 0)
    {
        if (n % 10 == 7)
        {
            ok = true;
        }
        n /= 10;
    }
    cout << (ok ? "Yes" : "No");
    return 0;
}

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

int main() {
	int x, a, b;
	cin >> x >> a >> b;
	if(min(abs(a - x), abs(b - x)) == abs(b - x)){
		cout << "B" << endl;
	}else{
		cout << "A" << endl;
	}
	
 	return 0;
}



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

public class Main {
	public static void main(String[] args) throws IOException {
       InputReader in = new InputReader(System.in);
       String s1 = in.readString(); 
       String s2 = in.readString(); 
       int b1 = in.readInt(); 
       int b2 = in.readInt(); 
       String u = in.readString(); 
       if(u.equals(s1))
    	    b1--; 
    	  else b2--; 
    	  System.out.println(b1 + " " + b2); 
	}
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public long readLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9') {
				throw new InputMismatchException();
			}
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public String next() {
		return readString();
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}


Measured memory_bytes: 22612
import           Control.Monad (replicateM)

main :: IO ()
main = do
  n <- readLn
  capacities <- replicateM 5 readLn
  print $ solve n capacities

solve :: Int -> [Int] -> Int
-- solve n capacities = 5 + n `div` minimum capacities
solve n capacities = 5 + (n - 1) `div` minimum capacities


Measured memory_bytes: 508
S = list(input())
n = len(S)-1

s = 0
for i in range(2**n):
    A = ['+' if (i>>j) & 1 else '' for j in range(n)]
    T = S[0]
    for j in range(n):
        T += A[j]
        T += S[j+1]
    T = ''.join(T)
    s += eval(T)
print(s)

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

int main() {
	int N;
  	cin >> N;
  	vector<int> B(N-1);
  	for(int i = 0; i < N-1; i++) cin >> B.at(i);
  	
  	int total = B.at(0);
  	for(int i = 0; i < N-2; i++) {
     total += min(B.at(i), B.at(i+1));
    }
  	total += B.at(N-2);
  
  cout << total << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
      
      Scanner scanner = new Scanner(System.in);
      int n = scanner.nextInt();
      int[] d = new int[n];

      for (int i = 0;  i < n  ; i ++ ) {
          d[i] = scanner.nextInt();
      }

      int r_int = 0;

      for (int i = 0;  i < n - 1 ; i ++ ) {
          for (int j = i+1;  j < n ; j ++ ) {
             r_int = r_int + (d[i] * d[j]);
          }
      }
      System.out.println(r_int);

      return;
    }
  }

Measured memory_bytes: 22996
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>

using namespace std;

#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define P pair<int, int>

typedef vector<int> vec;
typedef vector<vec> mat;

int main(){
    int n;
    cin >> n;
    int w[n];
    rep(i, n) cin >> w[i];
    int sm[n+1];
    sm[0] = 0;
    rep(i, n){
        sm[i+1] = sm[i] + w[i];
    }
    int ans = 1000000000;
    rep(i, n){
        // cout << sm[i] << " " << sm[n] - sm[i] << endl;
        ans = min(ans, abs(sm[i] - (sm[n] - sm[i])));
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
const int MAXN=1e5+5;
int read()
{
    int s=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
    return s*f;
}
int main()
{
    ll n;
    while(cin>>n)
    {
        ll res=n;
        ll a,b;
        for(ll i=1;i<=(int)sqrt(n);i++)
        {
            if(i*(n/i)!=n)continue;
            if(abs(i-n/i)<=res)
            {
                res=abs(i-n/i);
                a=i;b=n/i;
            }
        }
        cout<<(a+b-2)<<endl;
    }
    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
int main()
{
  int x, y, i, t;
//??°???????????????
  while (1){
    scanf("%d%d",&x,&y);   
      if(x==0 && y==0) break;
      if (x>=y)
         {printf("%d %d\n",y,x);} 
      else
         {printf("%d %d\n",x,y);} }

    return 0;
}

Measured memory_bytes: 596
# -*- coding: utf-8 -*-
A,B,C,D,E,F=map(int, raw_input().split())
#print A,B,C,D,E,F

sugar_list=[0]*(F+1)
i=0
while i <= F :
	for j in range(F):
		val=C*i+D*j
		if val > F:
			break
		elif val <= F:
			sugar_list[val]=1
	i+=1

#print "# Sugar"
#print sugar_list

#Water
water_list=[0]*(F/100+1)
#print water_list
loop_cnt=F/100+1

i=0
while i <= loop_cnt:
	for j in range(loop_cnt):
		val=A*i+B*j
		if val > F/100:
			break
		else:
			#print i,j,val
			water_list[val]=1
	i+=1

#print "# Water"
#print water_list

max_noudo=float(E)/(100+E)
#print max_noudo


hwm=0
water_ans=A*100
sugar_ans=0
for i in range(1,len(water_list)):
	for j in range(len(sugar_list)):
		if water_list[i]*sugar_list[j]==1 and i*100+j<=F and j<=i*E:
			if float(j)/(i*100+j)>hwm:
				hwm=float(j)/(i*100+j)
				water_ans=i*100
				sugar_ans=j
				

print water_ans+ sugar_ans, sugar_ans




Measured memory_bytes: 2820
#include<stdio.h>
#define M 1000000

int n;

int main(){
  int i,j;
  int a,b,c,d,x,y;
  int e[100],l[100],m[100];
  scanf("%d",&n);
  int G[100][101];
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      G[i][j]=M;
    }
  }

  for(i=0;i<n;i++){
    scanf("%d%d",&a,&b);
    for(j=0;j<b;j++){
      scanf("%d%d",&c,&d);
      G[a][c]=d;
    }
  }

  for(i=0;i<n;i++){
    e[i]=0;
    l[i]=M;
  }
  e[0]=3;
  l[0]=0;

  while(1){
    x=M;
    y=-1;
    for(i=0;i<n;i++){
      if(x>l[i] && e[i]!=1){
	x=l[i];
	y=i;
      }
    }

    if(y==-1)break;

    e[y]=1;

    for(j=0;j<n;j++){
      if(e[j]!=1 && G[y][j]!=M){
	if(l[j]>l[y]+G[y][j]){
	  e[j]=3;
	  l[j]=l[y]+G[y][j];
	}
      }
    }
  }

  for(i=0;i<n;i++){
    printf("%d ",i);
    if(l[i]==M)printf("-1\n");
    else printf("%d\n",l[i]);
  }
  return 0;
}



Measured memory_bytes: 2060
K, N = map(int, input().split())
A = input().split()
A = [int(val) for val in A]
A_org = min(A)
A = [val - A_org for val in A]
A.sort()
dist = []
for i in range(len(A)):
  if i != len(A)-1:
    dist.append(A[i+1]-A[i])
  else:
    dist.append(K-A[i])
print(K - max(dist))

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

#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

const ll MOD = 998244353;
const ll INF = 1e18;
const ll IINF = INT_MAX;

ll fpow(ll a, ll b) {
    ll ret = 1;
    while (b) {
        if (b & 1) {
            ret = (ret * a) % MOD;
        }
        b /= 2;
        a = (a * a) % MOD;
    }
    return ret;
}

const int N = 2e5 + 5;
ll f[N];

void pre(int n) {
    f[0] = 1;
    for (int i = 1; i <= n; i++) {
        f[i] = i * f[i - 1];
        f[i] %= MOD;
    }
}

ll nck(int n, int k) {
    ll ret = f[n];
    ret *= fpow(f[k], MOD - 2); ret %= MOD;
    ret *= fpow(f[n - k], MOD - 2); ret %= MOD;
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    pre(n);
    ll ans = m;
    ll lol = 0;
    for (int i = 0; i <= k; i++) {
        lol += (nck(n - 1, i) * fpow(m - 1, n - i - 1)) % MOD;
        lol %= MOD;
    }
    ans *= lol;
    ans %= MOD;
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 5140
# -*- coding: utf-8 -*-
from math import sqrt
a,b = map(int, input().split())
xa,xb = a,b

sa = set([1])
i = 2
while a>1:
    if i>sqrt(xa):
        sa.add(a)
        break
    while a%i==0:
        sa.add(i)
        a //= i
    i += 1

sb = set([1])
i = 2
while b>1:
    if i>sqrt(xb):
        sb.add(b)
        break
    while b%i==0:
        sb.add(i)
        b //= i
    i += 1

print(len(sa & sb))

Measured memory_bytes: 3064
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;
const int IINF = 1e9;
const ll INF = 1e18;
const int MOD = 1e9 + 7;

#define dump(x) cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl

void chmin(ll &a, ll b) {
  if (a > b) {
    a = b;
  }
}
void chmax(ll &a, ll b) {
  if (a < b) {
    a = b;
  }
}

int main() {
  unsigned long long a, b, c;
  cin >> a >> b >> c;

  if (c < (a + b)) {
    cout << "No" << endl;
    return 0;
  }
  unsigned long long a_b = a + b;

  if (4 * a * b + 2 * c * a_b < c * c + a_b * a_b) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

#ifdef LOCAL
#define show(x) cerr << "LINE" << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define show(x) true
#endif

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);		//DON'T USE scanf/printf/puts !!
	cout << fixed << setprecision(20);
	
	int a,b,c;
	cin >> a >> b >> c;
	cout << b+c - min(a,b+c) << endl;
}


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

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n, m; cin >> n >> m;
    map<int,int> mp;
    set<int> ac;
    int ans = 0, pen = 0;
    for (int i = 0; i < m; i++) {
        int p; string s; cin >> p >> s;
        if (ac.count(p)) {
            continue;
        }
        else {
            if (s == "WA") {
                mp[p]++;
            }
            else {
                ans++;
                pen += mp[p];
                ac.insert(p);
            }
        }
    }
    cout << ans << ' ' << pen << '\n';
}



Measured memory_bytes: 9600
#include <stdio.h>
int main(){
	int a, b, c;
	scanf("%d", &a);
	for(int i=0; i>=0; i++){
		if (a%1000==0){
			printf("0");
			break;
		}
		else if (a>=1000){
			b=a/1000+1;
			c= 1000*b - a;
			printf ("%d", c);
			break;
	}
	else if (a<=999){
		b=1000-a;
		printf("%d", b);
		break;
	}
	}
	return 0;
}

Measured memory_bytes: 1704
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)

int main() {
    char a, b; cin >> a >> b;
    if ((a == 'H' && b == 'H') || (a == 'D' && b == 'D')) out("H");
    else out("D");
}



Measured memory_bytes: 256
//k_k_dubey_
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define inf 999999999999
#define mx 200005
#define gcd __gcd
#define pb push_back
#define mk make_pair
#define bs binary_search
#define pq priority_queue
#define ub upper_bound
#define lb lower_bound
#define endl "\n"
#define vl vector<ll>
#define vs vector<string>
#define non __builtin_popcount
#define ml map<ll, ll> 
#define ms map<string , ll> 
using namespace std;
 
bool isp[mx];
 
void sv(){
 
	ll i,j;
	memset(isp, true, sizeof(isp));
	
	isp[1]= false;
	for(i=2;i*i<mx;i++){
		if(isp[i]){
			for(j=i*i;j<mx;j+=i)
			isp[j]= false;
		}
	}
}
 
ll powr(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b&1)res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	//sv();
	
    ll a,i,j;
    string s;
    cin>>a>>s;
    if(a>= 3200)
    cout<<s;
    else
    {
        cout<<"red";
    }
    

    return 0;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

int main()
{
    string str;
    ll n,k;

    cin>>str>>k;
    n = str.length();

    ll flg = 0;
    for(ll i=0;i<n;i++)
    {
        if(str[i] != str[0])
        {
            flg = 1;
            break;
        }
    }

    if(flg == 0)
    {
        cout<<(k*n)/2;
    }
    else
    {
        ll i=0;
        ll c1 = 0;
        while(i<n && str[i] == str[0])  i++;
        c1 = i;

        ll c2 = 0;
        ll j = n-1;
        while(j>=0 && str[j] == str[n-1])   j--;
        c2 = (n-1-j);

        ll ans = 0;

        if(str[0] == str[n-1])
            ans += c1/2 + c2/2 + ((c1+c2)/2)*(k-1);
        else
            ans += (c1/2 + c2/2)*k;

        while(i<=j)
        {
            ll k1=i+1;
            while(k1<=j && str[k1] == str[i]) k1++;
            ans += k*((k1-i)/2);
            i = k1;
        }
        cout<<ans;
    }
  
    return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

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

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

ll bridge_dp[9][2] = {};

void create_bridge_dp() {
  bridge_dp[0][0] = 1;
  bridge_dp[1][0] = 1;
  for (int i = 2; i <= 8; i++) {
    // 横線を引かない
    bridge_dp[i][0] = bridge_dp[i - 1][0] + bridge_dp[i - 1][1];
    // 横線を引けるのは左に横線がない場合
    bridge_dp[i][1] = bridge_dp[i - 1][0];
  }
}

ll way_bridge(ll n) {
  if (n <= 0) {
    return 1;
  }
  return bridge_dp[n][0] + bridge_dp[n][1];
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll h, w, k;
  cin >> h >> w >> k;

  create_bridge_dp();

  vvll dp(h + 1, vll(w + 2));
  dp[0][1] = 1;

  rep(y, h) {
    REP(x, w + 1) {
      dp[y + 1][x] = dp[y][x] * way_bridge(x - 1) * way_bridge(w - x);
      dp[y + 1][x] += dp[y][x - 1] * way_bridge(x - 2) * way_bridge(w - x);
      dp[y + 1][x] += dp[y][x + 1] * way_bridge(x - 1) * way_bridge(w - x - 1);
      dp[y + 1][x] %= mod;
    }
  }

  cout << dp[h][k] << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <math.h>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int x,y;
	cin >> x>> y;
    int ans;
    if(0<y)ans= x*(x-1)/2+y*(x-1);
    else if(abs(y)<x)ans=x*(x+1)/2+(y-1)*x;
    else ans= x*(x-1)/2+(y-1)*(x-1);
      cout << ans << endl;
}

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

int main(){
	int len, i;
	string s;
	cin>>s;
	len=s.length();
	string t((len+1)/2, '0');
	for(i=0; i<len; i++){
		if(i%2==0){
			t[i/2]=s[i];
		}
	}
	cout<<t<<endl;
	return 0;
}

Measured memory_bytes: 512
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ky112233
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBishop solver = new BBishop();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBishop {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long h = in.nextLong();
            long w = in.nextLong();
            if (h == 1 || w == 1) {
                out.println(1);
                return;
            }
            out.println((h * w) % 2 == 1 ? h * w / 2 + 1 : h * w / 2);
        }

    }
}



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

int main(){
	int H, W;
	while (1){
		cin >> H >> W;
		if (H == 0 && W == 0) break;
		for (int i = 0; i < H; i++){
			for (int k = 0; k < W; k++){
				if (i % 2 == 1){
					if (k % 2 == 1){
						cout << "#";
					}
					else{
						cout << ".";
					}
				}
				else{
					if (k % 2 == 1){
						cout << ".";
					}
					else{
						cout << "#";
					}
				}
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll a,b,k;
    cin>>a>>b>>k;
    int i=1;
    while(k--)
    {
        if(i%2==1)
        {
            if(a%2==1)
            {
                a--;
                a=a/2;
                b=b+a;
            }
            else
            {
                a=a/2;
                b=b+a;
            }
        }
        else{
             if(b%2==1)
            {
                b--;
                b=b/2;
                a=a+b;
            }
            else
            {
                b=b/2;
                a=a+b;
            }
        }
        i++;
    }
    cout<<a<<" "<<b<<endl;
    return 0;
}


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

using namespace std;

const int maxn = 1e5 + 10;
int h[maxn];
int n;
int dp[maxn];

int32_t main(){
	scanf("%lld", &n);

	for(int i=0; i<n; i++){
		scanf("%lld", &h[i]);
	}

	dp[0] = 0;
	dp[1] = abs(h[0] - h[1]);
	for(int i=2; i<n; i++){
		dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i-2] + abs(h[i]-h[i-2]));
	}

	printf("%lld\n", dp[n-1]);

}


Measured memory_bytes: 5268
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
    	Scanner sc = new Scanner(System.in);   		
    	int N = sc.nextInt();
    	int R = sc.nextInt();
    	if (N >=10) {
    		System.out.println(R);
    	}
    	else {
    		int inner = R + (100*(10-N));
    		System.out.println(inner);
    	}
    	
    		}
    }

class Pair
{
	long x;
	long y;
	
	public Pair(long x,long y) {
		this.x=x;
		this.y=y;
		
	}
}

class Scanner 
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException 
	{
		while (st == null || !st.hasMoreTokens()) 
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}
	
	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}
	
	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}
	
	public boolean ready() throws IOException {return br.ready();}
}


Measured memory_bytes: 21076