akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
#define debug(...) __VA_ARGS__
#else
#define endl '\n'
#define debug(...)
#endif
#define debugf(...) debug(printf(__VA_ARGS__))

const int N = 1e5 + 5;


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

    using ll = long long;
    ll n; cin >> n;

    vector<int> ans;
    while (n > 0) {
        --n;
        ans.push_back(n % 26);
        n /= 26;
    }

    reverse(ans.begin(), ans.end());

    for (int x : ans)
        cout << char(x + 'a');
    cout << endl;

    return 0;
%>


Measured memory_bytes: 3632
#include <stdio.h>
#include <math.h>
#include <string.h>
int main (void){
        int A;
        int max,min;
          scanf("%d",&A);
        max=A;
        min=A;
          scanf("%d",&A);
          if (max<A) {
            max=A;
          }
          if (min>A) {
            min=A;
          }
          scanf("%d",&A);
if (max<A) {
  max=A;
}
if (min>A) {
  min=A;
}

        printf("%d\n",max-min);

        return 0;

}


Measured memory_bytes: 128
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ans = 0
pre = None
for a in A:
    ans += B[a-1]
    if pre == a-1:
        ans += C[a-2]
    pre = a
print(ans)

Measured memory_bytes: 3064
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	llint L,R,i,j,ans=0;cin>>L>>R;
	static int soin[1000001]={0};
	static llint now[1000001];
	static bool sosu[35000]={};//1なら素数
	int A=max(50,(int)sqrt(R)+100);
	for(i=2;i<=A;i++){sosu[i]=1;}
	for(i=2;i<=A;i++){
		if(!sosu[i]){continue;}
		for(j=i+i;j<=A;j+=i){sosu[j]=false;}
	}
	for(j=0;j<=R-L;j++){now[j]=j+L;}
	for(i=2;i<=A;i++){
		//cerr<<"de"<<__LINE__<<endl;
		if(!sosu[i]){continue;}
		for(j=((L+i-1)/i)*i;j<=R;j+=i){
			
			while(now[j-L]%i==0){now[j-L]/=i;soin[j-L]++;}
		}
	}
	for(j=0;j<=R-L;j++){
		if(now[j]>1){soin[j]++;}
		if(sosu[soin[j]]){ans++;}
		
	}
	cout<<ans<<endl;
	return 0;
}


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

int main() {
    vector<string> w;
    int n;
    bool f = true;

    cin >> n;
    for (int i = 0; i < n; i++) {
        string a;
        cin >> a;
        w.push_back(a);
    }

    char c;
    for (int i = 0; i < n; i++) {
        string::iterator itr = w[i].begin();

        if (i >= 1 && c != *itr) f = false;

        itr = w[i].end();
        --itr;
        c = *itr;

        for (int j = 0; j < i; j++) 
            if (w[i] == w[j]) f = false;
    }

    if (f) cout << "Yes";
    else cout << "No";
    cout << endl;
}

Measured memory_bytes: 256
function Main(input) {
	var str = input;
	str = str.split("\n")[0];
    str = str.split(' ');
    var thp = Number(str[0]);
    var tpw = Number(str[1]);
    var ahp = Number(str[2]);
    var apw = Number(str[3]);
    while(thp > 0 && ahp > 0 ){
   		ahp = ahp - tpw;
   		if(ahp <=0){
   			console.log("Yes");
   			break;
   		}
   		thp = thp - apw;
   		if(thp <=0){
   			console.log("No");
   			break;
   		}
    }
}
 //*おまじない
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29552
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextStrArray();
  var X = one[0];
  var Y = one[1];
  var list = "ABCDEF".split("");
  if(list.indexOf(X) < list.indexOf(Y)){
     myout("<");
  }else if(list.indexOf(X) > list.indexOf(Y)){
     myout(">");      
  }else{
     myout("=");
  }
}

Measured memory_bytes: 11468
S = input()

flag = 1
S1 = ""
S2 = ""
N = int(input())
for i in range(N):
  line = input().split()
  if line[0] == "1":
    if flag == 1:
      flag = 2
    else:
      flag = 1
  else:
    if flag == 1:
      if line[1] == "1":
        S1 = line[2] + S1
      else:
        S2 = S2 + line[2]
    else:
      if line[1] == "1":
        S2 = S2 + line[2]
      else:
        S1 = line[2] + S1

S = S1 + S + S2
if flag == 2: S = S[::-1]
print(S)

Measured memory_bytes: 4496
#!/usr/bin/env python3
#CODEFESTIVAL2016 qualC C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
t = LI()
a = LI()
x = [0]*n
y = [0]*n
if a[0] != t[-1]:
    print(0)
    quit()
for i in range(1,n):
    if t[i] > t[i-1]:
        x[i] = 1
for i in range(1,n)[::-1]:
    if a[i] < a[i-1]:
        y[i-1] = 1
ans = 1
for i in range(1,n-1):
    if x[i] == 1 and y[i] == 1:
        if t[i] != a[i]:
            print(0)
            quit()
    elif x[i] == 1:
        if a[i] < t[i]:
            print(0)
            quit()
    elif y[i] == 1:
        if a[i] > t[i]:
            print(0)
            quit()
    else:
        ans *= min(t[i],a[i])
        ans %= mod
