akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

int main(){
    ll n;
    cin >> n;
    vector<ll> b(n);
    REP(i, n){
        cin >> b.at(i);
        b.at(i)--;
        if(i < b.at(i)){
            cout << -1 << endl;
            return 0;
        }
    }

    vector<ll> ans;
    while(b.size() > 0){
        ll j = 0;
        for(ll k = 0; k < b.size(); ++k){
            if(k == b.at(k) && b.at(k) > j){
                j = k;
            }
        }
        ans.push_back(j);
        b.erase(b.begin() + j);
    }
    for(ll i = ans.size() - 1; i >= 0; --i){
        cout << ans.at(i) + 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<climits>

using namespace std;

const int UNIT=100;

int main(){
	int a[100000]={0},n=0,q=0,segmin[100000/UNIT]={0};
	cin>>n>>q;
	n=((n+UNIT-1)/UNIT)*UNIT;//n???????????£??¨?¢??????????UNIT????????°???????????¨???????????±??????????????????????????????????????????
	for(int i=0;i<n;i++){
		a[i]=INT_MAX;
	}
	for(int i=0;i<=n/UNIT;i++){
		segmin[i]=INT_MAX;
	}
	while(q-->0){
		int c=0,x=0,y=0;
		cin>>c>>x>>y;
		int z=x/UNIT;
		switch(c){
		case 0:
			if(a[x]==segmin[z] && segmin[z]!=INT_MAX){
				a[x]=y;
				segmin[z]=INT_MAX;
				for(int i=0;i<UNIT;i++){
					if(segmin[z]>a[z*UNIT+i]){segmin[z]=a[z*UNIT+i];}
				}
			}
			else{
				a[x]=y;
				if(y<segmin[z]){segmin[z]=y;}
			}
			break;
		case 1:
			int ans=INT_MAX;
			if(y>(z+1)*UNIT){
				for(int i=x;i<(z+1)*UNIT;i++){
					if(a[i]<ans){ans=a[i];}
				}
				for(int i=z+1;i<y/UNIT;i++){
					if(segmin[i]<ans){ans=segmin[i];}
				}
				for(int i=(y/UNIT)*UNIT;i<=y;i++){
					if(a[i]<ans){ans=a[i];}
				}
			}
			else{
				for(int i=x;i<=y;i++){
					if(a[i]<ans){ans=a[i];}
				}
			}
			cout<<ans<<endl;
			break;
		}
	}
	return 0;
}

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

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

	string O, E;
	cin >> O >> E;

	for( int i = 0; i < O.size(); ++i ) {
		cout << O[i];

		if( i < E.size() ) {
			cout << E[i];
		}
	}

	cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define pb push_back
#define mp make_pair
ll check (ll n,ll m,ll i,ll j)
{
	if(i>=0 && i<n && j<m && j>=0)
	   return 1;
	else
	 return 0;   
}
int main()
{
	ll t;
	t = 1;
	while(t--)
	{
		ll k,i,j,n,m;
		cin>>n;
		ll arr[n];
		for(i=0;i<n;i++)
		   cin>>arr[i];
		sort(arr,arr+n);
		ll d = 0,c=0;
		d = arr[n-1];
		if(n%2==0)
		{
			for(i=n-2;i>=n-(n/2);i--)
			   d+=2*arr[i];
		}   
		else
		{
			for(i=n-2;i>=n-(n/2);i--)
			   d+=2*arr[i];
			d+=arr[n-1-(n/2)];   
		}
		cout<<d<<endl;
	}
	return 0;
} 

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

int main(void){
    long long N, D;
    long long x, y;
    int ans = 0;

    cin >> N >> D;

    for(int i = 0; i < N; ++i){
        cin >> x >> y;
        if(sqrt(x*x+y*y) <= D) ++ans;
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 3656
from collections import defaultdict
n= int(input())
D=list(map(int,input().split()))

m=int(input())
T=list(map(int,input().split()))

dicta=defaultdict(lambda:0)
dictb=defaultdict(lambda:0)

for i in range(n):
    dicta[D[i]]+=1

for i in range(m):
    dictb[T[i]]+=1


ans="YES"
for i in range(m):
    if dicta[T[i]]<dictb[T[i]]:
        ans="NO"
        break

print(ans)


Measured memory_bytes: 169628
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<cmath>
 
#define rep(i,x) for(int i=0;i<(int)(x);i++)
#define reps(i,x) for(int i=1;i<=(int)(x);i++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(int i=((int)(x));i>0;i--)
 
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define INF 2e9
#define MOD 1000000007
 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef std::pair<ll, ll> P;
int gcd(ll a,ll b){return b?gcd(b,a%b):a;}
 
 
using namespace std;

int main()
{
    ll n, m, c;
    cin >> n >> m >> c;
    ll ans = 0;
    vector<ll> b(m);
    rep(i, m) cin >> b[i];
    rep(i, n){
        ll p = 0;
        rep(j, m){
            ll tmp;
            cin >> tmp;
            p += tmp*b[j];
        }
        p+=c;
        if(p>0) ans++;
    }
    cout << ans;
}

Measured memory_bytes: 256
import qualified Data.Set as S

type Used = S.Set Int

main :: IO ()
main = do
  s <- map fromEnum <$> getLine
  let m = S.fromList s
  putStrLn $ solve m

solve :: Used -> String
solve s = go $ map fromEnum ['a'..'z']
  where
    go :: [Int] -> String
    go [] = "None"
    go (c:cs)
      | S.member c s = go cs
      | otherwise = [toEnum c :: Char]


Measured memory_bytes: 4988
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    string s;
    cin >> s;
    rep(i, s.size()) s[i] = 'x';
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
  string s;
  cin >> s;
  int N = s.size();
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i=0; i<N; i++) {
    if (s[i]-'0' == 1) cnt1++;
    if (s[i]-'0' == 0) cnt2++;
  }
  int mi = min(cnt1,cnt2);
  int ans =mi*2;
  cout << ans << endl;
}

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

using namespace std;

int main(){
	//freopen("92aIn.txt","r",stdin);
	//freopen("92aOut.txt","w",stdout);
	int a,b,c,d;
	cin>>a>>b>>c>>d;

	cout<<min(a,b)+min(c,d)<<endl;



	return 0;
}

Measured memory_bytes: 256
def main():
    n = int(input())
    a = list(map(int, input().split()))
    mod, fact, m, npr, now = 10**9+7, [1, 1], [0, 1], [1]*(n+1), 1
    for i in range(2, n+1):
        fact.append(fact[-1]*i % mod)
    for i in range(n, 0, -1):
        npr[i-1] = npr[i]*i % mod
    for i in range(2, n+1):
        m.append(fact[i]+now)
        now = (m[-1]+now*i) % mod
    m = [i*j % mod for i, j in zip(npr, m)]
    ans = (sum([j*(m[n-i]+m[i+1])
                for i, j in enumerate(a)])-sum(a)*fact[n]) % mod
    print(ans)


main()


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

#define ll long long
#define mod 1000000007
#define ffor(i,a,b) for(int i=a;i<b;i++)
#define bfor(i,a,b) for(int i=a-1;i>=b;i--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mem(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sz(x) (int)x.size()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define PI 3.1415926535
#define lb lower_bound
#define ub upper_bound
#define bs binary_search

int main()
{
    int n;
    cin>>n;
    int a[n];
    ffor(i,0,n) cin>>a[i];
    int count=0;
    ffor(i,1,n-1)
    {
        set<int> s;
        s.insert(a[i-1]);
        s.insert(a[i]);
        s.insert(a[i+1]);
        auto it=s.begin();
        if(*(++it)==a[i]) count++;
    }
    cout<<count;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

bool isMM(int n) {
    int res = 0;
    if ( n >= 1 && n  <= 12 ){ res = 1; }
    return res;

}

bool isYY(int n) {
    int res = 0;
    if ( n >= 0 && n  <= 99 ){ res = 1; }
    return res;

}

int main() {

    string s;
    cin >> s;

    string former;
    string latter;

    for (int i = 0; i <= 3; ++i) {
        if ( i == 0 || i == 1) {
            former += s[i];
        }

        if ( i == 2 || i == 3 ) {
            latter += s[i];
        }
    }

    int f = atoi(former.c_str());
    int l = atoi(latter.c_str());

    bool YYMM = false;
    bool MMYY = false;
    bool NA = false;
    bool AMBIGUOUS = false;


    if (isYY(f) && isMM(l)) YYMM = true;
    if (isYY(l) && isMM(f)) MMYY = true;

    if (!(isYY(f) && isMM(l)) && !(isYY(l) && isMM(f)))  NA = true;
    if ((isYY(f) && isMM(l)) && (isYY(l) && isMM(f)))  AMBIGUOUS = true;

    if (YYMM && MMYY) cout << "AMBIGUOUS" << endl;
    if (YYMM && !MMYY) cout << "YYMM" << endl;
    if (!YYMM && MMYY) cout << "MMYY"  << endl;
    if (!YYMM && !MMYY) cout << "NA" << endl;

    //cout << f << endl;
    //cout << l << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL)
    x = x->left;
  return x;
}

Node treeMaximum(Node x){
  while(x->right != NIL)
    x = x->right;
  return x;
}

Node treeSearch(Node u, int k){
  if(u == NIL || k == u->key)
    return u;
  if(k < u->key)
    return treeSearch(u->left, k);
  else
    return treeSearch(u->right, k);
}

Node treeSuccessor(Node x){
  if(x->right != NIL)
    return treeMinimum(x->right);
  Node y = x->parent;
  while(y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left == NIL || z->right == NIL)
    y = z;
  else
    y = treeSuccessor(z);
  if(y->left != NIL)
    x = y->left;
  else
    x = y->right;
  if(x != NIL)
    x->parent = y->parent;
  if(y->parent == NIL)
    root = x;
  else if(y == y->parent->left)
    y->parent->left = x;
  else
    y->parent->right = x;
  if(y != z){
    z->key = y->key;
    treeDelete(y);
  }
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key)
      x = x->left;
    else
      x = x->right;
  }
  z->parent = y;

  if(y == NIL)
    root = z;
  else if(z->key < y->key)
    y->left = z;
  else
    y->right = z;
}

void inorder(Node u){
  if(u->left != NIL)inorder(u->left);
  printf(" %d", u->key);
  if(u->right != NIL)inorder(u->right);
}
void preorder(Node u){
  printf(" %d", u->key);
  if(u->left != NIL)preorder(u->left);
  if(u->right != NIL)preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}

Measured memory_bytes: 24040
#include<bits/stdc++.h>
using namespace std;
 
int main(void){
  int n, m, b[100], a[100][100], c[100];
  cin >> n >> m;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      cin >> a[i][j];
    }
  }
  for(int i = 0; i < m; i++){
    cin >> b[i];
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      c[i] += a[i][j] * b[j];
    }
  }
  for(int i = 0; i < n; i++){
    cout << c[i] << endl;
  }
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,a;//nは支払う金額,aは枚数
  cin >> n >> a;
  int d = n % 500;
  if(d <= a){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    char[] cs;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        cs = sc.next().toCharArray();
        solve();
    }

    void solve() {
        for (int i = cs.length - 2; i >= 0; i -= 2) {
            boolean flag = true;
            for (int j = 0; j < i / 2; j++) {
                if (cs[j] != cs[j + i / 2]) {
                    flag = false;
                    break;
                }

            }
            if (flag) {
                System.out.println(i);
                return;
            }
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


Measured memory_bytes: 22996
function main(input) {
    var data = input.split("\n").map(function(line){return line.split(" ").map(function(value){return parseInt(value)})})
    var k = data[0][1];
    var array = data[1];
    var maxA = max(array);
    var sumA = sum(array);
 
    var maxG = Math.min(maxA + k, sumA)
    if (isG(maxG, array, k)) {
    	return console.log(maxG);
    }
    for (var cadidate of findCadidates(sumA, maxG)) {
    	if (isG(cadidate, array, k)) {
    		return console.log(cadidate);
    	}
    }
    return console.log(1);
}
function findCadidates(sumA, max) {
	var cadidates = [];
	for (i = 2; i < Math.min(max, Math.sqrt(sumA)); i++) {
		if (sumA % i != 0) continue;
		var candidate = sumA / i;
		cadidates.push(i);
		if (i != candidate && candidate <= max) cadidates.push(candidate);
	}
	return cadidates.sort(function(a, b){return b - a});
}
function max(array) {
	return array.reduce(function(a,b){ return Math.max(a, b)})
}
function sum(array) {
	return array.reduce(function(current, value){return current + value}, 0)
}
function isG(g, array, k) {
	var newArray = [];
	var tempK = 2*k;
	var sum = 0;
	var cost = 0;
	for (var i=0;i<array.length;i++) {
		var mod = array[i] % g;
		if (mod==0) continue;
		newArray.push(mod);
		sum += mod;
	}
	newArray.sort(function(a, b){ return a - b})
	for (var i=0;i<(newArray.length - sum/g);i++) {
		cost += newArray[i];
		if (cost > k) return false;
	}
	return true;
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 10616
# -*- coding: utf-8 -*-
# C - Otoshidama
# モジュールのインポート
import sys

# 定数の定義
YEN_10000 = 10000
YEN_5000 = 5000
YEN_1000 = 1000

# 標準入力の取得
N,Y = list(map(int, input().split()))

# 探索処理
is_correct = False
for n_10000 in range(N+1):
    for n_5000 in range(N+1-n_10000):
        n_1000 = N - n_10000 - n_5000
        amount = YEN_10000*n_10000 + YEN_5000*n_5000 + YEN_1000*n_1000
        if amount == Y:
            is_correct = True
            print(n_10000, n_5000, n_1000)
            sys.exit()

if not is_correct:
    print("-1 -1 -1")


Measured memory_bytes: 3060
import sys
sys.setrecursionlimit(10**7 + 10)

MOD = 10**9 + 7

n, k = map(int, input().split())
e = [[] for i  in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    e[a].append(b)
    e[b].append(a)

if n == 1:
    print(k)
else:
    visited = [False for i in range(n)]
    def dfs(v, npv, nppv):
        global visited
        ans = max(k - npv - nppv, 0)
        visited[v] = True
        i = 0
        for nv in e[v]:
            if visited[nv]:
                continue

            ans *= dfs(nv, 1, npv+i)
            ans = ans % MOD
            i += 1

        return ans

    for i in range(n):
        if len(e[i]) == 1:
            # print(i)
            s = i
            break

    print(dfs(s, 0, 0))

    # print(e)


Measured memory_bytes: 117528
#include<bits/stdc++.h>
#include <chrono>
using namespace std::chrono;
using namespace std;
#define fr(x,i,n) for(int x = i; x < n; ++x)
#define fb(x,i,n) for(int x = i; x >= n; --x)
#define pr pair<int,int>
#define ll long long int
const int mod=1e9+7;
/*    auto start = high_resolution_clock::now();
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    cout << "\nduration="<<duration.cnt()/1e6 << endl;
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    double r;
    cin>>r;
    cout<<fixed<<setprecision(20);
    cout<<2*M_PI*r;
}


Measured memory_bytes: 3808
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
#define mod 1000000007
bool isPrime[1000001];
ll power(ll a,ll b)
{
    ll result = 1;
    while(b>0)
    {
        if(b%2)
        {
            result = (a*result)%mod;
        }
        a = (a*a)%mod;
        b = b/2;
    }
    return result;
}
int gcd(int a,int b)
{
    if(b==0)
    {
        return a;
    }
    return gcd(b,a%b);
}
void sieve()
{
    memset(isPrime,1,sizeof(isPrime));
    isPrime[0] = isPrime[1] = 0;
    for(int i=2;i*i<=1000000;i++)
    {
        if(isPrime[i])
        {
            for(int j=i*i;j<=1000000;j+=i)
            {
                isPrime[j] = 0;
            }
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);
    int t,n;
    t = 1;
    for(int i=0;i<t;i++)
    {
        int x,y;
        cin>>x>>y;
            bool c = 0;
            for(int i=0;i<=100;i++)
            {
                for(int j=0;j<=100;j++)
                {
                    if(i*2+j*4==y && i+j==x)
                    {
                        c = 1;
                        break;
                    }
                }
                if(c)
                {
                    break;
                }
            }
            if(c)
            {
                cout<<"Yes\n";
            }
            else
            {
                cout<<"No\n";
            }
    }
    return 0;
}

Measured memory_bytes: 3620
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		int M = Integer.parseInt(sc.get());
		int[] H = new int[N];
		Arrays.setAll(H, $ -> Integer.parseInt(sc.get()));

		var ROADS = new BitSet[N];
		for (int i = 0; i < M; i++) {
			int A = Integer.parseInt(sc.get()) - 1;
			int B = Integer.parseInt(sc.get()) - 1;
			var fromA = ROADS[A];
			if (fromA == null) fromA = ROADS[A] = new BitSet();
			var fromB = ROADS[B];
			if (fromB == null) fromB = ROADS[B] = new BitSet();
			fromA.set(B);
			fromB.set(A);
		}

		int count = 0;
		tower:
		for (int i = 0; i < N; i++) {
			var roads = ROADS[i];
			if (roads == null) {
				count += 1;
				continue;
			}
			var height = H[i];
			var iterator = roads.stream().iterator();
			while (iterator.hasNext()) {
				int next = iterator.nextInt();
				if (height <= H[next]) continue tower;
			}
			count += 1;
		}
		System.out.println(count);
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

Measured memory_bytes: 956180
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            char[] a = in.next().toCharArray();

            if (a[0] == a[2])
                out.println("Yes");
            else
                out.println("No");
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}



Measured memory_bytes: 20948
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second

const int INF = 1001001001;

int a[12][12];

int main() {
  int n, m, x;
  cin >> n >> m >> x;
  vector<int> c(n);
  rep(i,n) {
    cin >> c[i];
    rep(j,m) cin >> a[i][j];
  }

  int ans = INF;
  rep(s,1<<n) {
    int cost = 0;
    vector<int> d(m);
    rep(i,n) {
      if (s>>i&1) {
        cost += c[i];
        rep(j,m) d[j] += a[i][j];
      }
    }
    bool ex = true;
    rep(j,m) if (d[j] < x) ex = false;
    if (ex==true) ans = min(ans, cost);
  }
  if (ans == INF) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3580
n, *AB = map(int, open(0).read().split())
A, B = map(sorted, [AB[::2], AB[1::2]])
mid = n//2
if n % 2 == 0:
    a0, a1 = A[mid-1], A[mid]
    b0, b1 = B[mid-1], B[mid]
    print(b0+b1 - (a0+a1) + 1)
else:
    print(B[mid] - A[mid] + 1)


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

int main() {
  int a,b,c,d,e;
  cin >> a >> b >> c >> d >> e;
  if(a==0) cout << 1 << endl;
  else if(b==0) cout << 2 << endl;
  else if(c==0) cout << 3 << endl;
  else if(d==0) cout << 4 << endl;
  else if(e==0) cout << 5 << endl;

}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string s;
    cin>>n>>s;
    if(n%2==0&&s.substr(0,n/2)==s.substr(n/2,n/2))
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


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

using namespace std;
#define ll long long
#define ld long double
#define PI 3.14159265358979323846264338327950L
const int INF = 1001001001;
const int N=2e5 + 5;
const ll mod = 1e9 + 7;

int gcd(int a, int b){ 
    if (a == 0) 
        return b;  
    return gcd(b%a, a);  
} 
   
int lcm(int a, int b)  
{  
    return (a*b)/gcd(a,b);  
}  

vector<int> adj[N];

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
    int n;
    cin >> n;
    n = n % 10;
    if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9) cout << "hon" << endl;
    else if(n == 0 || n == 1 || n == 6 || n == 8) cout << "pon" << endl;
    else if(n == 3) cout << "bon" << endl;
    return 0;
}


Measured memory_bytes: 8324
red, green, blue = map(int, input().split())
k = int(input())
ans = "No"

for _ in range(k):
    if green <= red:
        green *= 2
    else:
        if blue <= green:
            blue *= 2
        else:
            break
if blue > green > red:
    ans = "Yes"
print(ans)

Measured memory_bytes: 9156
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////


int main() {
    int n; cin >> n;
    // typedef pair<ll, ll> P;
    vector<ll> a(n), b(n);
    rep(i,n) {
        cin >> a[i] >> b[i];
        a[i] *= 2;
        b[i] *= 2;
    }
    ll mn, mx;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end(), greater<ll>());
    if (n%2==0) {
        n /= 2;
        mn = (a[n] + a[n-1]) / 2;
        mx = (b[n] + b[n-1]) / 2;
        // cout << mx << " " << mn << endl;
        cout << mx-mn+1 << endl;
    } else {
        n = (n+1)/2;
        mn = a[n-1]/2;
        mx = b[n-1]/2;
        // cout << mn << " " << mx << endl;
        cout << mx-mn+1 << endl;
    }
    return 0;
}

Measured memory_bytes: 6424
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, start, end) for(int i = start; i < end; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
const int MAX = 999999999;

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

    cout << min(a, b) + min(c, d) << endl;
}

Measured memory_bytes: 256
def parent(i):
    return i // 2


def left(i):
    return 2 * i


def right(i):
    return 2 * i + 1


def max_heapify(i):
    global A

    l = left(i)
    r = right(i)

    if l <= H and A[l] > A[i]:
        largest = l
    else:
        largest = i

    if r <= H and A[r] > A[largest]:
        largest = r

    if largest != i:  # iが子供に降るときは、
        A[i], A[largest] = A[largest], A[i]
        max_heapify(largest)  # ここでいうlargestは、元々はiの子ノード。戦いに敗れたA[i]が格納されている。


H = int(input())
A = [None] * (H + 1)

_ = list(map(int, input().split()))
A[1:] = _

for i in range(H//2, 0, -1):
    # print(i)
    max_heapify(i)

print(' ' + ' '.join(map(str, A[1:])))



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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
struct N {
  int now;
  ll d;
};

bool operator<(const N &l, const N &r) {
  return l.d > r.d;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll l;
  int n, m;
  cin >> n >> m >> l;
  vector<bitset<300>> v(n);
  vector<vector<pair<int, ll>>> p(n);
  ll INF = 1LL << 60;
  vector<vector<ll>> ans(n, vector<ll>(n, INF));
  for (int i = 0; i < m; i++) {
    int a, b;
    ll c;
    cin >> a >> b >> c;
    a--;
    b--;
    if (c <= l) {
      p[a].emplace_back(b, c);
      p[b].emplace_back(a, c);
    }
  }
  for (int i = 0; i < n; i++) {
    priority_queue<N> q;
    q.push(N{i, 0});
    while (q.size()) {
      auto now = q.top();
      q.pop();
      if (v[i][now.now]) continue;
      v[i][now.now] = true;
      ans[i][now.now] = 1;
      for (auto &pr : p[now.now]) {
        if (v[i][pr.first]) continue;
        if (now.d + pr.second > l) continue;
        q.push(N{pr.first, now.d + pr.second});
      }
    }
    ans[i][i] = 1;
  }
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        ans[i][j] = min(ans[i][j], ans[i][k] + ans[k][j]);
      }
    }
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    if (ans[a][b] < INF)
      cout << ans[a][b] - 1 << endl;
    else cout << "-1" << endl;
  }
  return 0;
}


Measured memory_bytes: 7096
#include <iostream>
#include <vector>

int main(void){
  int n, p, count;
  std::cin >> n;
  std::vector<int> a(n);
  for(int i=0; i<n; i++) std::cin >> a.at(i);
  
  p = a.at(0);
  count = 1;
  for(int i=0; i<n; i++){
    if(p == 2){
      std::cout << count << std::endl;
      return 0;
    }
    p = a.at(p-1);
    count++;
  }
  std::cout << -1 << std::endl;
  return 0;
}

Measured memory_bytes: 3752
package main

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

func main() {
	t, err := time.Parse("2006/01/02", nextString())
	if err != nil {
		panic(err)
	}

	limit := time.Date(2019, 4, 30, 0, 0, 0, 0, time.UTC)
	if t.After(limit) {
		fmt.Println("TBD")
	} else {
		fmt.Println("Heisei")
	}
}

// Input. ----------

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Split(bufio.ScanWords)
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}

	return i
}

func nextString() string {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}

	return sc.Text()
}

// ---------- Input.

// Util. ----------

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

// ---------- Util.


Measured memory_bytes: 640
S = list(input())
MOD = 10 ** 9 + 7

DP = [[0] * 13 for _ in range(len(S))]

if S[-1] == "?":
  for i in range(10):
    DP[0][i] = 1
else:
  t = int(S[-1])
  DP[0][t] = 1

kk = 10
for i in range(1, len(S)):
  k = kk % 13
  if S[-1 - i] == "?":
    for t in range(10):
      for j in range(13):
        DP[i][(j + k * t) % 13] += DP[i - 1][j]
        DP[i][(j + k * t) % 13] %= MOD
  else:
    t = int(S[-1 - i])
    for j in range(13):
      DP[i][(j + k * t) % 13] = DP[i - 1][j]
  kk = kk * 10 % 13

print(DP[-1][5])

Measured memory_bytes: 65272
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>

using namespace std;

int gcd(int a,int b){
  if(b==0)  return a;
  return gcd(b,a%b);
}

int main(){
  int N,X;
  cin >> N >> X;
  vector<int> x(N);
  for(int i=0;i<N;i++)  cin >> x.at(i);

  vector<int> D(N);
  for(int i=0;i<N;i++){
    D.at(i)=abs(X-x.at(i));
  }

  if(D.size()==1){
    cout << D.at(0) << endl;
    return 0;
  }
  int ans=gcd(D.at(0),D.at(1));
  if(D.size()==2){
    cout << ans << endl;
    return 0;
  }

  for(int i=2;i<N;i++){
    ans=gcd(ans,D.at(i));
  }
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
extern crate proconio;
use proconio::input;

fn main() {
    input! {
        n: usize,
        a: [i64; n],
    }
    let mut ans = 0;
    for i in 0..n {
        for j in (i + 1)..n {
            for k in (j + 1)..n {
                if a[i] == a[j] {
                    continue;
                }
                if a[j] == a[k] {
                    continue;
                }
                if a[i] == a[k] {
                    continue;
                }

                if a[i] + a[j] > a[k] && a[j] + a[k] > a[i] && a[k] + a[i] > a[j] {
                    // println!("{} {} {}", i + 1, j + 1, k + 1);
                    ans += 1;
                }
            }
        }
    }
    println!("{}", ans);
}

Measured memory_bytes: 2108
#include<stdio.h>
#include <stdlib.h>



int main(){

	int i, j, A, B, C, D, N, B_kari = -10, flag;
	char *S;




	scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);

	S = (char *)malloc(N * sizeof(char));

	scanf("%s", S);


	if (C < D){
		while (1){
			if (B + 1 < N && S[B + 1] == '.' && B + 1 < D){
				B += 2;
			}
			else if (B < N && S[B] == '.'){
				B++;
			}
			else{
				printf("No\n");
				return 0;
			}
			if (B == D)
				break;
		}

		while (1){
			if (A + 1 < N && S[A + 1] == '.' && A + 1 < D){
				A += 2;
			}
			else if (A < N && S[A] == '.'){
				A++;
			}
			else{
				printf("No\n");
				return 0;
			}
			if (A == C)
				break;
		}

		printf("Yes\n");
		return 0;

	}
	else{
		flag = 0;
		for (i = B - 2; i < D + 1; i++){
			if (S[i] == '.'){
				flag++;
			}
			else{
				flag = 0;
			}
			if (flag == 3){
//				printf("aaaaaaaaaaa %d\n", i);
				B_kari = i;
				break;
			}
		}

		if (B_kari < 0){
			printf("No\n");
			return 0;
		}
		if (B == B_kari){
			S[B - 1] = '#';
		}
		else{

			while (1){
				if (B + 1 < N && S[B + 1] == '.' && B + 1 < B_kari){
					B += 2;
				}
				else if (B < N && S[B] == '.'){
					B++;
				}
				else{
					printf("No\n");
					return 0;
				}
				if (B == B_kari){
					S[B - 1] = '#';
					//			printf("%s %d\n", S, B);
					break;
				}

			}
		}


		while (1){
			if (A + 1 < N && S[A + 1] == '.' && A + 1 < C){
				A += 2;
			}
			else if (A < N && S[A] == '.'){
				A++;
			}
			else{
				printf("No\n");
				return 0;
			}
			if (A == C)
				break;
		}

		if (B == D){
			printf("Yes\n");
			return 0;
		}

		while (1){
			if (B + 1 < N && S[B + 1] == '.' && B + 1 < D){
				B += 2;
			}
			else if (B < N && S[B] == '.'){
				B++;
			}
			else{
				printf("No\n");
				return 0;
			}
			if (B == D)
				break;
		}

	printf("Yes\n");
		return 0;


	}
}
    


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

double dp[111][111];
int N,T;
int L,B;
int fie[111];

double solve(int id,int turn){
  //printf("%d %d\n",id,turn);
  if( dp[id][turn] > -1.0 ) return dp[id][turn];
  if( id == N ) return dp[id][turn] = 1.0;
  if( turn >= T )
    return dp[id][turn] = 0.0;

  double ret = 0.0;
  for(int i=1;i<=6;i++){
    int nd = id+i;
    int nt = turn+1;
    if( nd > N ) nd = N-(nd-N);
    if( fie[nd] == 2 ) nd = 0;
    if( fie[nd] == 1 ) nt = turn+2;
    ret += solve( nd, nt )/6.0;
  }
  return dp[id][turn] = ret;
}

int main(){
  while( cin >> N >> T >> L >> B && (N||T||L||B) ){
    for(int i=0;i<111;i++) for(int j=0;j<111;j++) dp[i][j] = -5.0;
    memset(fie,0,sizeof(fie));
    for(int i=0;i<L;i++){
      int x; cin >> x;
      fie[x] = 1;
    }
    for(int i=0;i<B;i++){
      int x; cin >> x;
      fie[x] = 2;
    }
    printf("%.6lf\n",solve(0,0));
  }
}

Measured memory_bytes: 1292
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ci cin >>
#define co cout <<

int main() {
	string S;
	ci S;
	int coup = 0;
	if (S[0] == '+')coup++;
	else coup--;
	if (S[1] == '+')coup++;
	else coup--;
	if (S[2] == '+')coup++;
	else coup--;
	if (S[3] == '+')coup++;
	else coup--;
	co coup;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long; 
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    
    int n,k; cin>>n>>k;
    int h[n]; rep(i,n) cin>>h[i];
    int cnt=0;
    
    rep(i,n) if(h[i]>=k) cnt++;

    cout << cnt << ln;
    return 0;
 }


Measured memory_bytes: 640
// Package main provides
//
// File:  a.go
// Author: ymiyamoto
//
// Created on Fri Jan 11 02:25:06 2019
//
package main

import (
	"fmt"
	"sort"
)

func min(slice ...int) int {
	sort.Ints(slice)
	return slice[0]
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(min(a+b, b+c, c+a))
}


Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <type_traits>
#include <map>
#include <limits>

using namespace std;

int check(int a){
  int count = 0;
  while(a%2==0){
    a/=2;
    count++;
  }
  return count;
}

int main(int argc, const char * argv[]) {
  long long n;
  cin >> n;
  int a;
  int ans = 0;
  for(int i = 0; i < n; i++){
    cin >> a;
    ans += check(a);
  }
  cout << ans << endl;
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back

const int maxn = 105;
int n;
int a[maxn];

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    int len = 0;
    int ans = 0;
    for(int i = 1;i <= n;i++){
        cin >> a[i];
        if(a[i] != a[i - 1]){
            ans += len / 2;
            len = 1;
        }else{
            len++;
        }
    }
    ans += len / 2;
    cout << ans << endl;
    return 0;
}


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

using namespace std;

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

    string S;
    cin >> S;
    int res = 0;
    string last;
    int n = S.size();
    for (int i = 0; i < n; ) {
        if (last == ""s + S[i]) {
            if (i + 1 < n) {
                last = ""s + S[i] + S[i + 1];
                ++res;
            }
            i += 2;
        } else {
            last = ""s + S[i];
            ++res;
            ++i;
        }
    }
    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 1296
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

//
#define int long long
#define pb(x) push_back(x)
#define m0(x) memset((x), 0, sizeof(x))
#define mm(x) memset((x), -1, sizeof(x))

//container
#define ALL(x) (x).begin(), (x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define PERM(c) \
  sort(ALL(c)); \
  for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))

// debug
#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;

// bit_macro
#define bit(n) (1LL << (n))
#define bitset(a, b) (a) |= (1 << (b))
#define bitunset(a, b) (a) &= ~(1 << (b))
#define bitcheck(a, b) ((((a) >> (b)) & 1) == 1)
#define bitcount(a) __builtin_popcountll((a))

//typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

//constant
const int INF = (int)1e18;
const int MOD = (int)1e9 + 7;
const double PI = (double)acos(-1);
const double EPS = (double)1e-10;
const int dx[] = {-1, 0, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, -1, 1, 0, 0, 1, -1, 1, -1};

//
template <typename T>
void chmax(T &a, T b) { a = max(a, b); }
template <typename T>
void chmin(T &a, T b) { a = min(a, b); }
//
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
};

int N, D, X;

signed main() {
  cin >> N >> D >> X;
  int sum = X;
  for (int i = 1; i <= N; i++) {
    int a;
    cin >> a;
    sum += (D - 1) / a + 1;
  }

  cout << sum << endl;

  return 0;
}


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

int main()
{
    while (true)
    {
        int h, w;
        scanf("%d %d", &h, &w);
        if (h == 0 && w == 0)
            break;

        for (int i = 0; i < h; i++)
        {
            for (int j = 0; j < w; j++)
            {
                if (i == 0 || i == h - 1 || j == 0 || j == w - 1)
                    printf("#");
                else
                    printf(".");
            }
            printf("\n");
        }
        printf("\n");
    }
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
#define gap ' '
#define L(i) ((i) - (&i))

const int MAXN = 1e7 + 5;
	
int main(){	
	int k; cin >> k;
	int a, b; cin >> a >> b;
	for(int i = a; i <= b; ++i){
		if(i % k == 0){
			cout << "OK" << endl; return 0;
		}
	}
	cout << "NG" << endl;


	return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define FORR(i, m, n) for (ll i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
const int nmax=301;
bool mem[nmax][nmax][nmax];
double dp[nmax][nmax][nmax];
int n;
double f(int x,int y,int z){
    if(!x&&!y&&!z){
        return 0;
    }
    if(mem[x][y][z]){
        return dp[x][y][z];
    }
    double res=(double)n/(x+y+z);
    if(x){
        res+=f(x-1,y,z)*(double)x/(x+y+z);
    }
    if(y){
        res+=f(x+1,y-1,z)*(double)y/(x+y+z);
    }
    if(z){
        res+=f(x,y+1,z-1)*(double)z/(x+y+z);
    }
    mem[x][y][z]=true;
    return dp[x][y][z]=res;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    vector<int> a(n);
    int x=0,y=0,z=0;
    REP(i,n){
        cin >> a[i];
        if(a[i]==1){
            x++;
        }
        if(a[i]==2){
            y++;
        }
        if(a[i]==3){
            z++;
        }
    }
    cout << fixed << setprecision(15) << f(x,y,z) << endl;
}

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

using namespace std;

typedef long long lli;
typedef double lld;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<double> vdl;
typedef vector<vector<lli>> mat;
typedef vector<vdl> mad;
typedef unordered_map<lli,unordered_map<lli,lli>> graph;
typedef complex<double> cmp;
typedef vector<cmp> vcl;

lli n,m;
vll x;
vll y;
unordered_map<lli,lli> inv;
vll z;
lli ans = 0;

int main(){
  cin >> n >> m;
  x = vll(n);
  for(lli i = 0;i < n;i++) cin >> x[i];
  y = vll(m);
  z = vll(m);
  for(lli i = 0;i < n;i++){
    y[x[i]%m]++;
    inv[x[i]]++;
  }
  for(auto x : inv){
    z[x.first%m] += x.second/2;
  }
  ans += y[0]/2;
  if(m%2 == 0) ans += y[m/2]/2;
  for(lli i = 1,j = m-1;i < j;i++,j--){
    if(y[i] < y[j]){
      ans += y[i];
      lli less = y[j]-y[i];
      ans += min(less/2, z[j]);
    }else{
      ans += y[j];
      lli less = y[i]-y[j];
      ans += min(less/2, z[i]);
    }
  }
  cout << ans << endl;
  return 0;

}


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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

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

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

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cerr << (*begin) << " ";
    *begin++;
  }
  cerr << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cerr << " " << Array[i][j];
    }
    cerr << endl;
  }
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  std::cerr << head << " ";
  print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
  int val = ((a % mod) + (b % mod)) % mod;
  if (val < 0) { val += mod; }
  a = val;
}

template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

// ------------------------------------------------------------------------------------------

int N;
string s;
int white[222222];
int black[222222];
 
signed main() {
  cin >> N >> s;
  rep (i, N) {
    white[i] = (s[i] == '.');
    black[i] = (s[i] == '#');
  }
 
  repp (i, 1, N) {
    black[i] += black[i-1];
  }
 
  for (int i = N-2; i >= 0; i--) {
    white[i] += white[i+1];
  }
  print1(white, white+N+1);
  print1(black, black+N+1);
 
  int ans = 1e18;
  for (int i = 0; i < N; i++) {
    int t = black[i] + white[i+1];
    chmin(ans, t);
  }
 
  int hoge = count(all(s), '.');
 
  cout << min(ans, hoge) << endl;
 
  return 0;
}

Measured memory_bytes: 3844
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if b-a >k or c-a > k or d-a >k or e-a > k or c-b > k or d-b > k or e-b > k or d-c > k or e-c > k or e-d > k:
    print(":(")
else:
    print("Yay!")    


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
int const K = 100005;
int n , A[101],DP[K][2];

int calc(int k , int turn){
    if(K == 0)return !turn;
    if(DP[k][turn]!=-1)return DP[k][turn];
    int currW = !turn;
    for (int i = 0 ;i<n && currW != turn && A[i]<=k;i++){
        currW = calc(k-A[i],!turn);
    }
    return DP[k][turn] = currW;
}

int main() {
    int k;
    cin>>n>>k;
    for (int i = 0; i < K; i++)
        DP[i][0] = DP[i][1] = -1;
    for(int i = 0 ; i<n ; i++)cin>>A[i];
    if(calc(k,0)==0){
        cout<<"First";
    }
    else
    cout<<"Second";
}


Measured memory_bytes: 9060