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

int main(){
    int N,K;
    cin >> N >> K;
    int h[100000];
    for(int i=0;i<N;i++) cin >> h[i];
    int dp[100100];
    for(int i=0;i<100100;i++)dp[i] = INFINITY;
    dp[0] = 0;
    for(int i=0;i<N;i++){
        for(int k=1;k<=K;k++){
            if(i+k == N) break;
            dp[i+k] = min(dp[i]+abs(h[i+k]-h[i]), dp[i+k]);
        }
    }
    cout << dp[N-1] << endl;
    return 0;
}

Measured memory_bytes: 1024
n,m = gets.chomp.split.map(&:to_i)
a = []
n.times do
  a << gets.to_i
end
b = []
m.times do
  b << gets.to_i
end
t = []
m.times do |i|
	n.times do |j|
 	  if a[j] <= b[i]
        t << j+1
       	break
      end
	end
end

puts t.max_by { |v| t.count(v) }


Measured memory_bytes: 6900
#include<bits/stdc++.h>
#define two(a) (1<<(a))
#define LINF (1ll<<61)
#define EPS (1e-14)
#define Lshift(a,b) ((a)<<(b))
#define Rshift(a,b) ((a)>>(b))
#define rep(a,b) for(a=0 ; a<b ; a++)
#define xrep(a,b,c) for(a=b ; a<c ; a++)
#define INF (1<<29)
#define sz(a) int(a.size())
#define swap(a,b) ( (a^=b) , (b^=a) , (a^=b) )
#define GET(x) (mark[x>>5]>>(x&31)&1)
#define SET(x) (mark[x>>5]|=1<<(x&31))
#define maxL (10000000>>5)+1
#define mod 1000000007
#define vi vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define si set<int>
#define pb push_back
typedef long long ll;
using namespace std;


int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n;
    cin >> n;
    vi in(n + 1);
    int i, tmp;
    rep(i, n - 1) {
        cin >> tmp;
        in[tmp]++;
    }
    xrep(i, 1, n +1) {
        cout << in[i] << endl;
    }
}