print(ans)


Measured memory_bytes: 74340
#include <cstdio>
using namespace std;
int in(){ int x; scanf("%d", &x); return x; }
int main(){
	int watch = in();
	int h=watch/3600, m=(watch%3600)/60, s=(watch%3600)%60;
	printf("%d:%d:%d\n", h, m, s);
	return 0;
}

Measured memory_bytes: 1020
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

using vi = vector<int>;

const int Z = 1e9+7;

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

    int n, k;
    cin >> n >> k;
    vi a0, a1, a2;
    for (int i = 0; i < n; i++) {
        int t;
        cin >> t;

        if (t > 0) {
            a2.push_back(t);
        } else if (t == 0) {
            a1.push_back(t);
        } else {
            a0.push_back(t);
        }
    }

    sort(a0.begin(), a0.end());
    sort(a2.begin(), a2.end());

    int ans = 1;
    if ((int)a0.size() + (int)a2.size() < k) {
        ans = 0;
    } else if (a2.size() > 0) {
        if (k % 2 == 1) {
            ans = a2.back();
            a2.pop_back();
            k--;
        }

        for (int i = 0, p = 0, q = (int)a2.size() - 1; i < k; i += 2) {
            if ((p + 1 >= (int)a0.size() && q - 1 >= 0) || (q - 1 >= 0 && 1ll * a2.at(q) * a2.at(q - 1) >= 1ll * a0.at(p) * a0.at(p + 1))) {
                ans = 1ll * ans * a2.at(q) % Z * a2.at(q - 1) % Z;
                q -= 2;
            } else if ((q - 1 < 0 && p + 1 < (int)a0.size()) || (p + 1 < (int)a0.size() && 1ll * a0.at(p) * a0.at(p + 1) >= 1ll * a2.at(q) * a2.at(q - 1))) {
                ans = 1ll * ans * a0.at(p) % Z * a0.at(p + 1) % Z;
                p += 2;
            } else if (a1.size() > 0) {
                ans = 0;
            } else {
                ans = 1ll * ans * a2.at(q) % Z * a0.at(p) % Z;
                p++, q--;
            }
        }
    } else if (k % 2 == 0) {
        for (int i = 0; i < k; i++) {
            ans = 1ll * ans * a0.at(i) % Z;
        }
    } else if (a1.size() > 0) {
        ans = 0;
    } else {
        for (int i = 0; i < k; i++) {
            ans = 1ll * ans * a0.at(a0.size() - 1 - i) % Z;
        }
    }

    ans = (ans + Z) % Z;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4592
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using V = vector<int>;
using S = string;
using C = char;

const double pi = 3.1415926535;

