akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define LL long long
char a[20][20];
int n, m;
bool Ans;
multiset<LL> S;
inline bool check() {
	S.clear();
	for(int j = 1; j <= m; ++ j) {
		LL t = 0;
		for(int i = n; i >= 1; -- i) {
			t = t * 26 + a[i][j] - 'a';
		}
		if(S.find(t) != S.end()) {
			S.erase(S.find(t));
		}
		else {
			t = 0;
			for(int i = 1; i <= n; ++ i) {
				t = t * 26 + a[i][j] - 'a';
			}
			S.insert(t);
		}
	}
	if(m & 1) {
		if(S.size() == 1) {
			LL wt = (*S.begin());
			static int x[20];
			for(int i = 1; i <= n; ++ i) {
				x[i] = wt % 26; wt /= 26;
			}
			for(int i = 1; i <= n / 2; ++ i) {
				if(x[i] != x[n - i + 1]) return false;
			}
			return true;
		}
		return false;
	}
	else {
		if(S.size() == 0) return true;
		return false;
	}
}
inline void dfs(int x) {
	if(x == n / 2 + 1) {
		if(check()) Ans = true;
		return;
	}
	for(int i = x + 1; i <= n - x + 1; ++ i) {
		for(int j = 1; j <= m; ++ j) {
			swap(a[i][j], a[n - x + 1][j]);
		}
		dfs(x + 1);
		for(int j = 1; j <= m; ++ j) {
			swap(a[i][j], a[n - x + 1][j]);
		}
	}
}
int main() {
	//freopen("a.in", "r", stdin);
	n, m;
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; ++ i) {
		scanf("%s", a[i] + 1);
	}
	if(n & 1) {
		for(int i = 1; i <= n; ++ i) {
			for(int j = 1; j <= m; ++ j) {
				swap(a[i][j], a[n / 2 + 1][j]);
			}
			dfs(1);
			for(int j = 1; j <= m; ++ j) {
				swap(a[i][j], a[n / 2 + 1][j]);
			}
		}
	}
	else dfs(1);
	if(Ans) puts("YES");
	else puts("NO");
}

Measured memory_bytes: 256
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll a,b;
  cin>>a>>b;
  if(a*500>=b) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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

using namespace std;

typedef long long LL;
typedef unsigned long UL;

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