Measured memory_bytes: 3992
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for (int i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;

int main(){
    int A, B; cin >> A >> B;
    for(int i=1; i<=1250; ++i){
        if(floor(i*0.08)==A&&floor(i*0.10)==B){
            cout << i <<endl;
            return 0;
        }
    }
    cout << "-1" << endl;
}


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

int main(){
  int n;
  cin>>n;
  vector<int> d(n);
  rep(i,n) cin>>d[i];
  sort(d.begin(),d.end());
  if(n%2!=0){
    cout<<0<<endl;
    return 0;
  }
  if(d[n/2]==d[n/2-1]){
    cout<<0<<endl;
    return 0;
  }
  else{
    cout<<d[n/2]-d[n/2-1]<<endl;
  }
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std ;
const int maxn = 1e5 + 5 ;
int n , q ;
char s[5] ;
bool vis[maxn] ;
int ans1[maxn] , ans2[maxn] ;
int cnt1 = 0 , cnt2 = 0 ;
int main()
{
	memset(vis , 0 , sizeof(vis)) ;
	memset(ans1 , 0 , sizeof(ans1)) ;
	memset(ans2 , 0 , sizeof(ans2)) ;
	scanf("%d%d" , &n , &q) ;
	while(q --)
	{
		int x ;
		scanf("%d%s" , &x , s) ;
		if(vis[x])  continue ;
		else if(s[0] == 'A')  vis[x] = 1 , ans1[x] = 1 ;
		else  ans2[x] ++ ;
	}
	for(int i = 1 ; i <= 1e5 ; i ++)
	   if(vis[i])  cnt1 ++ , cnt2 += ans2[i] ;
	printf("%d %d\n" , cnt1 , cnt2) ;
	return 0 ;
}

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

int main(){
  int x, sum=0;
  cin >> x;
  
  for(int i=1; x/i != 0; i*=10){
    sum += x % (i * 10) / i;
  }
  
  if(x%sum == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

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

using namespace std;

const int N = 5e5+5;

const int mod = 1e9+7;

int main(){
    string s;
    cin >> s;
    int mx = 0 , cnt = 0;
    for(int i = 0; i < 3; i++){
        if(s[i] == 'S')
            cnt = 0;
        if(s[i] == 'R')
            cnt++;
        mx = max(mx , cnt);
    }
    cout << mx << "\n";

}


Measured memory_bytes: 3624
package main

/*
コッホ曲線
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
	"strings"
)

// Point 座標
type Point struct {
	x, y float64
}

func (p Point) String() string {
	return fmt.Sprintf("%f %f", p.x, p.y)
}

func divide3(p, q Point) (Point, Point) {
	div3X := (q.x - p.x) / 3.0
	div3Y := (q.y - p.y) / 3.0
	return Point{p.x + div3X, p.y + div3Y}, Point{p.x + (div3X * 2), p.y + (div3Y * 2)}
}

// 座標上の点を回転する
func rotate(p1, p2 Point, angle float64) Point {
	sinT, cosT := math.Sincos(angle)
	newX := ((cosT * (p2.x - p1.x)) + (-sinT * (p2.y - p1.y))) + p1.x
	newY := ((sinT * (p2.x - p1.x)) + (cosT * (p2.y - p1.y))) + p1.y
	return Point{newX, newY}
}

// コッホ曲線を得る
func getKoch(p1, p2 Point) (Point, Point, Point) {
	// 線分を三分割する
	s, t := divide3(p1, p2)
	// s,tに対する頂点を求める
	u := rotate(s, t, math.Pi/3.0)
	// 3つの点がわかる.
	return s, u, t
}

func getKochNRec(p1, p2 Point, n int, result *[]Point) {
	if n == 0 {
		// 先頭だけ入れる
		*result = append(*result, p1)
	} else {
		s, u, t := getKoch(p1, p2)
		getKochNRec(p1, s, n-1, result)
		getKochNRec(s, u, n-1, result)
		getKochNRec(u, t, n-1, result)
		getKochNRec(t, p2, n-1, result)
	}
}
func getKochN(p1, p2 Point, n int) []Point {
	result := make([]Point, 0, int(math.Pow(4, float64(n)))+1)
	getKochNRec(p1, p2, n, &result)
	result = append(result, p2)
	return result
}

func main() {
	scanner := makeScanner(8192)
	n := eGetInt(scanner)
	result := getKochN(Point{0, 0}, Point{100, 0}, n)
	for _, p := range result {
		fmt.Printf("%v\n", p)
	}
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(max int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), max)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	var ints []int
	for _, f := range fields {
		ints = append(ints, eAtoi(f))
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = " "
	}
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}



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

public class Main {
	private static void solve(){
		//Implement solution here.
		int n = ni();
		int m = ni();
		int c = ni();
		int b[] = na(m);
		int result = 0;
		for(int i = 0; i < n; i++) {
			int tmp = 0;
			for(int j = 0; j < m; j++) {
				tmp += ni() * b[j];
			}
			result += tmp + c > 0 ? 1 : 0;
		}
		System.out.println(result);
	}

	//Switch input source (stdin/file)
	private static Scanner scanner = new Scanner(System.in);
	public static void main(String[] args){
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				scanner = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath)))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(scanner.nextLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

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

using namespace std;

bool used[101][101];

vector<string> field;
int W,H;

void solve(int x,int y,char ch){
  if(used[y][x])
    return;
  else if(field[y][x] == ch){
    used[y][x] = true;
    //    cout << y << " " << x << endl;
    for(int i = -1; i <= 1; i++){
      for(int j = -1; j <= 1; j++){
	if(i == 0 || j == 0){
	  if(x + j >= 0 && x + j < W && y + i >= 0 && y + i < H){
	    solve(x+j,y+i,ch);
	  }
	}
      }
    }
  }
  else
    return;
}

int main(){
  
  while(1){
    field.clear();
    for(int i = 0; i < 101; i++)
      fill(used[i],used[i]+101,false);
    
    cin >> H >> W;
    if(W == 0 || H == 0)
      break;
    string str;
    for(int i = 0; i < H; i++){
      cin >> str;
      field.push_back(str);
    }
    int cnt = 0;
    for(int i = 0; i < H; i++){
      for(int j = 0; j < W; j++){
	if(used[i][j])
	  continue;
	cnt++;
	//	cout << "cnt" << endl;
	solve(j,i,field[i][j]);
      }
    }
    cout << cnt << endl;
  }
  
  return 0;
}

Measured memory_bytes: 0
import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
a, b = map(int, input().split())
#s = input()
#s,t = input().split()
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

print(a*b)

Measured memory_bytes: 9152
#ifdef DBG1
  #define LOCAL
#endif

#ifdef LOCAL
  #define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#ifdef DBG1
    #define dbg(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dbg(...)
#endif

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;

const int P = 998244353;
int sum(int a, int b) {
  if ((a += b) >= P) {
    a -= P;
  }
  return a;
}

int prod(int a, int b) {
  return ll(a) * b % P;
}

map <string, int> cache;
map <string, int> cache2;

int solve(const string & s);
int solve2(const string & s) {
  auto it = cache2.find(s);
  if (it != cache2.end()) {
    return it->second;
  }

  int n = int(s.length());
  if (n == 1) {
    int ans = (s[0] == '0' ? 1 : 2);
    dbg("solve2(%s) = %d\n", s.c_str(), ans);
    return cache2[s] = ans;
  }

  int ans = 0;
  for (int len = 1; len < n; ++len) {
    if (n % len == 0) {
      string curS(len, '1');
      for (int i = 0; i < n; ++i) {
        if (s[i] == '0') {
          curS[i % len] = '0';
        }
      }
      ans = sum(ans, solve(curS));
    }
  }
  dbg("solve2(%s) = %d\n", s.c_str(), ans);
  return cache2[s] = ans;
}

int solve(const string & s) {
  auto it = cache.find(s);
  if (it != cache.end()) {
    return it->second;
  }

  int n = s.length();
  vector <int> dp(n + 1, 0);
  dp[0] = 1;
  for (int j = 0; j < n; ++j) {
    string curS = "";
    dbg("s %s dp[%d] = %d\n", s.c_str(), j, dp[j]);
    for (int i = j; i < n; ++i) {
      curS += s[i];
      if (j != 0 || i != n - 1) {
        dbg("s %s dp[%d] += dp[%d] * %d\n", s.c_str(), i + 1, j, solve2(curS));
        dp[i + 1] = sum(dp[i + 1], prod(dp[j], solve2(curS)));
      }
    }
  }
  dbg("s %s dp[%d] = %d\n", s.c_str(), n, dp[n]);
  int ans = sum(dp[n], solve2(s));
  dbg("solve(%s) = %d\n", s.c_str(), ans);
  return cache[s] = ans;
}

bool solve() {
  string s;
  if (!(cin >> s)) { return false; }

  int n = int(s.length());
  printf("%d\n", solve(s));
  return true;
}

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

Measured memory_bytes: 9472
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
int n;
int main() {
	//freopen("1.txt","r",stdin);
	read(n);
	if (n&1) printf("%d\n",n/2);
	else printf("%d\n",n/2-1);
	return 0;
}
/*
  REMEMBER:
  1. Think TWICE, Code ONCE!
  Are there any counterexamples to your algo?
    
  2. Be careful about the BOUNDARIES!
  N=1? P=1? Something about 0?
    
  3. Do not make STUPID MISTAKES!
  Array size? Integer overflow? Time complexity? Memory usage? Precision error?
*/

Measured memory_bytes: 256
def euc(x, y):
	if y == 0: return x
	return euc(y, x%y)
def gcdall(lst):
	if lst == []: return 0
	v = lst[0]
	for i in range(1, len(lst)):
		v = euc(v, lst[i])
	return v

N, X = map(int, raw_input().split())
x = map(lambda val: int(val)-X, raw_input().split())
left = []
right = []
for i in range(0, len(x)):
	if x[i] < 0: left.append(-x[i])
	elif x[i] > 0: right.append(x[i])
print euc(gcdall(left), gcdall(right))

Measured memory_bytes: 46692
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) (x).begin(), (x).end()
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
  #define debug(x) cerr << #x " => " << x << endl
#else
  #define debug(x) 0
#endif
using lint = long long;
constexpr int    INF  = 1 << 30;
constexpr lint   INFL = 1LL << 62;
constexpr int    MOD  = (int)1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

int main(void) {
  int n;
  cin >> n;
  int num = 1 << n;
  multiset<int> s;
  rep (i, num) {
    int x;
    cin >> x;
    s.insert(x);
  }
  multiset<int> now, left = s;
  now.insert(*left.rbegin());
  left.erase(--left.end());
  bool ok = true;
  rep (i, n) {
    vector<int> nowv(all(now));
    rep (j, nowv.size()) {
      auto itr = left.lower_bound(nowv[j]);
      if (itr == left.begin()) {
        ok = false;
        break;
      }
      --itr;
      now.insert(*itr);
      left.erase(itr);
    }
    if (!ok) break;
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 25464
c = [10, 50, 100, 500]
flag = False

while True:
	n = int(input())
	if n == 0:
		break
	m = list(map(int, input().split()))
	r = [0]*4
	n = sum(x[0]*x[1] for x in zip(m, c)) - n
	for i in range(4)[::-1]:
		r[i] = n // c[i]
		n -= r[i] * c[i]

	if flag:
		print()
	else:
		flag = True
	for i in range(4):
		if m[i] > r[i]:
			print('{} {}'.format(c[i], m[i]-r[i]))

Measured memory_bytes: 7748
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define bg begin()
#define end end()
#define sz size()
#define vi vector<int>
#define vl vector<long long int>
int main(){
	fast;
	ll n;
	cin>>n;
	ll arr[n]={0};
	for(int i=1;i<100;i++)
		for(int j=1;j<100;j++)
			for(int k=1;k<100;k++)
			{
				if(i*i + j*j + k*k +i*j +j*k +i*k <=n )
					arr[i*i + j*j + k*k+i*j +j*k +i*k - 1]++;
				else
					break;
			}
	for(int i=0;i<n;i++)
		cout<<arr[i]<<endl;
	return 0;
}



Measured memory_bytes: 3612
#include <stdio.h>

int main(void){
  int i,n;
  i = 1;
  while (1) { 
  scanf("%d", &n);
  if (n == 0) {
    break;
  }
  printf("Case %d: %d\n",i,n);
  i++;
  } 
  return(0);
}

Measured memory_bytes: 600
#include	<iostream>
#include	<string>
#include	<algorithm>
#include	<unordered_set>

using namespace std;

int main()
{
	unordered_set<string>		us;

	int		n;

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

	string	com;
	string	key;

	for (int i = 0; i < n; i++)
	{
		cin >> com >> key;
		cin.clear();
		cin.ignore();

		if (com == "insert")
		{
			us.insert(key);
		}
		else
		{
			if (us.find(key) == end(us))
			{
				cout << "no\n";
			}
			else
			{
				cout << "yes\n";
			}
		}
	}

	return 0;
}

Measured memory_bytes: 32216
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=100010;
int n;
int a[N];
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
inline int gcd(int x,int y) {return y?gcd(y,x%y):x;}
inline bool solve() {
    for(int i=1;i<=n;i++) {
	if(a[i]==1) return 0;
	if(a[i]&1) --a[i];
    }
    int g=a[1],t=0;
    for(int i=2;i<=n;i++) g=gcd(g,a[i]);
    for(int i=1;i<=n;i++) t+=!((a[i]/=g)&1);
    if(t&1) return 0;
    else if(n>t+1) return 1;
    return solve()^1;
}
int main() {
    int t=0;
    cin>>n;
    for(int i=1;i<=n;i++) a[i]=gi(),t+=!(a[i]&1);
    if(t&1) puts("First");
    else if(n>t+1) puts("Second");
    else puts(solve()?"First":"Second");
    return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
int main(void){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a*c<=b){
        printf("%d\n",c);
    }else{
        int i;
        for(i=0;(b-a)>=0&&i<=c;i++){
            b=b-a;
        }
        printf("%d\n",i);
    }
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

import static java.lang.Math.ceil;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        double add = sc.nextDouble()-1;
        double total = sc.nextDouble()-1;

        System.out.println((int)ceil(total/add));
    }
}

Measured memory_bytes: 24660
n = int(input())
a = list(map(int, input().split()))
b = []
start = n // 2 
if n % 2 == 0:
    for i in range(n-1, 0, -2):
        b.append(a[i])
    for i in range(0, n, +2):
        b.append(a[i])
else:
    for i in range(n-1, -1, -2):
        b.append(a[i])
    for i in range(1, n, +2):
        b.append(a[i])

print(" ".join(map(str, b)))

Measured memory_bytes: 29764
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vr vector
#define pb push_back
#define watch(x) cout << (#x) << " is " << (x) << endl
#define mod 1000000007
#define all(v) v.begin(),v.end()

bool check(ll j,ll x)
{
    if(x&(1<<j))
        return true;
    else
        return false;
}


  int main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     ll t;
     string s;
     set <string> st;
      cin>>t;
      while(t--)
      {
        cin>>s;
        st.insert(s);
          //cout<<endl;

      }
      cout<<st.size();
 return 0;
  }



Measured memory_bytes: 19228
a = %w(1 3 5 7 8 10 12)
b = %w(4 6 9 12)
c = %w(2)

x, y = gets.chomp.split

[a, b, c].each do |s|
    if s.include? x and s.include? y
        puts 'Yes'
        exit
    end
end

puts 'No'


Measured memory_bytes: 1788
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++){
		    a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		
		// 計算
		int result = 0;
		int l = 0;
		int r = a[n-1];
		while(r-l > 1){
			int c = (r + l)/2;
			
			if(func(a, c, k)){
				r = c;
			}else{
				l = c;
			}
		}
		result = r;
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
	
	public static boolean func(int[] a, int c, int k){
	    int n = a.length;
	    for(int i = 0; i < n; i++){
	        if(a[i] > c) k -= (a[i]+ c - 1)/c - 1;
	    }
	    return k >= 0;
	}
}


Measured memory_bytes: 50008
#include <stdio.h>

int main() 
{
	int n,k,x,y;
	int sum;
	scanf("%d", &n);
	scanf("%d", &k);
	scanf("%d", &x);
	scanf("%d", &y);
	
	if(n <= k)
	{
		sum = n * x;
		printf("%d",sum);
		return 0;
	}
	else 
	{
		sum = (k * x + (n - k) * y);
		printf("%d",sum);
		return 0;
	}
}

Measured memory_bytes: 128
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        l=[]
        for j in B:
            l.append(abs(i[0]-j[0])+abs(i[1]-j[1]))
        print(l.index(min(l))+1)





resolve()

Measured memory_bytes: 39280
#include<cstdio>
#include<cstring>
#include<algorithm>
#define SF scanf
#define PF printf
#define MAXN 2010
#define MOD 998244353
using namespace std;
typedef long long ll;
ll C[2*MAXN][2*MAXN],bits[2*MAXN];
int n,k;
ll count(int s,int tot){
	return C[s+tot-1][s-1];	
}
ll solve(int i,int tot){
	int k2=min(k-i/2,(i-1)/2);
	int k1=k-k2*2-((i%2)==0);
	ll flag=1;
	ll res=0;
	for(int l=k2;l+k1>0&&l>=0;l--,flag=-flag){
		res+=flag*count(l+k1,tot)*bits[l]%MOD*C[k2][l]%MOD;
		res%=MOD;
	}
	return (res+MOD)%MOD;
}
int main(){
	SF("%d%d",&k,&n);
	int sum=0;
	bits[0]=1;
	for(int i=1;i<=4000;i++)
		bits[i]=bits[i-1]*2ll%MOD;
	C[0][0]=1;
	for(int i=1;i<=4000;i++){
		C[i][0]=1;
		for(int j=1;j<=i;j++)
			C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;
	}
	ll ans=0;
	for(int i=2;i<=2*k;i++){
		if(i%2==0){
			ans=(solve(i,n)+solve(i,n-1))%MOD;
		}
		else{
			ans=solve(i,n);
		}
		PF("%lld\n",ans);
	}
}
	

Measured memory_bytes: 124160
#include <bits/stdc++.h>
// #include <atcoder/all>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define vc(T) vector<T>
#define vv(T) vc(vc(T))
using namespace std;
// using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
  string s;
  cin >> s;
  if (s.back() == 's' ) s += "es";
  else s += "s";
  cout << s << endl;

  return 0;
}

Measured memory_bytes: 3580
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

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

#### START
N = int(input())

for i in range(100, 1000):
  s = str(i)
  if s[0] == s[1] and s[1] == s[2] and i>=N:
    print(s)
    break



Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	int n;
	scanf("%d",&n);
	ll ans = 1ll * n * (n + 1) * (n + 2) / 6;
	for (int i = 1; i < n; i++) {
		int u,v;
		scanf("%d %d",&u,&v);
		if (u > v) swap(u , v);
		ans -= 1ll * u * (n - v + 1);
	}
	printf("%lld\n" , ans);
}