void Main()
{
	int x;
	cin >> x;
	if (100 <= x && x <= 105 || 
		200 <= x && x <= 210 || 
		300 <= x && x <= 315 || 
		400 <= x && x<= 420 || 
		500 <= x &&x<= 525 || 
		600 <= x &&x<= 630 || 
		700 <= x &&x<= 735 || 
		800 <= x &&x<= 840 || 
		900 <= x &&x<= 945 || 
		1000 <= x &&x<= 1050 || 
		1100 <= x &&x<= 1155 || 
		1200 <= x &&x<= 1260 || 
		1300 <= x &&x<= 1365 || 
		1400 <= x &&x<= 1470 || 
		1500 <= x &&x<= 1575 || 
		1600 <= x &&x<= 1680 || 
		1700 <= x &&x<= 1785 || 
		1800 <= x &&x<= 1890 || 
		1900 <= x &&x<= 1995 || 
		2000 <= x &&x<= 2100 || 
		2100 <= x) {
			cout << 1 << endl;
		} else {
			cout << 0 << endl;
		}
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 3668
#include <iostream>
#include <stdlib.h>
#include <queue>
#include <cstring>
#define MAX_NUM 1010
using namespace std;
int H, W, N;
bool flag[MAX_NUM][MAX_NUM] = {false};                            //??是否已遍??
int dir[4][2] = { {1, 0}, { -1, 0}, {0, 1}, {0, -1} };

class Node {
  public:
    Node();
    Node(int x, int y, int step);
    ~Node();
    int x;
    int y;
    int step;
};

Node::Node() {
}

Node::Node(int x, int y, int step) {
    this->x = x;
    this->y = y;
    this->step = step;
}

Node::~Node() {
}

int BFS(char map[][MAX_NUM], int sx, int sy, int ex, int ey) {
    queue<Node> que;                                                  //第一次出?Memory Limit Exceeded,一定不能使用new来?行?建
    Node node(sx, sy, 0);
    que.push(node);
    flag[sx][sy] = true;                                              //将遍?的?点?置?true

    while(!que.empty()) {
        Node cur = que.front();
        que.pop();

        if(cur.x == ex && cur.y == ey) {
            return cur.step;

        } else {
            for(int i = 0; i < 4; i++) {
                int k = cur.x + dir[i][0];
                int v = cur.y + dir[i][1];

                if(k >= 0 && k < H && v >= 0 && v < W && map[k][v] != 'X' && !flag[k][v]) { //将可到?并且尚未遍?的?点加入?列
                    Node temp(k, v, cur.step + 1);
                    que.push(temp);
                    flag[k][v] = true;
                }
            }
        }
    }

    return -1;
}

int main() {
    int sx, sy, arr[10][2];
    char map[MAX_NUM][MAX_NUM];

    if(cin >> H >> W >> N && H && W) {
        for(int i = 0; i < H; i++) {
            for(int j = 0; j < W; j++) {
                cin >> map[i][j];

                if(map[i][j] == 'S') {
                    map[i][j] = '.';
                    sx = i;
                    sy = j;
                }

                if(isdigit(map[i][j])) {
                    int index = map[i][j] - '0';
                    arr[index][0] = i;
                    arr[index][1] = j;
                }
            }
        }

        arr[0][0] = sx;
        arr[0][1] = sy;
        int res = 0;

        for(int i = 0; i + 1 <= N; i++) {
            memset(flag, false, sizeof(flag));
            res += BFS(map, arr[i][0], arr[i][1], arr[i + 1][0], arr[i + 1][1]);
        }

        cout << res << endl;
    }

    return 0;
}

Measured memory_bytes: 5116
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

struct restaurant
{
    int idx;
    string city;
    int score;

    bool operator<(const restaurant &another) const
    {
        if (city != another.city) return city < another.city;
        else return score > another.score;
    };
};

int main()
{
    int n;
    cin >> n;
    vector<restaurant> r(n);
    string s;
    int p;
    for (int i = 0; i < n; i++) {
        cin >> s >> p;
        r[i].idx = i+1;
        r[i].city = s;
        r[i].score = p;
    }

    sort(r.begin(), r.end());

    for (int i = 0; i < n; i++) cout << r[i].idx << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
using namespace std;
const int maxn=100100;
struct node{string s;int t;};
node q[maxn];
int n,T;
int main(){
	int n=10;
	cin>>n>>T;
	int head=0,tail=0;
	for(int i=0;i<n;i++){
		string s;
		int t;
		cin>>s>>t;
		q[tail++]=(node){s,t};
	}
	int Time=0;
	while(head!=tail){
		node d=q[head];head=(head+1)%maxn;
		if(d.t<=T){
			Time+=d.t;
			cout<<d.s<<" "<<Time<<endl;
		}
		else{
			Time+=T;
			q[tail]=(node){d.s,d.t-T};
			tail=(tail+1)%maxn;
		}
	}
	return 0;
}

Measured memory_bytes: 7020
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int n,m,k;
double ans;
void dfs(vector<int> vec){
	if(vec.size()==n){
		int sum = 0;
		rep(i, n)sum +=vec[i];
		ans +=max(1,sum-k)/pow((double)m,(double)n);
		return;
	}
	repi(i, 1, m+1){
		vec.push_back(i);
		dfs(vec);
		vec.pop_back();
	}
	return ;
}


int main(){
	//double sum = 0;
	while(cin>>n>>m>>k,n||m||k){
	vector<int> v;
	v.clear();
	ans = 0;
	dfs(v);
	printf("%.8lf\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1296
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.stream.IntStream;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    UnionFind uf = new UnionFind(n);
    for(int i = 0; i < m; i++){
      String[] data = br.readLine().split(" ");
      int ai = Integer.parseInt(data[0]) - 1;
      int bi = Integer.parseInt(data[1]) - 1;
      uf.unite(ai, bi);
    }
    br.close();
    System.out.println(IntStream.of(uf.size).max().getAsInt());
  }
}

class UnionFind {
  private final int N;
  int[] parent;
  int[] rank;
  int[] size;

  UnionFind(int n) {
    N = n;
    parent = new int[N];
    Arrays.setAll(parent, i -> i);
    size = new int[N];
    Arrays.fill(size, 1);
    rank = new int[N];
  }

  boolean isRoot(int x) {
    return x == parent[x];
  }

  int root(int x) {
    return isRoot(x) ? x : (parent[x] = root(parent[x]));
  }

  boolean same(int x, int y){
    return root(x) == root(y);
  }

  int size(int x) {
    return size[root(x)];
  }

  void unite(int x, int y){
    x = root(x);
    y = root(y);
    if (x != y) {
      if (rank[x] < rank[y]) {
        parent[x] = y;
        size[y] += size[x];
      } else {
        parent[y] = x;
        size[x] += size[y];
        if (rank[x] == rank[y]) {
          rank[x]++;
        }
      }
    }
  }
}


Measured memory_bytes: 59924
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;
    
    vector<int> vec(N);
    for(int i = 0; i < N; i++){
        cin >> vec[i];
    }
    
    int count = 0;
    for(int i = 0; i < N; i++){
        for(int j = i+1; j < N; j++){
            for(int k = j+1; k < N; k++){
                if(vec[i] != vec[j] && vec[j] != vec[k] && vec[i] != vec[k] && vec[i] + vec[j] > vec[k] && vec[i] + vec[k] > vec[j] && vec[j] + vec[k] > vec[i]){
                    count++;
                    
                }
            }
        }
    }
    
    cout << count << endl;
}

Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	}

}


Measured memory_bytes: 27860
const M: u64 = 1000_000_007;