int main()
{
    int a, b, c, d;
    string str;
    cin >> str;
    a = str[0] - '0';
    b = str[1] - '0';
    c = str[2] - '0';
    d = str[3] - '0';

    if (a + b + c + d == 7) 
    {
        cout << a << "+" << b << "+" << c << "+" << d << "=7" << endl;
    }
    else if (a - b + c + d == 7) 
    {
        cout << a << "-" << b << "+" << c << "+" << d << "=7" << endl;
    }
    else if (a + b - c + d == 7)
    {
        cout << a << "+" << b << "-" << c << "+" << d << "=7" << endl;
    }
    else if (a + b + c - d == 7)
    {
        cout << a << "+" << b << "+" << c << "-" << d << "=7" << endl;
    }
    else if (a - b - c + d == 7)
    {
        cout << a << "-" << b << "-" << c << "+" << d << "=7" << endl;
    }
    else if (a + b - c - d == 7)
    {
        cout << a << "+" << b << "-" << c << "-" << d << "=7" << endl;
    }
    else if (a - b + c - d == 7)
    {
        cout << a << "-" << b << "+" << c << "-" << d << "=7" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int,int>
#define ff first
#define ss second
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#include "string"
	
int32_t main(){
	boost;
	string s,t;
	cin>>s>>t;
	int ans = 0;
	for(int i=0;i<s.size();i++)
		ans += (s[i]!=t[i]);
	cout<<ans<<endl;
}



Measured memory_bytes: 3792
#include <cstdint>

using namespace std;

static uint32_t cnt = 0;

static void merge(uint32_t array[], uint32_t left, uint32_t mid, uint32_t right)
{
  int32_t left_n = mid - left;
  int32_t right_n = right - mid;
  uint32_t *left_array = new uint32_t[left_n + 1];
  uint32_t *right_array = new uint32_t[right_n + 1];

  for (uint32_t i = 0; i < left_n; i++) {
    left_array[i] = array[i + left];
  }
  left_array[left_n] = UINT32_MAX;

  for (uint32_t i = 0; i < right_n; i++) {
    right_array[i] = array[i + mid];
  }
  right_array[right_n] = UINT32_MAX;

  uint32_t left_index = 0, right_index = 0;
  for (uint32_t i = left; i < right; i++) {
    uint32_t left = left_array[left_index];
    uint32_t right = right_array[right_index];
    if (left < right) {
      array[i] = left;
      left_index++;
    } else {
      array[i] = right;
      right_index++;
    }
    cnt++;
  }

  delete[] left_array;
  delete[] right_array;
}

static void sort(uint32_t array[], uint32_t left, uint32_t right)
{
  if (right - left <= 1) return;

  uint32_t mid = (left + right) / 2;
  sort(array, left, mid);
  sort(array, mid, right);
  merge(array, left, mid, right);
}

void merge_sort_merge(uint32_t array[], size_t len)
{
  sort(array, 0, len);
}

#if !defined(TEST)
#include <cstdio>

#define ARRAY_SIZE 500000

static uint32_t array[ARRAY_SIZE];

int32_t main()
{
  int32_t num;
  scanf("%d", &num);

  for (uint32_t i = 0; i < num; i++) {
    scanf("%u", &array[i]);
  }
  merge_sort_merge(array, num);

  for (uint32_t i = 0; i < num; i++) {
    if (i != 0) printf(" ");
    printf("%d", array[i]);
  }
  printf("\n");
  printf("%d\n", cnt);

  return 0;
}
#endif

Measured memory_bytes: 6352
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
string S;

int main() {
  cin >> S;
  int ans = 700;
  for (int i = 0; i < S.size(); ++i) {
    if (S[i] == 'o') ans += 100;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#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 mset(x) memset(x, 0, sizeof(x))
#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);
    ll n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    ll i;
    ll unhappy(0);
    rep(i, n) {
        if (s[i] == 'L') {
            if (i == 0 || s[i-1] != s[i]) {
                unhappy++;
            }
        } else {
            if (i == n-1 || s[i+1] != s[i]) {
                unhappy++;
            }
        }
    }
    unhappy = max(1ll, unhappy - k * 2);
    cout << n - unhappy << endl;
}


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

int main(){
  int height;
  int width;
  while(true){
    cin >> height >> width;
    if(height == 0 && width == 0)
      break;
    for (int i = 0; i < height; i++){
      for (int j = 0; j < width; j++){
        if ((i + j) % 2 == 0){
          cout << "#";
        }
        else {
          cout << ".";
        }
      }
      cout << "\n";
    }
    cout << "\n";
  }
  return 0;
}


Measured memory_bytes: 3044
function Main(input){
    xs = input.trim().split('');    
    count = '';
	for(var i = 0; i < xs.length; i++){
    	if(xs[i] === 'o'){
        count = count + 'o'
        } 
    }
    var ans = count.length;
    console.log(700 + ans*100 + 0);  
}

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

Measured memory_bytes: 11468
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <random>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;
typedef long long ll;

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

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll N,A,B,C,D;
  cin>>N>>A>>B>>C>>D;
  bool ans=false;
  REP(i,N){
    if(C*i-D*(N-1-i)<=B-A && B-A<=D*i-C*(N-1-i)){
      ans=true;
    }
  }
  cout<<(ans?"YES":"NO")<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   // freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    long double L;cin>>L;
    long double ans=(L*L*L)/27.000000000;
    cout<<fixed<<setprecision(9)<<ans;
}

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

int main(){
	int N,i;
	int a[1010];
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",a+i);
	

	for(i=0;i<N;i++){
		if(a[i]%2==0){
			if(a[i]%3==0 || a[i]%5==0);
			else {
				printf("DENIED\n");
				return 0;
			}
		} 
	}
	printf("APPROVED\n");

	return 0;	
}

Measured memory_bytes: 128
#include <stdio.h>

using namespace std;

int main(){
	int n,m,l;
	scanf("%d %d %d",&n,&m,&l);
	int A[n][m],B[m][l];
	long long int C[n][l];
	for(int i = 0; i < n; i++){
		for(int j = 0; j < l; j++){
			C[i][j] = 0;
		}
	}

	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			scanf("%d",&A[i][j]);
		}
	}
	for(int i = 0; i < m; i++){
		for(int j = 0; j < l; j++){
			scanf("%d",&B[i][j]);
		}
	}

	for(int i = 0; i < n; i++){
		for(int k = 0; k < l; k++){
			for(int j = 0; j < m; j++){
				C[i][k] += A[i][j]*B[j][k];
			}
		}
	}

	for(int i = 0; i < n; i++){
		for(int j = 0; j < l-1; j++){
			printf("%lld ",C[i][j]);
		}
		printf("%lld\n",C[i][l-1]);
	}
}

//naotoのパクリ


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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;
const ll LLMAX = (0x7FFFFFFFFFFFFFFFL);

//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

long long int n,cnt=0,ans=LLMAX,anss=0,R,r[100000],a,b,c,cmp,cmpp,data,m,h,w,x,y,xcmp,ycmp,sum=0;

string s;

vector<int> z;

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

       cin >> n >> m >> R;
       rep(i,R){
           cin >> r[i];
           r[i]--;
           z.pb(r[i]);
       }
       sort(all(z));
       long long int flo[n+1][n+1];
       rep(i,n+1){
           rep(j,n+1){
               if(i==j){
                   flo[i][j]=0;
               }
               else{
                   flo[i][j]=INF;
               }
           }
       }
       rep(i,m){
           cin >> a >> b >> c;
           a--;
           b--;
           flo[a][b]=c;
           flo[b][a]=c;
       }
       rep(i,n){
           rep(j,n){
               rep(k,n){
                   flo[j][k]=min(flo[j][k],flo[j][i]+flo[i][k]);
               }
           }
       }
     do{
         cmp=0;
         rep(i,R-1){
             cmp+=flo[z[i]][z[i+1]];
         }
         ans=min(cmp,ans);
     }
     while(next_permutation(all(z)));
     
       
       Cout(ans);
return 0;
}


Measured memory_bytes: 640
from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from math import *
from collections import defaultdict as dd, deque
def data(): return sys.stdin.readline().strip()
def mdata(): return map(int, data().split())
#def print(x): return sys.stdout.write(str(x)+'\n')
#sys.setrecursionlimit(100000)
mod=int(1e9+7)

a,b,c=mdata()
print(c,a,b)

Measured memory_bytes: 3444
#include "bits/stdc++.h"
using namespace std;
#define long int64_t

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

	int N;
	cin >> N;

	vector<int> P( N ), Q( N ), x( N );
	for( auto& v: P ) { cin >> v; }
	for( auto& v: Q ) { cin >> v; }
	for( int i = 0; i < N; ++i ) { x[i] = i+1; }

	int i = 1;
	int a = 0;
	int b = 0;
	do {
		if( x == P ) { a = i; }
		if( x == Q ) { b = i; }

		i += 1;
	} while( next_permutation( x.begin(), x.end() ) );

	cout << abs( a - b ) << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