Measured memory_bytes: 3776
#include <iostream>
#include <vector>
int main(){
    using namespace std;
    int i,x;
    x = 1;
    vector<int> v;
    while(x!=0){
        cin >> x;
        if(x!=0){
            v.push_back(x);
        }else{
            break;
        }
    }
    int size = v.size();
    for(i=0;i<size;i++){
        cout << "Case " << i+1 << ": " << v[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 3260
#include <iostream>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <climits>
using namespace std;

void solve(int w, int d, vector<int>& p, vector<int>& s)
{
	vector<int> pieceY;
	vector<int> pieceX;
	pieceY.push_back(d);
	pieceX.push_back(w);

	for(unsigned i=0; i<p.size(); ++i){
		int y = pieceY[p[i]-1];
		int x = pieceX[p[i]-1];
		pieceY.erase(pieceY.begin()+p[i]-1);
		pieceX.erase(pieceX.begin()+p[i]-1);
		int cut = s[i] % (y+x);
		if(cut < x){
			pieceY.push_back(y);
			pieceY.push_back(y);
			pieceX.push_back(min(cut, x-cut));
			pieceX.push_back(max(cut, x-cut));
		}else{
			cut -= x;
			pieceY.push_back(min(cut, y-cut));
			pieceY.push_back(max(cut, y-cut));
			pieceX.push_back(x);
			pieceX.push_back(x);
		}
	}

	vector<int> area(pieceY.size());
	for(unsigned i=0; i<area.size(); ++i)
		area[i] = pieceY[i]*pieceX[i];
	sort(area.begin(), area.end());

	cout << area[0];
	for(unsigned i=1; i<area.size(); ++i)
		cout << ' ' << area[i];
	cout << endl;
}

int main()
{
	int number = 0;
	for(;;){
		int n, w, d;
		cin >> n >> w >> d;
		if(n == 0 && w == 0 && d == 0)
			break;

		vector<int> p(n);
		vector<int> s(n);
		for(int i=0; i<n; ++i)
			cin >> p[i] >> s[i];

		solve(w, d, p, s);
	}

	return 0;
}

Measured memory_bytes: 0
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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;
}

vector<vector<int>> board;

// {y, x}
vector<pair<int, int>> n_to_pos;

vector<int> memo;

void prepare(const int H, const int W, const int D) {
    memo.resize(H * W + 1, 0);
    for (int i = D + 1; i <= H * W; i++) {
        pair<int, int> cur_pos = n_to_pos[i];
        pair<int, int> prev_pos = n_to_pos[i - D];
        int cost = memo[i - D]
            + abs(cur_pos.first - prev_pos.first) + abs(cur_pos.second - prev_pos.second);
        memo[i] = cost;
    }
}

int solve(const int L, const int R) {
    return memo[R] - memo[L];
}

int main(void) {
    int H, W, D;
    cin >> H >> W >> D;

    board.resize(H, vector<int>(W));
    n_to_pos.resize(H * W + 1);
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> board[i][j];
            n_to_pos[board[i][j]] = {i, j};
        }
    }

    prepare(H, W, D);

    int Q;
    cin >> Q;
    for (int i = 0; i < Q; i++) {
        int L, R;
        cin >> L >> R;
        cout << solve(L, R) << endl;
    }

    return 0;
}