fn main() {
    proconio::input! {
        n: usize,
        m: usize,
    }

    let c = Combination::new(m);
    let mut sign = false;
    let mut r = 0;
    for i in 0..=n {
        let k = c.comb(n, i) * c.perm(m - i, n - i) % M;
        if sign {
            if k > r {
                r += M;
            }
            r -= k;
        } else {
            r += k;
            if r > M {
                r -= M;
            }
        }
        sign ^= true;
    }

    println!("{}", r * c.perm(m, n) % M);
}

struct Combination {
    fact: Vec<u64>,
    inv_fact: Vec<u64>,
}

impl Combination {
    fn new(n: usize) -> Combination {
        let mut fact = vec![1; n + 1];
        for i in 1..=n {
            fact[i] = fact[i - 1] * i as u64 % M;
        }
        let mut inv_fact = vec![1; n + 1];
        inv_fact[n] = pow(fact[n], M - 2);
        for i in (1..=n).rev() {
            inv_fact[i - 1] = inv_fact[i] * i as u64 % M;
        }

        Combination {fact, inv_fact}
    }

    fn perm(&self, n: usize, r: usize) -> u64 {
        self.fact[n] * self.inv_fact[n - r] % M
    }
    
    fn comb(&self, n: usize, r: usize) -> u64 {
        self.perm(n, r) * self.inv_fact[r] % M
    }
}

fn pow(mut a: u64, mut n: u64) -> u64 {
    let mut r = 1;
    while n > 0 {
        if n & 1 > 0 {
            r = r * a % M;
        }
        a = a * a % M;
        n >>= 1;
    }
    r
}


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