using namespace std;
typedef long double ld;
int main() {
    int n, t[100], s=0;
    ld w[50000], d=0.5, c=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>t[i];
    }
    for(int i=0;i<50000;i++){
        w[i]=100;
    }
    w[0]=0;
    for(int i=0;i<n;i++){
        ld v;
        cin>>v;
        for(int j=0;j<=t[i]*2;j++){
            w[s]=min(w[s], v);
            s++;
            if(j==t[i]*2)s--;
        }
    }
    for(int i=0;i<=s;i++){
        //cout<<i<<" "<<w[i]<<endl;
    }
    for(int i=1;i<=s;i++){
        w[i]=min(w[i-1]+d, w[i]);
    }
    w[s]=0;
    for(int i=s-1;i>=0;i--){
        w[i]=min(w[i], w[i+1]+d);
    }
    for(int i=1;i<=s;i++){
        ld a=w[i-1], b=w[i];
        c+=(a+b)/4;
        //cout<<i<<" "<<w[i]<<endl;
    }
    cout<<setprecision(20)<<c<<endl;
	return 0;
}

Measured memory_bytes: 1024
#!/usr/bin/env python
# coding: utf-8


def count_pattern(i):
    n = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if (a + b + c + d) == i:
                        n += 1
    return n


def main():
    while 1:
        try:
            s = raw_input()
        except EOFError:
            return
        print count_pattern(int(s))


if __name__ == '__main__':
    main()

Measured memory_bytes: 4228
package main

import (
	"fmt"
)

func main() {
	var N, ans int64
	fmt.Scan(&N)
	var a int64
	for a = 1; a < N; a++ {
		var m int64
		m = (N - a) / a
		if m == 0 || a*a > N {
			break
		}
		if N/m != N%m {
			continue
		}
		ans += m
		// fmt.Printf("%v %v %v\n", a, m, ans)
	}
	fmt.Printf("%v\n", ans)
}

// N=1000000000000
// a=800000


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

#define ln '\n'
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i <= (int)(b); ++i)
#define FORR(i, a, b) for (int i = (a); i >= (int)(b); --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> VP;
typedef vector<PL> VPL;
typedef vector<string> VS;

const int MOD = (int)1e9 + 7;

class Combination {
   private:
    VL _fact;
    VL _invfact;

    ll power(ll x, ll n) {
        if (n == 0)
            return 1;
        else if (n == 1)
            return x % MOD;
        else if (n % 2 == 0) {
            ll buf = power(x, n / 2);
            return buf * buf % MOD;
        } else {
            ll buf = power(x, n / 2);
            return (buf * buf % MOD) * x % MOD;
        }
    }

   public:
    Combination(int n) : _fact(n + 1), _invfact(n + 1) {
        _fact[0] = 1;
        REP(i, n) _fact[i + 1] = _fact[i] * (ll)(i + 1) % MOD;
        REP(i, n + 1) _invfact[i] = power(_fact[i], MOD - 2);
    }