Measured memory_bytes: 4472
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    string s;
    int i;
    int ac=0, wa=0, tle=0, re=0;
    for(i=0;i<n;i++){
        cin >> s;
        if(s=="AC")ac++;
        if(s=="WA")wa++;
        if(s=="TLE")tle++;
        if(s=="RE")re++;
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
    return 0;
}

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

#ifdef ONLINE_JUDGE
#define freopen \
  if (0) freopen
#define cerr \
  if (0) cerr
#endif

#define fi first
#define se second

#define pb push_back
#define pp pop_back
#define mp make_pair

#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)

#define sqr(a) ((a)*1ll * (a))
#define sz(a) (int)a.size()
#define len(a) (int)a.length()
#define all(a) a.begin(), a.end()
#define nl '\n'

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> pi;

const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const ll linf = (ll)1e18 + 7;

vector<int> z_func(string &s) {
  vector<int> z(len(s), 0);
  int l = 0, r = 1;
  rep(i, 1, sz(z) - 1) {
    if (i <= r)
      z[i] = min(z[i - l], r - i);
    while (i + z[i] < len(s) && s[z[i]] == s[i + z[i]])
      z[i]++;
    if (i + z[i] > r)
      l = i, r = i + z[i]; 
  }
  return z;
}

void solve() {
  string s;
  cin >> s;
  
  auto z = z_func(s);
  bool can_divide = false;

  rep(i, 1, len(s) / 2) {
    can_divide = len(s) % i == 0 && z[i] == i * (len(s) / i - 1);
    if (!can_divide) continue;

    if (i == 1) {
      cout << len(s) << nl << 1;
      return;
    }

    break;
  }

  if (!can_divide) {
    cout << 1 << nl << 1;
    return;
  }

  string rev_s = s;
  reverse(all(rev_s));
  auto rev_z = z_func(rev_s);

  vector<bool> can_divide_left(sz(z), true);
  can_divide_left[0] = false;
  rep(j, 1, sz(z) - 1) {
    if (z[j] >= j) {
      for (int k = j; k < j + z[j]; k += j)
        if (k + j < sz(z) && z[k] >= j)
          can_divide_left[k + j] = false;
        else
          break;
    }
  }

  vector<bool> can_divide_right(sz(z), true);
  can_divide_right[sz(z) - 1] = false;
  per(j, sz(z) - 2, 0) {
    int l = len(s) - j - 1;
    if (rev_z[l] >= l) {
      for (int k = j; k > j - rev_z[l]; k -= l)
        if (k - l >= 0 && rev_z[len(s) - k - 1] >= l)
          can_divide_right[k - l] = false;
        else
          break;
    }
  }

  int res = 0;
  rep(j, 1, len(s) - 1) {
    if (can_divide_left[j] && can_divide_right[j - 1]) {
      res++;
    }
  }

  cout << 2 << nl << res;
}

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

  freopen(".in", "r", stdin);

  solve();

  return 0;
}