int main() {
	int N;
	cin >>N;
	int max=-1 , count=0 , x;
	for(int i=0;i<N;i++){
		cin >> x;
		if(x>=max){
			count++;
			max=x;
		}
	}
	cout << count;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> data(n);
    for(int i = 0; i < n; i++) cin >> data[i];
    sort(data.begin(), data.end());
    int temp = -1;
    int count = 0;
    for(int i = 0; i < n; i++){
        if(temp < data[i]){
            count++;
            temp = data[i];
        }
    }
    cout << count << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <numeric>
typedef long long ll;
using namespace std;
const int MOD = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
//#define int long long
#define all(vec) vec.begin(), vec.end()
#define dbg(x) cerr << #x << " = " << (x) << endl
#define yn(b) cout << ((b) ? "Yes" : "No") << endl
#define YN(b) cout << ((b) ? "YES" : "NO") << endl
#define isEven(t) t % 2 == 0

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

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

	int A,B,C,D,X,Y;
	cin>>A>>B>>C>>D;
	X=A*B;
	Y=C*D;

	cout << max(X, Y) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int max(int a, int b){return a>b?a:b;}

typedef struct {
    int i;
    int count;
} count_t;

int sort(const void *a, const void *b){
    if (((count_t*)a)->count!=((count_t*)b)->count){
        return ((count_t*)b)->count-((count_t*)a)->count ;
    } else {
        return 0;
    }
}

int main(void){
    int n,v;
    count_t count1[100001],count2[100001];
    for (int i=0; i<100001; i++){
        count1[i].i=i;
        count1[i].count=0;
        count2[i].i=i;
        count2[i].count=0;
    }
    scanf("%d",&n);
    for (int i=0; i<n; i++){
        scanf("%d",&v);
        if (i%2!=0){
            count1[v].count++;
        } else {
            count2[v].count++;
        }
    }
    qsort (count1,100001,sizeof(count_t),sort);
    qsort (count2,100001,sizeof(count_t),sort);
    if (count1[0].i!=count2[0].i){
        printf("%d\n",n-(count1[0].count+count2[0].count));
    } else {
        printf("%d\n",n-max(count1[0].count+count2[1].count,count1[1].count+count2[0].count));
    }
	return 0 ;
}

Measured memory_bytes: 2352
package main

import (
    "fmt"
)

func main() {
    var n, m int
    fmt.Scan(&n)
    fmt.Scan(&m)
    s := make([][]int, m)
    for i := 0; i < m; i++ {
       var k int
       fmt.Scan(&k)
       s[i] = make([]int, k)
       for j := 0; j < k; j++ {
           fmt.Scan(&s[i][j])
       }
    }
    p := make([]int, m)
    for i := 0; i < m; i++ {
        fmt.Scan(&p[i])
    }
    total := 0
    sw := make([]int, n)
    for i := 0; i < (1 << uint(n)); i++ {
        for j := 0; j < n; j++ {
            sw[j] = (i >> uint(j)) & 1
        }
        result := true
        for j := 0; j < m; j++ {
            count := 0
            for k := 0; k < len(s[j]); k++ {
                if sw[s[j][k]-1] == 1 {
                    count += 1
                }
            }
            if count % 2 != p[j] {
                result = false
                break
            }
        }
        if result {
            total += 1
        }
    }
    fmt.Println(total)
}


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

namespace ABC066A
{
	class Program
	{
		static void Main(string[] args)
		{
			int a, b, c, s;

			string[] word = Console.ReadLine().Split(' ');

			a = int.Parse(word[0]);
			b = int.Parse(word[1]);
			c = int.Parse(word[2]);

			if (a > b && a > c)
				s = b + c;
			else if (b > a && b > c)
				s = a + c;
			else
				s = a + b;
			Console.WriteLine(s);
		}
	}
}


Measured memory_bytes: 27508
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

const ll INF = 1LL << 50;
ll N, M;
vector<pair<ll, ll>> E[100000];
bool visited[100000];
ll a[100000], b[100000];
ll l = 1, h = INF;
bool only = false, none = false;

void dfs(ll v, ll p, ll sign, ll sum) {
  // cerr << v << " " << p << " " << sign << " " << sum << endl;

  if(visited[v]) {
    if(sign == a[v]) {
      if(b[v] != sum) none = true;
    } else {
      ll g = (b[v] - sum) * sign;
      // cerr << v << " " << g << endl;
      if(g % 2 != 0) {
        none = true;
      } else {
        if(only) {
          if(g / 2 != l) none = true;
        } else {
          l = g / 2;
          h = g / 2;
          only = true;
        }
      }
    }
    return;
  }
  visited[v] = true;

  a[v] = sign;
  b[v] = sum;

  if(sign == 1) {
    l = max(l, -b[v] + 1);
    if(l > h) none = true;
  }
  if(sign == -1) {
    h = min(h, b[v] - 1);
    if(l > h) none = true;
  }

  for(auto w : E[v]) {
    ll u = w.first;
    ll s = w.second;
    if(u != p) dfs(u, v, -sign, s - sum);
  }
}

int main(void) {
  cin >> N >> M;
  REP(i, 0, M) {
    ll U, V, S; cin >> U >> V >> S; U--; V--;
    E[U].push_back(make_pair(V, S));
    E[V].push_back(make_pair(U, S));
  }

  REP(i, 0, N) visited[i] = false;
  dfs(0, -1, 1, 0);

  // cerr << "none: " << none << endl;
  // cerr << "only: " << only << endl;
  // cerr << "l: " << l << endl;
  // cerr << "h: " << h << endl;

  if(none) cout << 0 << endl;
  else if(only) cout << 1 << endl;
  else cout << h - l + 1 << endl;
}

Measured memory_bytes: 15744
#include <bits/stdc++.h>
#define FI first
#define SE second
#define PB push_back
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define co(i) cout<<(i)<<endl
#define fcout cout<<fixed<<setprecision(10)
#define uni(i) i.erase(unique(i.begin(), i.end()), i.end());
#define all(i) i.begin(),i.end()
#define pint pair<ll, ll>
#define vint vector<int>
using namespace std;

const int INF=1e9+7;
const ll LINF=1e18;
const int MOD=1e9+7;
//const int MOD=998244353;

int n;
ll a[100001],b[100001],c[100001];
vector<pint> v;
int main(){
	cin>>n;
	FOR(i,0,n){
		cin>>a[i]>>b[i];
		v.PB(pint(a[i]+b[i],a[i]));
	}
	sort(v.rbegin(),v.rend());
	ll ans=0;
	FOR(i,0,n){
		ll aa=v[i].second,bb=v[i].first-v[i].second;
		if(i%2==0){
			ans+=aa;
		}else{
			ans-=bb;
		}
	}
	co(ans);
}


Measured memory_bytes: 3568
use proconio::{fastout, input};
use std::io::*;
use std::str::FromStr;

use std::cmp::{max, min};

use std::collections::HashSet;
struct PrimeFactorize {
    v: Vec<i64>,
}

impl PrimeFactorize {
    fn new(max_n: i64) -> PrimeFactorize {
        let mut v = vec![0; max_n as usize + 1];
        let mut a = 2;

        while a * a < max_n {
            if v[a as usize] != 0 {
                a += 1;
                continue;
            }

            let mut b = 2 * a;
            while b <= max_n {
                if v[b as usize] == 0 {
                    v[b as usize] = a;
                }
                b += a;
            }
            a += 1;
        }
        PrimeFactorize { v }
    }

    fn factorize(&self, n: i64) -> Vec<i64> {
        let mut a = n;
        let mut primes = vec![];
        loop {
            let va = self.v[a as usize];
            if va == 0 {
                primes.push(a);
                break;
            }
            primes.push(va);
            a /= va;
        }
        primes
    }

    fn factorize_unique(&self, n: i64) -> Vec<i64> {
        let mut uniq = HashSet::new();
        let primes = self.factorize(n);
        for i in 0..primes.len() {
            uniq.insert(primes[i]);
        }
        uniq.into_iter().collect::<Vec<i64>>()
    }
}

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

    let mut cnt: Vec<i64> = vec![0; 1_000_001];
    let mut done = vec![false; 1_000_001];
    cnt[1] = 1;
    let pf = PrimeFactorize::new(1_000_001 as i64);

    for i in 0..a.len() {
        let primes = pf.factorize_unique(a[i]);
        for j in 0..primes.len() {
            if primes[j] == 1 {
                continue;
            }
            cnt[primes[j] as usize] += 1;
        }
    }

    if cnt.iter().all(|&x| x == 0 || x == 1) {
        println!("pairwise coprime");
    } else if *cnt.iter().max().unwrap() != n as i64 {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}


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

int main() {
  int N, K;
  scanf("%d%d", &N, &K);

  vector<int> x(N, 0);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x.at(i));
  }

  ll ans = 1e9;
  for (int i = 0; i <= N - K; i++) {
    ll left = x.at(i);
    ll right = x.at(i + K - 1);
    ll movement = min(abs(left) + right - left, abs(right) - left + right);
    ans = min(ans, movement);
  }

  printf("%lld", ans);
  return 0;
}