    ll operator()(int n, int k) {
        if (n < k or k < 0) return 0;
        return (_fact[n] * _invfact[n - k] % MOD) * _invfact[k] % MOD;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    Combination comb(2000);
    FOR(i, 1, k) {
        ll devide_cnt = comb(k - 1, i - 1);
        ll ans = devide_cnt * comb(n - k + 1, i) % MOD;
        cout << ans << ln;
    }
    return 0;
}


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

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

using namespace std;

int main(){
  string s;cin>>s;
  string cor="AKIHABARA";
  int c=0;
  bool f=true;
  rep(i, cor.size()){
    if(s[c]==cor[i]){
      c++;
    }else if(s[c]!=cor[c] && cor[i]!='A'){
      f=false;
      break;
    }
  }
  if(c!=s.size())f=false;

//cout<<c<<' '<<s.size()<<endl;

  if(f)cout<<"YES";
  else cout<<"NO";

  return 0;
}

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

const int M=1e9+7;
const int MAX=1e6;

long long kai[MAX],kair[MAX],rev[MAX];

void com_p(){
  kai[0]=kai[1]=1;
  kair[0]=kair[1]=1;
  rev[1]=1;
  for(int i=2;i<MAX;i++){
    kai[i]=kai[i-1]*i%M;
    rev[i]=M-rev[M%i]*(M/i)%M;
    kair[i]=kair[i-1]*rev[i]%M;
  }
}
long long ncr(int n,int r){
  if(n<0||r<0) return 0;
  if(n<r) return 0;
  return kai[n]*(kair[r]*kair[n-r]%M)%M;
}

int main(){
  int x,y;
  cin>>x>>y;
  com_p();
  long long sum=0;
  for(int i=0;i<=x;i++){
    if(3*i==2*y-x){
      sum+=ncr(y-i,i);
      sum%=M;
    }
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 23680
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm> // sort
#include <map>       // pair
#include <vector>
using namespace std;

#define REP(a,b) for(int i =(a);i < (b);i++)
#define FOR(n) for(int i = 0; i<(n); i++)
#define COUT(c)  cout<<(c)<<endl


const int INF = 100100100;
const int MOD = (int)1e9 +7;
const double EPS = 1e-9; 

typedef long long int ll;

//char in[120];
//ex. pair
//pair<pair<string,int>,int> p[110];

int main(){
    int n,m,p;cin>>n>>m>>p;
    if (n-m >= p) cout<<0<<endl;
    else cout << p -(n-m) << endl;
    return 0;    
}

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

using namespace std;

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

#define ALL(obj)	(obj).begin(),(obj).end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define VEC vector

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int 			ll;

typedef pair<int,int>			P;
typedef vector<int>				Vint;
typedef vector<Vint>			VV;

template<typename T>string join(const v(T)&v)
{stringstream s;REP(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define MAX 		400010

const ll LINF = (ll)9e18+7;		//
const int INF = 100100100;			//2,147,483,647 (Max int)
const ll MOD = 1e9+7;
// テンプレ終了
//====================================================================//

// int DP[MAX];

//
int main(){
	int N,K;cin >> N >> K;
	VEC<ll> x(N),y(N), X(N),Y(N);
	REP(i,N){cin>>X[i]>>Y[i];
		x[i]=X[i],y[i]=Y[i];
	}

	sort(ALL(X));
	sort(ALL(Y));

	ll ans = (ll)(X[N-1]-X[0])*(Y[N-1]-Y[0]);

	REP(xl,N){
		REPS(xr,xl+1,N){
			REP(yd,N){
				REPS(yu,yd+1,N){
					int cnt = 0;
					REP(itr,N){
						if(X[xl]<=x[itr]&&x[itr]<=X[xr]&&Y[yd]<=y[itr]&&y[itr]<=Y[yu])cnt++;
					}
					if(cnt>=K)ans = min(ans,( (ll)(X[xr]-X[xl])*(Y[yu]-Y[yd]) ) );
				}
			}
		}
	}

	cout << ans << endl;

	return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn=5e5+10;
const double eps=1e-10;
int n,L,Head=0,Tail=0;
inline int sgn(double x){
	if(x>eps) return 1;
	if(x<-eps) return -1;
	return 0;
}
inline int read(){
	int x=0;char ch=getchar();
	while(!isdigit(ch)) ch=getchar();
	while(isdigit(ch)) x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x;
}
struct Point{
	double x,y;
	Point(double X=0,double Y=0){x=X,y=Y;}
	friend inline Point operator+(const Point &a,const Point &b){return Point(a.x+b.x,a.y+b.y);}
	friend inline Point operator-(const Point &a,const Point &b){return Point(a.x-b.x,a.y-b.y);}
	friend inline Point operator+(const Point &a,const double &b){return Point(a.x/b,a.y/b);}
	friend inline double cross(const Point &a,const Point &b){return a.x*b.y-a.y*b.x;}
	inline double f(double v){if(!sgn(x)) return 0;return v*y/x;}
}O,Q[maxn];
int main(){
	//freopen("ARC072F.in","r",stdin);
	n=read(),L=read();
	for(int i=1;i<=n;++i){
		double v=read(),u=read();
		O=Point(O.x+u,O.y+u*v);
		while(Head<Tail&&(O.x-Q[Head+1].x)>=L) ++Head;
		if(Head!=Tail&&O.x-Q[Head].x>L) Q[Head]=Point(O.x-L,Q[Head].y+Point(Q[Head+1]-Q[Head]).f(O.x-L-Q[Head].x));
		while(Head<Tail&&sgn(cross(O-Q[Tail-1],Q[Tail]-Q[Tail-1]))>=0) Tail--;
		Q[++Tail]=O,printf("%.7lf\n",(O.y-Q[Head].y)/L);
	}
}

Measured memory_bytes: 16896
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 8020;

int main()
{
  string s;
  cin >> s;
  int x,y;
  cin >> x >> y;

  vector<int> t;
  int cnt = 0;
  for(int i = 0; i < s.size(); i++){
    if(s[i] == 'T'){
      if(cnt != 0) t.push_back(cnt);
      t.push_back(0);
      cnt = 0;
    }else{
      cnt++;
      if(i == s.size()-1) t.push_back(cnt);
    }
  }

/*
  for(int i = 0; i < t.size(); i++){
    cout << t[i] << " ";
  }printf("\n");
*/
  

  bool dp_x[MAXN][MAXN*2] = {false}, dp_y[MAXN][MAXN*2] = {false};
  dp_x[0][8000] = true;
  dp_y[0][8000] = true;

  bool flag = false;
  bool xy = true; // true -> x
  int cnt_x = 0,cnt_y = 0;
  for(int i = 0; i < t.size(); i++){
    if(t[i] == 0){
      if(!flag) flag = true;
      xy  = !xy;
    }else{
      if(xy){
        cnt_x++;
        //cout << "x =  " << cnt_x <<  endl;
        for(int j = 0; j < MAXN*2; j++){
          if(dp_x[cnt_x-1][j] && j+t[i] < MAXN*2){
            if(j+t[i] < MAXN*2) dp_x[cnt_x][j+t[i]] = true;
            if(j-t[i] >= 0 && flag) dp_x[cnt_x][j-t[i]] = true;
          }
        }
        if(!flag) flag = true;
      }else{
        cnt_y++;
        //cout << "y =  " << cnt_y <<  endl;
        for(int j = 0; j < MAXN*2; j++){
          if(dp_y[cnt_y-1][j] && j+t[i] < MAXN*2){
            if(j+t[i] < MAXN*2) dp_y[cnt_y][j+t[i]] = true;
            if(j-t[i] >= 0) dp_y[cnt_y][j-t[i]] = true;
          }
        }
        if(!flag) flag = true;
      }
    }
  }

  bool is_x = false, is_y = false;
  /*
  for(int j = 0; j < MAXN*2; j++){
    if(dp_x[cnt_x][x+8000]) is_x = true;
  }
  for(int j = 0; j < MAXN*2; j++){
    if(dp_y[cnt_y][y+8000]) is_y = true;
  }
  
  cout << "x =  " << cnt_x <<  endl;
  for(int i = 0; i < MAXN*2; i++){
    if(dp_x[cnt_x][i]) cout << i - 8000 << endl;
  }
  cout << "y = " << cnt_y <<  endl;
  for(int i = 0; i < MAXN*2; i++){
    if(dp_y[cnt_y][i]) cout << i - 8000 << endl;
  }
  */
  if(dp_x[cnt_x][x+8000]) is_x = true;
  if(dp_y[cnt_y][y+8000]) is_y = true;

  if(is_x && is_y) cout << "Yes" << endl;
  else cout << "No" << endl;


  return 0;
}

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

using namespace std;

int main(){
	int n;
	cin >> n;
	
	long long arr[n];
	
	for(int i = 0; i < n; i++)
		cin >> arr[i];
		
	long long lcm = arr[0];
	long long g;
	for(int i = 1; i < n;i ++){
		g = __gcd(lcm, arr[i]);
		lcm = (arr[i]/g)*lcm;
	}
	cout << lcm << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
#define N 7500000

bool years[N+10];

int main(){
    int m,n;
    while(cin>>m>>n){
        if(m==0 && n==0){
            break;
        }
        for(int i = m; i <= N; i++){
            years[i]=true;
        }
        

        for(int i = m; i <= N; i++){
            if(years[i]){
                if(n == 0){
                    cout<<i<<endl;
                    break;
                }
                n--;

                for(int j = i + i; j <= N; j += i){
                    years[j] = false;
                }
            }
        }
    }
}

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

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

    vector<string> vec(H);
    for(int i = 0; i < H; i++){
        cin >> vec.at(i);
    }
    for(int i = 0; i < W + 2; i++){
        cout << "#";
    }
    cout << endl;
    for(int i = 0; i < H; i++){
        cout << "#" << vec.at(i) << "#" << endl;
    }
    for(int i = 0; i < W + 2; i++){
        cout << "#";
    }
    cout << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000
typedef pair<ll, ll> pll;

int N;
int linear_search(vector<int> A, int key) {
    for (int i = 0; i < N; i++) {
        if (A[i] == key)
            return i;
    }

    return -1;
}

int main() {
    cin >> N;
    vector<int> A(N);
    rep(i, N) { cin >> A[i]; }

    int q, counter = 0;
    cin >> q;
    rep(i, q) {
        int a;
        cin >> a;
        if (linear_search(A, a) != -1)
            counter++;
    }

    cout << counter << endl;
}


Measured memory_bytes: 3176
#include<stdio.h>

int main(){
int K,S,X,way=0,n;
scanf("%d %d",&K,&S);
for(X=K;X>=0;X--){
   n=S-X;
   if(n>=0 && n<=2*K){
      if(n<=K){
         way=way+n+1;
      }else{
         way=way+n+1-2*(n-K);
      }
   }
}
printf("%d",way);
return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define array_input int n;cin>>n;int a[n+1],i;for(i=1;i<=n;i++){cin>>a[i];}
#define array_output for(i=1;i<=n;i++){cout<<a[i]<<" ";}cout<<endl;
#define INF 2147483647
#define long_INF 18446744073709551615
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef long double ld;
const double pi=acos(-1);
const double eps=1e-6;

void read(int &x)
{
    x=0;
	char c=getchar();
    while(c<'0' || c>'9')c=getchar();
    while(c>='0' && c<='9')
	{
        x=x*10+c-'0';
        c=getchar();
    }
}

void write(int x)
{
    if(x==0)
	{
		putchar(48);
		return;
	}
    int len=0,dg[20];
    while(x>0)
	{
		dg[++len]=x%10;
		x/=10;
	}
    for(int i=len;i>=1;i--)
	{
		putchar(dg[i]+48);
	}
}

int main()
{
	int a[4];
	cin>>a[1]>>a[2]>>a[3];
	sort(a+1,a+4);
	ll ans;
	ans=(a[3]-a[1])/2+(a[3]-a[2])/2;
	a[1]=a[3]-((a[3]-a[1])%2);
	a[2]=a[3]-((a[3]-a[2])%2);
	//cout<<a[1]<<" "<<a[2]<<" "<<a[3]<<endl<<ans;
	if (a[1]==a[2])
	{
		if (a[3]-a[1]==1)
		{
			cout<<ans+1<<endl;
			return 0;
		}
		else
		{
			cout<<ans<<endl;
			return 0;
		}
	}
	else
	{
		cout<<ans+2<<endl;
	}
	return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  rep(i, n) cin >> p.at(i);
  int cnt = 0;
  rep(i, n){
    if(p.at(i) != i+1) cnt++;
  }
  
  if(cnt > 2) cout << "NO" << endl;
  else cout << "YES" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include<iomanip>
#include<functional>

using namespace std;
typedef long long ll;



int main() {
	int N; cin >> N;
	vector<string> S(N);
	for (int i = 0; i < N; i++) cin >> S[i];
	sort(S.begin(), S.end());
	int ans = 1;
	for (int i = 0; i < N-1; i++) {
		if (S[i] != S[i + 1])ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 9552
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

class SuffixArray {
	class Suffix implements Comparable<Suffix> {
		int index;
		int[] rank = new int[2];

		public int compareTo(Suffix o) {
			if (rank[0] != o.rank[0])
				return rank[0] - o.rank[0];
			return rank[1] - o.rank[1];
		}
	}

	String str;

	public SuffixArray(String str) {
		this.str = str;
	}

	public int[] buildSuffixArray() {

		int n = str.length();
		Suffix[] suffixes = new Suffix[n];
		int[] arr = new int[n];
		// create and store suffixes
		// Also stores rank of first two chars of suffix
		for (int i = 0; i < n; i++) {
			suffixes[i] = new Suffix();
			suffixes[i].index = i;
			suffixes[i].rank[0] = str.charAt(i) - 'a';
			suffixes[i].rank[1] = ((i + 1) < n) ? (str.charAt(i + 1) - 'a') : -1;
		}

		Arrays.sort(suffixes);

		int[] ind = new int[n]; // to map index in suffix[] to index in original
								// string
		for (int k = 4; k < 2 * n; k = k * 2) {
			// Assigning rank and index values to first suffix
			int rank = 0;
			int prev_rank = suffixes[0].rank[0];
			suffixes[0].rank[0] = rank;
			ind[suffixes[0].index] = 0;

			// Assigning rank to suffixes
			for (int i = 1; i < n; i++) {
				// If first rank and next ranks are same as that of previous
				// suffix in array, assign the same new rank to this suffix
				if (suffixes[i].rank[0] == prev_rank && suffixes[i].rank[1] == suffixes[i - 1].rank[1]) {
					prev_rank = suffixes[i].rank[0];
					suffixes[i].rank[0] = rank;
				} else // Otherwise increment rank and assign
				{
					prev_rank = suffixes[i].rank[0];
					suffixes[i].rank[0] = ++rank;
				}
				ind[suffixes[i].index] = i;
			}

			// Assign next rank to every suffix
			for (int i = 0; i < n; i++) {
				int nextindex = suffixes[i].index + k / 2;
				suffixes[i].rank[1] = (nextindex < n) ? suffixes[ind[nextindex]].rank[0] : -1;
			}

			// Sort the suffixes according to first k characters
			Arrays.sort(suffixes);
		}

		for (int i = 0; i < n; i++)
			arr[i] = suffixes[i].index;

		return arr;
	}

	public int[] kasai(int[] sa) {
		int n = str.length(), k = 0;
		int[] lcp = new int[n];
		int[] rank = new int[n];
		for (int i = 0; i < n; i++)
			rank[sa[i]] = i;
		for (int i = 0; i < n; i++) {
			if (rank[i] == n - 1) {
				k = 0;
				continue;
			}
			int j = sa[rank[i] + 1];
			while (i + k < n && j + k < n && str.charAt(i + k) == str.charAt(j + k)) {
				k++;
			}
			lcp[rank[i]] = k;
			k = (k == 0) ? 0 : k - 1;
		}
		return lcp;
		
	}

}

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		SuffixArray obj = new SuffixArray(s);
		int SA[] = obj.buildSuffixArray();
		int k = Integer.parseInt(br.readLine());

//		Helper.tr(SA);
		int[] arr = obj.kasai(SA);
//		Helper.tr(arr);
		
		int preCommon = 0;
		for (int i=0; i<arr.length; i++) {
			k -= s.length()-SA[i]-preCommon;
//			Helper.tr(i, k);
			if (k<=0) {
				System.out.println(s.substring(SA[i], s.length()+k));
				break;
			}
			preCommon = arr[i];
		}
	}
}

Measured memory_bytes: 23380
package main

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

// const abcd = "abcdefghijklnmopqrstuvwxyz"
// const ABCD = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}
// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}

// var dx = [...]int{0, 1, 0, -1}
// var dy = [...]int{1, 0, -1, 0}

var inf int = 1e13
var mod = 1000000007

// ---------------------------------------------------------
func main() {
	log.SetFlags(log.Lshortfile)
	next := newScanner()
	n := next.Int()
	a := next.Int()
	b := next.Int()
	c := next.Int()
	d := next.Int()
	b -= a
	ans := "NO"
	n--
	for i := 0; i < n; i++ {
		lowest := c*i - (n-i)*d
		highest := d*i - (n-i)*c
		// log.Println(lowest, highest)
		if lowest <= b && b <= highest {
			ans = "YES"
			break
		}
	}

	fmt.Println(ans)
}

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

// Pair is liked C++ pair
type Pair struct {
	a, b int
}

// Pairs is sorted by []Pair struct
type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a < p[j].a {
		return true
	} else if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return false
}

// -------------------------------
func in(c, a, z int) bool {
	return c >= a && c < z
}

func btoi(b bool) int {
	if b {
		return 1
	}
	return 0
}

func itob(a int) bool {
	if a == 0 {
		return false
	}
	return true
}

func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}

func sum(a ...int) int {
	r := a[0]
	if len(a) > 1 {
		for i := 1; i < len(a); i++ {
			r += a[i]
		}
	}
	return r
}

func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}

func minmax(a, b int) (int, int) {
	if a > b {
		return b, a
	}
	return a, b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// ---------- buffered scanner -----------------------------------------
type scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func newScanner() *scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 10000)
	return &scanner{r: rdr}
}
func (s *scanner) next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *scanner) Line() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *scanner) Int() int {
	v, _ := strconv.Atoi(s.next())
	return v
}
func (s *scanner) Int64() int64 {
	v, _ := strconv.ParseInt(s.next(), 10, 64)
	return v
}
func (s *scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
using vll=vector<ll>;
using vi=vector<int>;

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

//pow(llpow,modpow)
template<class T> ll llpow(T x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
long long modpow(long long a, long long n, long long mod) {long long res = 1;while (n > 0) {if (n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL<<60;
int main(){
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    int p=0;
    char watch=s[0];
    rep(i,k){
    while(p<n&&s[p]==watch)p++;
    while(p<n&&s[p]!=watch){
        s[p]=watch;
        p++;
    }
    }
    int res=0;
    rep(i,n){
        if(s[i]=='R'&&i<n-1){
           if(s[i]==s[i+1])res++;
        }
        else if(s[i]=='L'&&i>0){
            if(s[i]==s[i-1])res++;
        }
    }
    cout<<res<<endl;
    return 0;
}




Measured memory_bytes: 512
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cstring>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

#define SIZE(x) (int((x).size()))
#define rep(i,l,r) for (int i=(l); i<=(r); i++)
#define repd(i,r,l) for (int i=(r); i>=(l); i--)
#define rept(i,c) for (__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

#ifndef ONLINE_JUDGE
#define debug(x) { cerr<<#x<<" = "<<(x)<<endl; }
#else
#define debug(x) {}
#endif

void lemon()
{
	int n,m,s; cin>>n>>m>>s;
	rep(x,0,n)
	{
		//n*y+m*x-x*y*2=s
		//(n-2*x)*y=s-m*x
		int rhs=s-m*x;
		int lhs=n-2*x;
		if (lhs==0 && rhs!=0) continue;
		if (lhs==0 && rhs==0)
		{
			printf("Yes\n");
			return;
		}
		if (rhs%lhs!=0) continue;
		int y=rhs/lhs;
		if (y<0 || y>m) continue;
		printf("Yes\n");
		return;
	}
	printf("No\n");
}

int main()
{
	ios::sync_with_stdio(true);
	#ifndef ONLINE_JUDGE
		//freopen("b.in","r",stdin);
	#endif
	lemon();
	return 0;
}

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

vector<int> i2g;          // i2g[i] := アイテム i の所属するグループの番号
vector<vector<int>> g2i;  // g2i[g] := グループ g に所属するアイテムたち

void init(int n) {
	i2g.resize(n);
	g2i.resize(n);
	for (int i = 0; i < n; ++i) {
    // 最初はアイテム i はグループ i に所属
		i2g[i] = i;
		g2i[i].assign(1, i);
	}
}

ll all[100010];
ll ans[100010];
int N;
vector<pair<int,pii>> vec;

void merge(int ia, int ib, ll ct) {
	if (g2i[i2g[ia]].size() < g2i[i2g[ib]].size()) {
		swap(ia, ib);
	}

	int ga = i2g[ia], gb = i2g[ib];

	ll sa = g2i[ga].size(), sb = g2i[gb].size();
	for (int j : g2i[gb]) {
		i2g[j] = ga;
		ans[j] += all[gb];
		ans[j] -= (sb-sa) * ct;
		ans[j] -= all[ga];
	}

	all[ga] += sb * ct; 
	all[gb] = 0;

	g2i[ga].insert(g2i[ga].end(), g2i[gb].begin(), g2i[gb].end());
	g2i[gb].clear();
}

int main() {
	cin >> N;

	rep(i, N-1) {
		int a, b, c;
		cin >> a >> b >> c;
		--a; --b;
		vec.eb(c, mp(a, b));
	}

	sort(ALL(vec));
	reverse(ALL(vec));

	init(N);

	for (auto t:vec) {
		int a = t.se.fi, b = t.se.se, c = t.fi;
		merge(a, b, c);
	}

	rep(i, N) {
		cout << ans[i] + all[i2g[i]] << endl;
	}

	return 0;
}

Measured memory_bytes: 13928
// c++ -std=c++14 atcoder.cpp
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cmath>

using namespace std;

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

    int ans = 0;
    if (n >= 2) {
        ans += n*(n-1)/2;
    }
    if (m >= 2) {
        ans += m*(m-1)/2;
    }

    cout << ans << endl;
}


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

int main(){
    long long i,n,k;
    long long ans=0;
    cin >> n >> k;
    for(i=k;i<=n;i++){
        ans += (i*(n-i+1)+1)%1000000007;
        //cout << ans << " ";
        ans %= 1000000007;
    }
    ans += 1;
    ans %= 1000000007;
    cout << ans << endl;
    return 0;
}

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

typedef double du ;
typedef string st ;
typedef long long ll ;
typedef long double ld ;
typedef long long int lli ;

#define vi vector <lli>
#define loop(num) for (lli i = 0 ; i < num ; i ++ )
#define loopcin(num , ar ) for (lli i = 0 ; i < num ; i ++ ) {cin >> ar [i] ;}
#define loopcout(num , ar) for (lli i = 0 ; i < num ; i ++ ) {cout << ar [i] << ' '; }

#define forr(num1 , num2) for (lli i = num1 ; i < num2 ; i ++ )
#define forrcin(num1 , num2 , ar ) for (lli i = num1 ; i < num2 ; i ++ ) {cin >> ar [i] ;}
#define forrcout(num1 , num2 , ar) for (lli i = num1 ; i < num2 ; i ++ ) {cout << ar [i] << ' '; }

#define D2forrcin(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cin >> A[i][j] ;}}
#define D2forrcout(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cout << A[i][j] << ' ' ;}cout << endl ;}

#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

#define F first
#define S second

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main ()
{
    fastio
    lli r , g , b ;
    cin >> r >> g >> b ;
    ((r * 100 + g * 10 + b) % 4 ? NO : YES ) ;

    return 0 ;
}

/*___________________________________________________________________functions___________________________________________________________________________*/



Measured memory_bytes: 256
n=int(input())
s=list(map(int,input().split()))
l=[]
c=0
for i in range(n):
    while True:
        if s[i]%2==0:
            c+=1
            s[i]=s[i]//2
        else:
            l.append(c)
            c=0
            break
print(min(l))

Measured memory_bytes: 3060
#B
N = int(input())
A = list(map(int, input().split()))

A_sum = sum(A)
a_half = 0
for ai in A:
    a_half_next = a_half + ai
    if a_half_next >= A_sum / 2:
        break
    a_half = a_half_next
    
a_half_dif =  abs((A_sum - a_half) - a_half)
a_half_next_dif = abs((A_sum - a_half_next) - a_half_next)
if a_half_next_dif <= a_half_dif:
    a_half_dif = a_half_next_dif

    
print(a_half_dif)

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

int main() {
    int n{};
    int l{};
    std::cin >> n >> l;
    std::vector<int> a;
    a.reserve(n);
    for (int i = 0; i < n; ++i)
        a.emplace_back(l + i);
    int t = a[0];
    int v = t;
    for (int i = 1; i < n; ++i) {
        if(std::abs(a[i]) < std::abs(v))
            v = a[i];
        t += a[i];
    }
    std::cout << t - v << std::endl;
    return 0;
}

Measured memory_bytes: 256
while True:
    try:
        s = input().strip()
    except:
        break
    i = 0
    cnt_joi, cnt_ioi = 0, 0
    while i < len(s) - 2:
        t = s[i:i + 3]
        if t == 'JOI':
            cnt_joi += 1
            i += 2
        elif t == 'IOI':
            cnt_ioi += 1
            i += 2
        elif t[2] == 'O':
            i += 1
        elif t[2] in 'IJ':
            i += 2
        else:
            i += 3
    print(cnt_joi)
    print(cnt_ioi)

Measured memory_bytes: 7376
/**
 * @author      : omgursocute
 * @created     : 14/02/2020
 * @task        : D
 */

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int dp[10][10];

int f(int n) {
	string s = to_string(n);
	return s[0] - '0';
}

int main() {
	// freopen("D.inp", "r", stdin);
	// freopen("D.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	
	int n;
	cin >> n;

	for(int i = 1; i <= n; i++) {
		int a = f(i);
		int b = i % 10;
		++dp[a][b];
	}

	ll res = 0;
	for(int i = 1; i <= n; i++) {
		int a = f(i);
		int b = i % 10;
		res += 1LL*dp[b][a];
	}

	cout << res;

	return 0;
}



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

#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

string s;
int K;
vector<int> v[26];

int main() {
  cin >> s;
  cin >> K;
  
  int N = s.size();
  set<string> sset;
  for (int i = 0; i < N; ++i) {
    if (i+5 <= N) {
      sset.insert(s.substr(i, 5));
    } else {
      sset.insert(s.substr(i));
    }
  }

  set<string> sset2;
  int t = 0;
  for (auto ite = sset.begin(); ite != sset.end() && t < 5; ++ite) {
    string st = *ite;
    for (int i = 1; i <= st.size(); ++i) {
     sset2.insert(st.substr(0, i));
    }
    ++t;
  }

  --K;
  auto ite2 = sset2.begin();
  for (int i = 0; i < K; ++i) {
    ++ite2;
  }

  string ans = *ite2;
  cout << ans << endl;

  return 0;
}


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

int main() {
string s;
  cin >> s;
  int price = 700;
  if(s.at(0) == 'o') price += 100;
  if(s.at(1) == 'o') price += 100;
  if(s.at(2) == 'o') price += 100;
  cout << price << endl;
}


Measured memory_bytes: 256
n=int(input())
alist=list(map(int, input().split()))
blist=list(map(int, input().split()))
clist=list(map(int, input().split()))
alist.sort()
blist.sort()
clist.sort()
import bisect
ans=0
for b in blist:
  num1=n-bisect.bisect(clist,b)
  num2=bisect.bisect_left(alist,b)
  ans+=num1*num2
print(ans)

Measured memory_bytes: 29636
A,B,C,K = map(int, input().split())

S = A+B+C
result = 0

if ( K > (A+B) ):
    result = A*(1) + (K-(A+B))*(-1)
elif ( (A+B) >= K >= A):
    result = A*(1)
elif ( A > K ):
    result = K*(1)

print(result)


Measured memory_bytes: 9124
// AOJ 2767: AddMul
// 2017.10.10 bal4u@uu

#include <stdio.h>

char s[500];
int f['z'+1];
int c[10];

int main()
{
	int n, i, term, ans;
	char *p;

	scanf("%d%s", &n, s);
	p = s; while (*p) f[*p]++, p+=2;
	for (i = 'a'; i <= 'z'; i++) c[f[i]]++;

	ans = term = c[1];
	for (i = 2; i < 10; i++) {
		if      (c[i] == 1) ans += 3, term++;
		else if (c[i] >  1) ans += 2*c[i]+3, term++;
	}
	printf("%d\n", ans + term - 1);
	return 0;
}

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


int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<setprecision(30)<<fixed;
	
	int n;
	cin>>n;
	string s;
	cin>>s;
	int c=0,c1=0;;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='R')
			c1++;
	}
	for(int i=0;i<c1;i++)
	{
		if(s[i]=='W')
			c++;
	}
	cout<<c<<endl;
	return 0;
}





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

int a[10];

int main()
{
    char a,b;
    cin>>a>>b;
    if(a==b)
        cout<<"=";
    else if(a>b)
        cout<<">";
    else 
        cout<<"<";
    
}


Measured memory_bytes: 3592