Measured memory_bytes: 8240
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,c=1;
  string s;
  cin>>n>>s;
  for(int i=1;i<n;i++)
  {
    if(s[i]!=s[i-1])
      c++;
  }
  cout<<c;
  return 0;
}

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

int main(){
  int N, count;
  cin >> N;
  vector<int> d(N);
  for (int i=0; i<N; i++) {
    cin >> d.at(i);
  }
  sort(d.begin(), d.end());
  reverse(d.begin(), d.end());
  count = 1;
  for (int i=1; i<N; i++) {
    if (d.at(i) != d.at(i-1))
        count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 256
from functools import reduce
import math

n = int(input())
coord = [tuple(map(int, input().split())) for i in range(n)]

# parity check and get max
x, y = coord[0]
p = (x + y) & 1
limit = 0
for x, y in coord:
    if p != (x + y) & 1:
        print(-1)
        exit()
    lim = abs(x) + abs(y)
    if lim > limit:
        limit = lim

limit = round(math.log2(limit))
if p == 1:
    d = [2 ** i for i in reversed(range(limit + 1))]
else:
    d = [1] + [2 ** i for i in reversed(range(limit + 1))]

print(len(d))
print(reduce((lambda acc, dist: str(acc) + " " + str(dist)), d))

for x, y in coord:
    u = x + y
    v = x - y

    command = ""
    for i in range(len(d)):
        if u >= 0 and v >= 0:
            command += "R"
            u -= d[i]
            v -= d[i]
        elif u >= 0 > v:
            command += "U"
            u -= d[i]
            v += d[i]
        elif u < 0 <= v:
            command += "D"
            u += d[i]
            v -= d[i]
        elif u < 0 and v < 0:
            command += "L"
            u += d[i]
            v += d[i]

    print(command)

Measured memory_bytes: 3812
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;

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

int main(){
    int n;
    cin >> n;
    vector<int> x(n), y(n), h(n);
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> h[i];

    int cx, cy;
    REP(cy, 101) REP(cx, 101){
        int H = -1;
        for (int i = 0; i < n; i++){
            if (h[i] > 0){
                int tmp = h[i] + abs(cx - x[i]) + abs(cy - y[i]);
                if (H == -1) H = tmp;
                else if (H != tmp){
                    H = -2;
                    break;
                }
            }
        }
        if (H == -2) continue;

        for (int i = 0; i < n; i++){
            if (h[i] == 0){
                int height = H - abs(cx - x[i]) - abs(cy - y[i]);
                if (height > 0){
                    H = -2;
                    break;
                }
            }
        }
        if (H == -2) continue;

        cout << cx << " " << cy << " " << H << endl;
        return 0;
    }
}

Measured memory_bytes: 256
using System;

namespace ITP1_10_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] numbers = input.Split(' ');
            double x1 = double.Parse(numbers[0]);
            double y1 = double.Parse(numbers[1]);
            double x2 = double.Parse(numbers[2]);
            double y2 = double.Parse(numbers[3]);

            double X = Math.Pow((x2 - x1), 2);
            double Y = Math.Pow((y2 - y1), 2);
            double result = X + Y;
            result = Math.Sqrt(result);

            Console.WriteLine(string.Format("{0:f14}",result));
        }
    }
}



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