Measured memory_bytes: 640
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
hole = [0]*(n+1)
for i in range(m):
  hole[int(input())] = 1

dp = [0]*(n+1)
dp[0] = 1
MOD = 10**9+7
   
for i in range(1,n+1):
  if hole[i]==1:
    dp[i] = 0
  else:
    dp[i] = dp[i-1]+dp[i-2]
    dp[i] %= MOD

print(dp[-1])  


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

int main() {
  int N, A, B, Sum=0, Sum2=0;
  string S;
  cin >> N >> A >> B >> S;
  rep(i, S.size()){
    if(S.at(i)=='a'){
      if(Sum+1<=A+B){
        cout << "Yes" << endl;
        Sum++;
      }
      else cout << "No" << endl;
    }
    if(S.at(i)=='b'){
      if(Sum+1<=A+B && Sum2+1<=B){
        cout << "Yes" << endl;
        Sum2++;
        Sum++;
      }
      else cout << "No" << endl;
    }
    if(S.at(i)=='c') cout << "No" << endl;
  }
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 1e18
#define INFLL 1000000000000000007LL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define PI (acos(-1))
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
typedef pair<pill,int> PA;
//ll MOD;
ll MOD = 1000000007;
// ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	ll weight;
};
int N;
ll hoge[114514];
ll bik[114514];
ll bikinv[114514];
ll gcd(ll a, ll b) {
	return b != 0 ? gcd(b, a % b) : a;
}
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}
// a x + b y = gcd(a, b)
ll extgcd(ll a, ll b, ll &x, ll &y) {
	ll g = a; x = 1; y = 0;
	if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
	return g;
}
ll invMod(ll a, ll m) {
	ll x, y;
	if (extgcd(a, m, x, y) == 1) return (x + m) % m;
	else                         return 0; // unsolvable
}
void bikcal(int NN){
	ll hoge=(ll)1;
	bik[0]=(ll)1;
	bikinv[0]=(ll)1;
	for(int i=1;i<=NN;i++){
		hoge=(hoge*i)%MOD;
		bik[i]=hoge;
		bikinv[i]=invMod(bik[i],MOD);
	}
}


ll Comb(int a,int b){
	ll ret;
	ret=(((bik[a]*bikinv[b])%MOD)*bikinv[a-b])%MOD;
	return ret;
}


ll powMod(ll x, ll k, ll m) {//x^k (mod n)
	if (k == 0)     return 1;
	if (k % 2 == 0) return powMod(x*x % m, k/2, m);
	else            return x*powMod(x, k-1, m) % m;
}
int main(){
	cin>>N;
	rep(i,N)cin>>hoge[i];
	ll ans=0;
	bikcal(N);
	ll sum=0;
	rep(i,N-2){
		sum+=hoge[N-2-i]-hoge[i];
		//cout<<sum<<endl;
		sum%=MOD;
		ll len=sum;
		len*=bik[N-1];
		len%=MOD;
		len*=invMod(i+1,MOD);
		len%=MOD;
		len*=invMod(i+2,MOD);
		len%=MOD;
		ans+=len;
		ans%=MOD;

	}
	//cout<<ans<<endl;
	rep(i,N-1){
		ll len=hoge[N-1]-hoge[N-i-2];
		len*=bik[N-1];
		len%=MOD;
		len*=invMod(i+1,MOD);
		len%=MOD;
		ans+=len;
		ans%=MOD;

	}
	cout<<ans<<endl;
}


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

int main() {
  long long A, B, N;
  cin >> A >> B >> N;
  long long res;
  if (B > N) res = (A*N)/B;
  else if (B==N) res = (A*(N-1))/B;
  else res = (A*(B-1))/B;
  cout << res << endl;
}


Measured memory_bytes: 3672
from collections import deque
s=input()
q=deque([])
q.append(s[0])
#print(q)
count=0
for i in s[1:]:
    if len(q)==0:
        q.append(i)
    elif i=='0':
        x=q.pop()
        if x=='1':
            count+=2
        else:
            q.append(x)
            q.append('0')
    else:
        #print('annu')
        x=q.pop()
        if x=='0':
            count+=2
        else:
            q.append(x)
            q.append('1')
print(count)
    


Measured memory_bytes: 4340
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000



int main(){
	
	int H,W;
	cin>>H>>W;
	
	vector<string> S(H);
	
	for(int i=0;i<H;i++){
		cin>>S[i];
	}
	
	vector<vector<int>> dp(H*W,vector<int>(H*W,Inf));
	
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			int from = i*W+j;
			if(S[i][j]=='#')continue;
			dp[from][from] = 0;
			if(j!=0){
				if(S[i][j-1]=='.')dp[from][from-1] = 1;
			}
			
			if(j!=W-1){
				if(S[i][j+1]=='.')dp[from][from+1] = 1;
			}
			
			if(i!=0){
				if(S[i-1][j] == '.')dp[from][from-W]=1;
			}
			
			if(i!=H-1){
				if(S[i+1][j]=='.')dp[from][from+W]=1;
			}
		}
	}
	
	for(int i=0;i<H*W;i++){
		for(int j=0;j<H*W;j++){
			for(int k=0;k<H*W;k++){
				dp[j][k] = min(dp[j][k],dp[j][i] + dp[i][k]);
			}
		}
	}
	
	int ans = 0;
	
	for(int i=0;i<H*W;i++){
		for(int j=0;j<H*W;j++){
			if(dp[i][j]==Inf)continue;
			ans = max(ans,dp[i][j]);
		}
	}
	
	cout<<ans<<endl;
	
    return 0;
}


Measured memory_bytes: 896
#include <stdio.h>

int main(void)
{
    int b, r, g, c, s, t;
    int m;
    int bonus;
    
    while (1){
        scanf("%d%d%d%d%d%d", &b, &r, &g, &c, &s, &t);
        if ((b | r | g | c | s | t) == 0){
            break;
        }
        
        m = 100;
        
        // ゲームで投入するメダル
        m -= (b * 3 + r * 3 + g * 3 + c * 3 + s * 3);

        // 図柄がそろって得るメダル
        m += (b * 15 + r * 15 + g * 7 + c * 2);
        
        // スターで投入しなくていいメダル
        m += (s * 3);
        
        // ボーナスゲーム数
        bonus = b * 5 + r * 3;
        if (t - b - r - g - c - s < bonus){
            bonus = t - b - r - g - c - s;
        }
        
        // ボーナスゲームで得られるメダル
        m += ((15 - 2) * bonus);
        
        // 図柄がそろわず失うメダル
        m -= ((t - b - r - g - c - s - bonus) * 3);
        
        printf("%d\n", m);
    }
    return (0);
}