int main(){
  int N; cin >> N;
  vector<int> a(1e5+1, 0);
  int val = 0;
  for(int i = 0; i < N; i++){
    int t; cin >> t;
    if(!a[t])val++;
    a[t]++;
  }
  if((N - val) % 2) cout << val - 1;
  else cout << val;
}

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

int main()
{
	ll N;
	cin >> N;
	ll ans = 1e13;
	//cout << "a" << endl;
	for (ll i = 1; i <= sqrt(N); ++i)
	{
		//cout << "b" << endl;
		if (N % i == 0)
		{
			ans = min(ans,i + N/i - 2);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner input=new Scanner(System.in);
        int k=input.nextInt();
        String N=input.next();
        int n=N.length();
      if(n<=k){
      System.out.print(N);
      }else{
        System.out.print(N.substring(0,k)+"...");
      }
    }   
}

Measured memory_bytes: 38588
_ = gets
a = gets.chomp.split.map(&:to_i)

res = 0
loop do
  if a.empty?
    break
  elsif a.size <= 1
    res += 1
    break
  end
  
  cur = a.shift
  if cur < a[0]
    while !a.empty? && cur <= a[0]
      cur = a.shift
    end
    res += 1
  elsif cur > a[0]
    while !a.empty? && cur >= a[0]
      cur = a.shift
    end
    res += 1
  end
  
  if a.empty?
    break
  elsif a.size <= 1
    res += 1
    break
  end
  
  cur = a.pop
  if cur < a[-1]
    while !a.empty? && cur <= a[-1]
      cur = a.pop
    end
    res += 1
  elsif cur > a[-1]
    while !a.empty? && cur >= a[-1]
      cur = a.pop
    end
    res += 1
  end
end
puts res

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

using namespace std;
using ll = long long;

int main(void){
    ll H, W;
    cin >> H >> W;
    ll ans = H*W;
    for(ll i=1;i<=H;i++){
        ll a = i*W;
        ll b = (H-i)/2*W;
        ans = min(ans, max(a, max(b, H*W-a-b))-min(a, min(b, H*W-a-b))); 
    }
    for(ll i=1;i<=W;i++){
        ll a = i*H;
        ll b = (W-i)/2*H;
        ans = min(ans, max(a, max(b, H*W-a-b))-min(a, min(b, H*W-a-b))); 
    }
    for(ll i=1;i<=H;i++){
        ll a = W*i;
        ll b = W/2*(H-i);
        ans = min(ans, max(a, max(b, H*W-a-b))-min(a, min(b, H*W-a-b))); 
    }
    for(ll i=1;i<=W;i++){
        ll a = i*H;
        ll b = H/2*(W-i);
        ans = min(ans, max(a, max(b, H*W-a-b))-min(a, min(b, H*W-a-b))); 
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mst(a,b) memset(a,b,sizeof(a))
#define ALL(x) x.begin(),x.end()
#define pii pair<int,int>
#define eps 1e-3
#define debug(a) cout << #a": " << a << endl;
inline int lowbit(int x){ return x & -x; }
const int N = 3e5 + 10;
const int mod = (int) 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long LINF = (1LL << 62);
typedef long long LL;
typedef unsigned long long ULL;
const double PI = acos(-1.0);
using namespace std;

//char buf[100000],*p1=buf,*p2=buf;
//inline char nc(){
//  return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
//inline bool read(int & x){
//  char c=nc();x=0;
//  if(c==EOF) return false;
//  bool flag = false;
//  for(;!isdigit(c);c=nc()) flag = true;
//  for(;isdigit(c);x=x*10+c-'0',c=nc());
//  if(flag) x *= -1;
//  return true;
//}
//inline bool readL(LL & x){
//  char c=nc();x=0;
//  if(c==EOF) return false;
//  bool flag = false;
//  for(;!isdigit(c);c=nc()) flag = true;
//  for(;isdigit(c);x=x*10+c-'0',c=nc());
//  if(flag) x *= -1;
//  return true;
//}
//LL q_pow(LL base, LL b){LL res=1;for(base%=mod;b;b>>=1,base=base*base%mod)if(b&1){res=res*base%mod;}return res;}



int main(){
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
//    freopen("out.txt","w",stdout);
#endif
  int n;
  scanf("%d", &n);
  if(n == 1) printf("Hello World\n");
  else {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
  }
  return 0;
}





Measured memory_bytes: 256
using System;

namespace abc141
{
    class Program
    {
        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            string ans = "Yes";
            for(int i=1;i<=S.Length;i++){
                if((i%2==1 && S[i-1] =='L') || (i%2==0 && S[i-1] == 'R')){
                    ans = "No";
                    break;
                }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11092
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define all(a) (a).begin(), (a).end()


int main() {
    int D;
    cin >> D;
    string s;
    if(D == 25)s = "Christmas";
    else if(D == 24) s = "Christmas Eve";
    else if(D==23) s = "Christmas Eve Eve";
    else s = "Christmas Eve Eve Eve";
    cout << s << endl;
}


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

int main(){
	long long int n;
	cin>>n;
	long long int a[n+5],b[n+5],c[n+5],m[n+5],i,s=0,a1,a2,t1,t2;
	
	for(i=1;i<=n;i++)cin>>a[i];
	for(i=1;i<=n;i++)cin>>b[i];
	for(i=1;i<=n;i++)cin>>c[i];
	
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	sort(c+1,c+1+n);
	
	a1=n;a2=1;
	
	for(i=n;i>=1;i--){
		while(c[a1]>b[i] && a1>0)a1--;
		t1=n-a1;
		m[i]=t1;
	}
	
	for(i=1;i<=n;i++){
		while(a[a2]<b[i] && a2<=n)a2++;
		t2=a2-1;
		s=s+m[i]*t2;
	}
	
	cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 3328
#include<stdio.h>
#include<set>
#include<map>
using namespace std;
int n, m;
int a[200005],b[200005];
set<int>ans;


int main(){
	scanf("%d %d ",&n, &m);
	for(int i = 1 ; i <= m ; i++){
		scanf("%d %d",&a[i],&b[i]);
		if(a[i] == 1)ans.insert(b[i]);
		getchar();
	}

	for(int i = 1 ; i <= m ; i++){
		if(b[i] == n && ans.count(a[i])){
			printf("POSSIBLE");
			return 0;
		}
	}
	printf("IMPOSSIBLE");
}

Measured memory_bytes: 6528
#include <bits/stdc++.h> 
using namespace std; 
#define ll long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define vll vector<ll>
#define all(v) v.begin(),v.end()
#define INF ll(1e18)
#define MOD 1000000007

bool isPrime(int n) 
{  
    if (n <= 1) return false;  
    for (int i = 2; i < n; i++) 
        if (n % i == 0) return false; 
     return true; 
} 

int main()
{

      
  ll t=0;
  cin>>t;
  ll a=0,tl=0,r=0,w=0;
  string c;
  while(t--)
  {
    cin>>c;
    if(c=="AC") a++;
    else if(c=="WA") w++;
    else if(c=="TLE") tl++;
    else if(c=="RE") r++;
  }
  cout<<"AC "<<"x "<<a<<endl; 
  cout<<"WA "<<"x "<<w<<endl; 
  cout<<"TLE "<<"x "<<tl<<endl; 
  cout<<"RE "<<"x "<<r<<endl; 
  }


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

#define INF INT_MAX

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;


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

	ll N;
	cin >> N;
	vector<ll> a(N);
	vector<ll> b(N);
	vector<pii> ba(N);
	for(int j=0;j < N;j++){
		cin >> a[j] >> b[j];
		ba[j] = pii(b[j],a[j]);
	}

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

	string ans = "Yes";
	ll sum = 0;
	for(int i = 0;i < N;i++){
		sum += ba[i].second;
		if(sum > ba[i].first){
			ans = "No";
			break;
		}		
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 4992
/**
 *    author:  tourist
 *    created: 27.11.2019 10:01:04       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int ans = (int) 2e9;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    ans = min(ans, a + b);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#define INF 1000000000000000LL

using namespace std;
typedef long long int ll;
typedef pair<int, ll> P;

int main()
{
	int n;
	scanf("%d", &n);
	int a[100000], b[100000];
	vector<P> v[100000];
	for(int i=0; i<n-1; i++){
		ll c;
		scanf("%d %d %lld", &a[i], &b[i], &c);
		a[i]--;
		b[i]--;
		v[a[i]].push_back(P(b[i], c));
		v[b[i]].push_back(P(a[i], c));
	}
	int d[100000];
	vector<P> dist;
	fill(d, d+n, -1);
	d[0]=0;
	queue<int> que;
	que.push(0);
	while(!que.empty()){
		int x=que.front();
		que.pop();
		for(int i=0; i<v[x].size(); i++){
			int y=v[x][i].first;
			if(d[y]<0){
				d[y]=d[x]+1;
				que.push(y);
			}
		}
	}
	for(int i=0; i<n; i++){
		dist.push_back(P(d[i], i));
	}
	sort(dist.begin(), dist.end(), greater<P>());
	int count[100000]={};
	for(int i=0; i<n; i++){
      int x=dist[i].second;
		for(int j=0; j<v[x].size(); j++){
			int y=v[x][j].first;
			if(d[y]<d[x]) continue;
			count[x]+=(count[y]+1);
		}
	}
	ll m=-1;
	int cent=-1;
	for(int i=0; i<n; i++){
		bool ok=1;
		int sum=0;
		for(int j=0; j<v[i].size(); j++){
			int y=v[i][j].first;
          if(d[i]<d[y]){
			sum+=(count[y]+1);
			if(count[y]+1>n/2){
				ok=0;
				break;
			}
          }
		}
		if(n-1-sum>n/2) ok=0;
		if(ok){
			cent=i;
			if(n%2==0 && n-1-sum==n/2){
				for(int j=0; j<v[i].size(); j++){
					int y=v[i][j].first;
					if(d[i]>d[y]){
						m=v[i][j].second;
						break;
					}
				}
			}else{
				for(int j=0; j<v[i].size(); j++){
					int y=v[i][j].first;
					if(n%2==0 && d[i]<d[y] && count[y]+1==n/2){
						m=v[i][j].second;
						break;
					}
				}
			}
			if(m<0){
				m=INF;
				for(int j=0; j<v[i].size(); j++){
					m=min(v[i][j].second, m);
				}
			}
			break;
		}
	}

	ll d0[100000];
	fill(d0, d0+n, -1);
	d0[cent]=0;
	que.push(cent);
	while(!que.empty()){
		int x=que.front();
		que.pop();
		for(int i=0; i<v[x].size(); i++){
			int y=v[x][i].first;
			if(d0[y]<0){
				d0[y]=d0[x]+v[x][i].second;
				que.push(y);
			}
		}
	}

	ll ans=0;
	for(int i=0; i<n; i++){
		ans+=(2*d0[i]);
	}
	ans-=m;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 13424
#include<bits/stdc++.h>
#define reg register
using namespace std;
const int MN=1e5+5;
typedef long long ll;
typedef pair<int,int>pii;
int n,m,a[MN],b[MN];
set<pii>s[MN];
int main(){
	scanf("%d%d",&n,&m);
	for(reg int i=1,x,y;i<=m;i++){
		scanf("%d%d",&x,&y);
		s[x].insert(make_pair(y,i));
	}
	for(reg int i=1;i<=n;i++){
		reg int cnt=1;
		for(set<pii>::iterator it=s[i].begin();it!=s[i].end();it++){
			a[it->second]=i;b[it->second]=cnt;cnt++;
		}
	}
	for(reg int i=1;i<=m;i++)printf("%06d%06d\n",a[i],b[i]);
	return 0;
}

Measured memory_bytes: 11648
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=505;
int n,a[N][N],dp[N][N],b[N][N],c[N][N];
signed main(){
	scanf("%lld",&n);
	for (int i=1;i<=n;i++){
		for (int j=1;j<i;j++)scanf("%lld",&a[i][j]);
		for (int j=i+1;j<=n;j++)scanf("%lld",&a[i][j]);
		for (int j=1;j<=n;j++)b[i][j]=a[i][j];
	}
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)b[i][j]+=b[i-1][j];
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)b[i][j]+=b[i][j-1];
	for (int i=1;i<=n;i++)
		for (int j=i;j<=n;j++){
			c[i][j]=c[i][j-1];
			for (int k=i;k<=j;k++)c[i][j]+=a[k][j];
		}
	memset(dp,0x3f3f3f3f,sizeof dp);
	dp[0][0]=0;
	for (int i=0;i<=n;i++)
		for (int j=i;j<=n;j++)
			for (int x=j+1;x<=n;x++)
				dp[j][x]=min(dp[j][x],dp[i][j]+b[x][i]-b[j][i]+c[j+1][x]);
	int ans=1e18;
	for (int i=0;i<=n;i++)
		for (int j=i;j<=n;j++)
			ans=min(ans,dp[i][j]+b[n][i]-b[j][i]+c[j+1][n]);
	printf("%lld\n",ans);		
}

Measured memory_bytes: 8192
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        Stdin stdin = new Stdin();
        int n = stdin.nextInt();
        int k = stdin.nextInt();
        
        int max = (n - 1) * (n - 2) / 2;
        if (max < k) {
            System.out.println(-1);
            System.exit(0);
        }
        
        List<Integer> l = new ArrayList<>();
        List<Integer> r = new ArrayList<>();
        for (int i = 0; i < n - 1; i++) {
            l.add(1);
            r.add(i + 2);
        }
        
        List<Integer> x = new ArrayList<>();
        List<Integer> y = new ArrayList<>();
        for (int i = 2; i <= n; i++) {
            for (int j = i + 1; j <= n; j++) {
                x.add(i);
                y.add(j);
            }
        }
        
        for (int i = 0; i < max - k; i++) {
            l.add(x.get(i));
            r.add(y.get(i));
        }
        
        System.out.println(l.size());
        for (int j = 0; j < l.size(); j++) {
            System.out.printf("%d %d%n", l.get(j), r.get(j));
        }
    }

    private static final class Stdin {
        private BufferedReader stdin;
        private ArrayDeque<String> tokens;
        
        public Stdin() {
            this.stdin = new BufferedReader(new InputStreamReader(System.in));
            this.tokens = new ArrayDeque<>();
        }
        
        public String nextToken() throws IOException {
            if (tokens.isEmpty()) {
                for (String token : stdin.readLine().split(" ")) {
                    tokens.add(token);
                }
            }
            return tokens.poll();
        }
        
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(nextToken());
        }
        
        public int nextLong() throws NumberFormatException, IOException {
            return Integer.parseInt(nextToken());
        }
    }
}

Measured memory_bytes: 29652