Measured memory_bytes: 596
#include <iostream>
using namespace std;
int main(void){
    int i, j, H, W;
    
    while(cin >> H >> W){
        if(H == 0 && W == 0)    break;
        for(i = 0; i < H; i++){
            for (j = 0; j < W; j++){
                if(i == 0 || i == H - 1 || j == 0 || j == W - 1){
                    cout << "#";
                }
                else{
                    cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 3080
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <utility>
#include <deque>
#include <stack>
#include <bitset>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define rep(i,n) for (int i=0;i<n;++i)
#define REP(i,n) for (int i=1;i<=n;++i)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define read(x) scanf("%d",&x)
int n,m;
priority_queue<int> pq;
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>m;
	REP(i,n){
		int x;cin>>x;pq.push(x);
	}
	while(m--){
		int x=pq.top();pq.pop();x/=2;pq.push(x);
	}
	ll ans=0;
	while(!pq.empty()){
		ans+=pq.top();pq.pop();
	}
	cout<<ans<<endl;
	return 0;
}

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

public class Main {
	static int min;
	static ArrayList<Integer> caca1 = new ArrayList<Integer>();
	static ArrayList<Integer> caca2 = new ArrayList<Integer>();
	public static void melec(int sum1, int sum2, int ind) {
		if(ind==caca1.size()) {
			if(sum1-sum2>min)min=sum1-sum2;
			return;
		}
		melec(sum1+caca1.get(ind),sum2+caca2.get(ind),ind+1);
		melec(sum1,sum2,ind+1);
	}
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		int n1 = br.ni();
		min = 0;
		for(int i = 0;i<n1;i++) {
			caca1.add(br.ni());
		}for(int i = 0;i<n1;i++) {
			caca2.add(br.ni());
		}melec(0,0,0);
		System.out.println(min);
	}
}

class FastScanner {
	BufferedReader br;
	StringTokenizer st;

	public FastScanner(String s) {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	public FastScanner() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	ArrayList<Integer>[] ng(int n, int e) {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	}

	Integer[] nIa(int n) {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	int[] nia(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	Long[] nLa(int n) {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	long[] nla(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	String[] nsa(int n) {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	}

	String nt() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int ni() {
		return Integer.parseInt(nt());
	}

	long nl() {
		return Long.parseLong(nt());
	}

	double nd() {
		return Double.parseDouble(nt());
	}

}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define boost ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define M 1000000007
#define eb emplace_back
#define watch(x) cout << (#x) <<" is "<< x <<"\n";


using namespace std;
//const int N = 1e6;

int32_t main(){
  boost;
  int tc = 1; //cin >> tc;
  while(tc--)
  {
    int n; cin >> n;
    int arr[n];
    for(int i=0; i<n; i++)
      cin >> arr[i];
    int sum[n]; sum[n-1] = arr[n-1];
    for(int i=n-2; i>=0; i--)
      sum[i] = (arr[i] + sum[i+1]) %M;
    /*for(auto i : sum)
      cout << i <<" ";*/
    int ans = 0;
    for(int i=0; i<n-1; i++)
    {
      ans += ((arr[i]%M) * ((sum[i+1]%M))%M);
      ans %= M;
    }
    cout << ans <<"\n";

  }
}



Measured memory_bytes: 6760
#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; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
int GCD(int a,int b){return b?GCD(b,a%b):a;}
int LCM(int a,int b){return (a*b)/GCD(a,b);}
int abs(int x){return x>0?x:-x;}
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

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

	if (n == 25) cout << "Christmas" << endl;
	else if (n == 24) cout << "Christmas Eve" << endl;
	else if (n == 23) cout << "Christmas Eve Eve" << endl;
	else cout << "Christmas Eve Eve Eve" << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.regex.Pattern;
import java.util.stream.IntStream;

public class Main {
    public void solve(Stdin stdin, PrintWriter stdout) throws NumberFormatException, IOException {
        String s = stdin.next();
        String t = "CODEFESTIVAL2016";
        long ans = IntStream.range(0, s.length()).filter(i -> s.charAt(i) != t.charAt(i)).count();
        stdout.println(ans);
    }

    public static void main(String[] args) throws NumberFormatException, IOException {
        Stdin stdin = new Stdin();
        PrintWriter stdout = new PrintWriter(System.out, false);
        new Main().solve(stdin, stdout);
        stdout.flush();
    }

    public static class Stdin {
        private Deque<String> queue;
        private BufferedReader stdin;
        private Pattern delimiter;

        public Stdin() {
            queue = new ArrayDeque<>();
            stdin = new BufferedReader(new InputStreamReader(System.in));
            delimiter = Pattern.compile(" ");
        }

        public String next() throws IOException {
            if (queue.isEmpty()) {
                delimiter.splitAsStream(stdin.readLine()).forEach(queue::addLast);
            }
            return queue.removeFirst();
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
}


Measured memory_bytes: 27988
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;


int main(){
  ll n; cin >> n;
  cout << n*(n-1)/2 << endl;
}

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

int main() {
	double W, H, x, y;
	cin >> W >> H >> x >> y;
	printf("%.10f ", 0.5 * H * W);
	cout << (2.0 * x == W && 2.0 * y == H) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[2][100005],maxm=-1;
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        a[0][x]++;
        maxm=max(maxm,x);
    }
    a[1][0]=a[0][0];
    for(int i=1;i<=maxm;i++)
    {
        a[1][i]=a[1][i-1]+a[0][i];
    }
    int ans=0;
    for(int i=1;i<=maxm;i++)
    {
        if(a[1][i-1]==n-a[1][i-1])
        {
            ans++;
        }
    }
    /*for(int i=0;i<2;i++)
    {
        for(int j=0;j<=maxm;j++)
        {
            cout<<a[i][j]<<" ";
        }
        cout<<endl;
    }*/
    cout<<ans;
    return 0;
}










Measured memory_bytes: 1152
#include <iostream>

using namespace std;

int main()
{
    int a[4], b[4];

    while (cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3]) {
        int hit = 0, blow = 0;
        
        for (int i = 0; i < 4; i++)
            if (a[i] == b[i])
                hit++;
        for (int i = 0; i < 4; i++)
            for (int j = 0; j < 4; j++) {
                if (i == j)
                    continue;
                if (a[i] == b[j])
                    blow++;
            }
        cout << hit << " " << blow << endl;
    }

    return 0;
}

Measured memory_bytes: 1160
using System;
class Program
{
	static void Main(string[] args)
	{
        int N = int.Parse(Console.ReadLine());
        int[] input = new int[N];
        int[] dest = new int[N];

        for(int i=0; i<N; i++){
            input[i] = int.Parse(Console.ReadLine());
        }
        Array.Copy(input, dest, N);
        Array.Sort(dest);

        for(int i=0; i<N; i++){
            if(input[i] == dest[N-1]){
                Console.WriteLine(dest[N-2]);
            }else{
                Console.WriteLine(dest[N-1]);
            }
        }
	}
}

Measured memory_bytes: 18584
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
#define P(a,b) make_pair(a,b);
ll MOD = 1000000007;
//ll INF = 21474836470000000;
ll INF = 1001001001001001001;
long double EPS = 1e-11;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;

int main(){
  string S;
  cin >> S;
  cout << S.substr(0,S.size()-8) << endl;
}


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

int main() {
  ll a[3];
  cin >> a[0] >> a[1] >> a[2];
  sort(a, a + 3);
  ll red = a[2] / 2 * a[0] * a[1];
  ll blue = (a[2] - (a[2] / 2)) * a[0] * a[1];
  cout << blue - red << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int k,x;
    int nmax = -10000; 
    scanf("%d%d", &k, &x);
    for(int i = x - (k - 1); i < x + k; i++){
        printf("%d",i);
        if(i != x + (k - 1))printf(" ");
    }
    printf("\n");
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
const ll INF = 1LL<<61;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll jou(ll N, ll P){if(P==0) return 1;
  if(P%2==0){ll t = jou(N, P/2);return t*t % mod;
  }return (N * jou(N, P-1)) % mod;}  //jou(n,mod-2)で逆元
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる




int main() {
    int h,w,a,b;
    cin >> h>>w>>a>>b;

  rep(i,b){
    rep(j,a) cout << 0;
    rep(j,w-a) cout << 1;
    cout << endl;
  }
  rep(i,h-b){
    rep(j,a) cout << 1;
    rep(j,w-a) cout << 0;
    cout << endl;
  }

}


Measured memory_bytes: 1280