akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	string s;
	cin>>s;
	int dsum=0;

	for(int i=0;i<s.size();i++){
		dsum+=(s[i]-'0');
		dsum%=3;
	}
	dsum%=3;
	cout<<(dsum==0 ? "Yes\n":"No\n");

	return 0;
}

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

int n, c, a[6];
long long f[1 << 5][1 << 5][305];

int main() {
  scanf("%d%d", &n, &c);
  c *= n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i] *= n;
  }
  sort(a, a + n);
  f[0][0][a[n - 1]] = 1;
  long long ans = 0, all = 1;
  for (int x = 1; x < c; x++) if (x % n) {
    for (int l = x + 1; l <= c; l++) {
      for (int i = 0; i < 1 << n - 1; i++) if (!(i >> (x % n - 1) & 1)) {
        for (int j = 0; j < 1 << n - 1; j++) if (f[i][j][l]) {
          for (int y = 0; y < n - 1; y++) if (!(j >> y & 1)) {
            f[i | 1 << (x % n - 1)][j | 1 << y][min(c, max(x + a[y], l))] += f[i][j][l];
          }
        }
      }
    }
  }
  ans = f[(1 << n - 1) - 1][(1 << n - 1) - 1][c];
  for (int i = 1; i < n; i++) {
    all *= i * c / n;
  }
  printf("%.13Lf\n", (long double) ans / all);
}



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

long long gcd(long long m, long long n)
{
  if (!n)
    return m;
  return gcd(n, m % n);
}

int main(void)
{
  int a, b, c;
  cin >> a >> b >> c;
  cout << ((c % gcd(a, b) == 0) ? "YES" : "NO") << endl;
  return 0;
}


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

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  while(a > 0 && c > 0){
    c -= b;
    a -= d;
  }
  if(c <= 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
typedef long long ll;
const int mod = 1e9 + 7;
int main() {

    ll x;
    cin >> x;

    ll ans = x / 11;

    if(x <= ans*11){
        ans *= 2;
    }
    else if(x <= ans*11 + 6){
        ans = ans*2 + 1; 
    }
    else{
        ans = (ans + 1) * 2;
    }
    
    cout << ans << endl;

    return 0;
}

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

#define MAXN 100000

vector<vector<int>> g(MAXN);
ll dp[MAXN+1][2];
bool used[MAXN+1];
ll f(int node, int parent){
  if(used[node])return dp[node][0] + dp[node][1];
  used[node]=true;

  ll c0=1, c1=1;
  for(auto to:g[node]){
    if(to==parent)continue;
    c0*=f(to, node);
    c1*=dp[to][0];
    c0 %= MOD;
    c1 %= MOD;
  }
  dp[node][0]=c0;
  dp[node][1]=c1;
  return (c0+c1)%MOD;
}

int main(){
  int n;cin>>n;
  rep(i, n-1){
    int x,y; cin>>x>>y; x--,y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }

  cout<<f(0, -1)<<endl;

  return 0;
}

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

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

int main(){
  int a, b, c, d;
  int t;
  cin >> a >> b >> c >> d;
  if(a<=b){
    t+=a;
  }
  else if(a>b){
    t+=b;
  }
  if(c<=d){
    t+=c;
  }
  else if(c>d){
    t+=d;
  }
  cout << t << endl;
  return 0;
}

Measured memory_bytes: 256
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format, std.datetime;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] lreads(T = long)(long n){return generate(()=>readln.chomp.to!T()).take(n).array();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long H, W, K;
    scan(H, W, K);
    auto S = new string[](H);
    foreach (i; 0 .. H)
        S[i] = sread();
    long ans = long.max;
    loop_split_row: foreach (uint split_row; 0 .. 1 << (H - 1))
    {
        long cnt = popcnt(split_row);
        long row = cnt + 1;
        auto sum = new long[][](row, W);
        loop_w: foreach (i; 0 .. W)
        {
            long j;
            foreach (k; 0 .. H)
            {
                // writefln("%010b %s %s", split_row & (1 << k), j, k);
                sum[j][i] += S[k][i] - '0';
                j += ((split_row & (1 << k)) != 0);
            }
            if (i == 0)
                continue loop_w;
            foreach (k; 0 .. row)
                if (K < sum[k][i])
                    continue loop_split_row;
            foreach (k; 0 .. row)
                if (K < sum[k][i] + sum[k][i - 1])
                {
                    // writeln(i);
                    cnt++;
                    continue loop_w;
                }
            foreach (k; 0 .. row)
                sum[k][i] += sum[k][i - 1];
        }
        // writefln("%010b %s %s", split_row, sum, cnt);
        ans = ans.min(cnt);
    }
    writeln(ans);
}


Measured memory_bytes: 4348
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;


vector<vector<ll>> edge;

ll dfs(ll w,ll p){
    ll ret=0;
    for(auto &I:edge[w]){
        if(I!=p){ret^=dfs(I,w)+1;}
    }
    return ret;
}



int main(){
    ll n;
    cin>>n;
    edge.resize(n);
    for(int i=1;i<n;i++){
        ll x,y;
        cin>>x>>y;
        x--; y--;
        edge[x].push_back(y);
        edge[y].push_back(x);
    }
    cout<<(dfs(0,-1)==0?"Bob":"Alice")<<endl;
    
    
    return 0;
}


Measured memory_bytes: 10368
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]

for i, (ai, bi) in enumerate(ab):
    ans = 0
    dist_min = 1000000007
    for j, (cj, dj) in enumerate(cd):
        dist_tmp = abs(ai - cj) + abs(bi - dj)
        if dist_min > dist_tmp:
            ans = j + 1
            dist_min = dist_tmp
    #
    print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define int 			long long int
#define ld 				long double
#define ff 				first
#define ss 				second
#define P 				pair<int,int>
#define pb 				push_back
#define mod             1000000007
#define inf             1e18
#define endl			'\n'
const int N = 4e3 + 5; //change it when needed
int n;
int a[N], pre[N];
int dp[N][N];
int F(int i, int j) {
	if (i == j)
		return 0;
	int &ans = dp[i][j];
	if (ans != -1)return ans;
	ans = 1e18;
	for (int k = i; k < j; k++) {
		ans = min(ans, F(i, k) + F(k + 1, j) + pre[j] - pre[i - 1]);
	}
	return ans;
}
void solve() {
	cin >> n;
	pre[0] = 0;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		pre[i] = pre[i - 1] + a[i];
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++)
			dp[i][j] = -1;
	}
	cout << F(1, n);
}

int32_t main()
{
	ios_base:: sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	// int t; cin >> t; while (t--)
	solve();
	return 0;
}

Measured memory_bytes: 125568
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // 宣言
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = -1;
        
        // 処理
        if(a >= 10 || b >= 10){
            System.out.println(ans);            
        }else{
            ans = a * b;
            System.out.println(ans);            
        }
    }
}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
double a[200004];
int main(void)
{
	int i,n,k;
	scanf("%d%d",&n,&k);
	for(i=0;i<n;i++)
	{
		int p;
		scanf("%d",&p);
		a[i]=(double)((p*1.0+1)/2);
	}
	double sum=0,summax=0;
	for(i=0;i<k;i++)
	{
		sum+=a[i];
	}
	summax=sum;
//	for(i=0;i<n;i++)
//	{
//		printf("%f ",a[i]);
//	}
	for(i=0;i+k<n;i++)
	{
		sum=sum-a[i]+a[i+k];
		summax=max(sum,summax);
	}
	printf("%f",summax);
}

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

using namespace std;
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

#ifdef _LOCAL
struct Tester {
    Tester() { freopen("sample.in", "r", stdin); }
    ~Tester() { fprintf(stderr, "\nTime: %d ms\n", int(1000.0 * clock() / CLOCKS_PER_SEC)); }
} _tester;
#endif

const int INF = 0x3F3F3F3F;
const LL INFLL = 0x3F3F3F3F3F3F3F3FLL;
const int N = 1e5 + 10;
const int Q = 1e5 + 10;

unordered_map<string, int> mp;
string a[N];

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        sort(a[i].begin(), a[i].end());
        ++mp[a[i]];
    }
    LL ans = 0;
    for (auto it = mp.begin(); it != mp.end(); ++it) {
        ans += 1LL * it->second * (it->second - 1) / 2;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 17700
#include<stdio.h>

int sub(int n);

int main(void){
	int i,n,data[10],p;
	while(scanf("%d",&n)!=EOF){
		for(i=0;i<10;i++)data[i]=0;
		i=9;p=0;
		while(n!=0){
			if(n>=sub(i)){n=n-sub(i);data[p]=sub(i);p++;}
			i--;
		}
/*		printf("%d",data[p]);*/
		p--;printf("%d",data[p]);
		while(p!=0){p--;printf(" %d",data[p]);}
		printf("\n");
	}
	return 0;
}

int sub(int n){
	int i,s=1;
	for(i=0;i<n;i++)s=s*2;
	return s;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N, ave=0;
  cin >> N;
  vector<int> a(N);
  
  for(int i=0; i<N; i++){
    cin >> a.at(i);
  }
  for(int i=0; i<N; i++){
    ave += a.at(i);
  }
  ave /= N;
  int j, m, M, cost=0, tmp=0;
  m = max(ave-2, -100);
  M = min(ave+2, 100);
  j=m;
  for(int i=0; i<N; i++){
    cost += (ave - a.at(i))*(ave - a.at(i));
  }
  
 
  
  while(j <= M){
    for(int i=0; i<N; i++){
      tmp += (j - a.at(i))*(j - a.at(i));
    }
    if(tmp < cost){
      cost = tmp;
    }
    j++;
    tmp = 0;
  }
  
  
  cout << cost << endl;
}


Measured memory_bytes: 256
// Give me My Shotgun

#include <bits/stdc++.h>
using namespace std ;

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

#define PB push_back
#define F first
#define S second
#define _sz(x) (int)x.size()

#define debug(x) cerr << #x << " = " << x << endl

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

const int MAX_N = -1 ;
const int inf = 2e9 + 19 ;

ll n , k , r , p , s ;
string T , S ;

int main() {
        ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;
        cin >> n >> k ;
        cin >> r >> s >> p ;
        cin >> T ;
        ll ans = 0 ;
        string tmp = "x" ;
        for (int i = 0 ; i < n ; i ++)
                S += tmp ;
        for (int i = 0 ; i < k ; i ++) {
                if (T[i] == 'r')
                        S[i] = 'p' , ans += p ;
                if (T[i] == 'p')
                        S[i] = 's' , ans += s ;
                if (T[i] == 's')
                        S[i] = 'r' , ans += r ;
        }
        for (int i = k ; i < n ; i ++) {
                if (T[i] == 'r')
                        if (S[i - k] !='p')
                                ans += p , S[i] = 'p' ;
                if (T[i] == 's')
                        if (S[i - k] != 'r')
                                ans += r , S[i] = 'r' ;
                if (T[i] == 'p')
                        if (S[i - k] != 's')
                                ans += s , S[i] = 's' ;
        }
        cout << ans ;
        return (0) ;
}


Measured memory_bytes: 640
#include <iostream>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main(void)
{
	int dx[4] = { -1,0,1,0 };
	int dy[4] = { 0,-1,0,1 };
	int tate, yoko;
	cin >> tate >> yoko;
	vector<vector<char>>arr(yoko, vector<char>(tate));
	for (int i = 0; i < tate; i++)
	{
		string aaa; cin >> aaa;
		for (int j = 0; j < yoko; j++)
		{
			arr[j][i] = aaa[j];
		}
	}
	for (int i = 0; i < tate; i++)
	{
		for (int j = 0; j < yoko ; j++)
		{
			if (arr[j][i] == '#')
			{
				for (int ll = 0; ll < 4; ll++)
				{
					if (j + dx[ll] >= 0 && j + dx[ll] < yoko && i + dy[ll] >= 0 && i + dy[ll] < tate)
					{
						if (arr[j + dx[ll]][i + dy[ll]] == '#')
						{
							break;
						}
						if (ll == 3)
						{
							cout << "No" << "\n";
							return 0;
						}
					}
				}
			}
		}
	}
	cout << "Yes" << "\n";
}



Measured memory_bytes: 256
N = gets.chomp.to_i
num_arr = gets.chomp.split(" ").map(&:to_i)

new_arr = []

num_arr.each do |n|
  new_arr << 1/n.to_f
end

sum = 0
new_arr.each do |n|
  sum += n
end

p 1/sum

Measured memory_bytes: 3836
import sys
input = sys.stdin.readline

mod = 998244353


def cmb(n, r, mod=mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

NN = 10**5 # 使うデータによって変える
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, NN + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


K, N = map(int, input().split())
for i in range(2, 2*K+1):
    if i%2 == 1:
        p = min(i//2, (2*K-i+1)//2)
        ans = 0
        t = 1
        for c in range(min(N,p)+1):
            ans = (ans + cmb(K+N-2*p-1, N-c) * cmb(p, c) * t) % mod
            t = t * 2 % mod
        print(ans)
    else:
        p = min(i//2-1, (2*K-i)//2)
        ans = 0
        t = 1
        for c in range(min(N,p)+1):
            ans = (ans + (cmb(K+N-2*p-3, N-c-1) + cmb(K+N-2*p-2, N-c)) * cmb(p, c) * t) % mod
            t = t * 2 % mod
        print(ans)

Measured memory_bytes: 64648
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int cnt[200010];
int main() {
	int n; cin >> n;
	for(int i = 2; i <= n; ++i) {
		int a; cin >> a;
		cnt[a]++;
	}
	for(int i = 1; i <= n; ++i) {
		cout << cnt[i] << '\n';
	}
	return 0;
}

Measured memory_bytes: 4348
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main(){
  int *A, *B;

  int C[VMAX+1];
  int n, i, j;
  scanf("%d", &n);

  A = malloc(sizeof(int)*n+1);
  B = malloc(sizeof(int)*n+1);

  for ( i = 0; i <= VMAX; i++ ) C[i] = 0;

  for ( i = 0; i < n; i++ ){
    scanf("%d", &A[i + 1]);
    C[A[i + 1]]++;
  }

  for ( i = 1; i <= VMAX; i++ ) C[i] = C[i] + C[i - 1];

  for ( j = 1; j <= n; j++ ){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }

  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", B[i]);
  }
  printf("\n");

  return 0;
}


Measured memory_bytes: 17388
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef unsigned long long u64;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector< u64 > a;
  int flg[n];
  int cnt=0;
  for (int i = 0; i < n; ++i) {
    u64 ai;
    cin >> ai;
    if (ai >= k) {
      continue;
    }
    a.push_back(ai);
    flg[cnt] = 0;
    cnt++;
  }
  n  = a.size();
  if (n == 0) {
    cout << 0 << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  int tgt = n/2, bottom = 0, top = n-1;
  while (true) {
    if ((tgt < n-1 && flg[tgt] == -1 && flg[tgt+1] == 1) || (tgt == n-1 && flg[tgt] == -1) || (tgt == 0 && flg[tgt] == 1)) {
      break;
    }
    if (flg[tgt] != 0) {
      if (tgt == n-1 || flg[tgt+1] != 0) {
        tgt--;
        continue;
      } else {
        tgt++;
        continue;
      }
    }
    if (flg[tgt] == 0){
      bool m[k];
      for (int i = 0; i < k; ++i) {
        m[i] = false;
      }
      m[0] = true;
      for (int i = 0; i < n; ++i) {
        if (i == tgt) {
          continue;
        }
        for (int j = k-a[i]-1; j >= 0; --j) {
          if (m[j]) {
            m[j+a[i]] = true;
          }
        }
      }
      bool ok = false;
      for (int i = k-a[tgt]; i < k; ++i) {
        if (m[i]) {
          ok = true;
          break;
        }
      }
      if (ok) {
        flg[tgt] = 1;
        tgt = (bottom+tgt)/2;
        top = tgt;
      } else {
        flg[tgt] = -1;
        tgt = (top+tgt)/2;
        bottom = tgt;
      }
    }
  }
  if (flg[0] == 1) {
    cout << 0 << endl;
  } else {
    for (int i = 0; i < n-1; ++i) {
      if (flg[i] == -1 && flg[i+1] == 1) {
        cout << i+1 << endl;
        return 0;
      }
    }
    cout << n << endl;
  }
  return 0;
}


Measured memory_bytes: 384
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
l=1
cnt=0
for i in range(N):
    if A[i]!=l:
        cnt+=1
    else:
        l+=1
if cnt==N:
    print(-1)
else:
    print(cnt)

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

using namespace std;

typedef long long          ll;
typedef unsigned long long ull;
typedef vector<int>	       vi;
typedef vector<bool>       vb;
typedef map<int, int>      mii;
typedef pair<int, int>     ii;

#define INF                0x3f3f3f3f
#define INFLL              0x3f3f3f3f3f3f3f3f
#define each(x, s)         for(auto& x : s)
#define loop(x)	           for(int i = 0;i < x;i++)
#define vloop(v, x)        for(int v = 0;v < x;v++)
#define avg(l, r)          l + (r - l) / 2
#define iter(a)            a.begin(), a.end()
#define riter(a)           a.rbegin(), a.rend()
#define endl               "\n"

const ll mod = 1000000007;

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

	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int x = (c + b - 1) / b, y = (a + d - 1) / d;
	cout << (x <= y ? "Yes" : "No") << endl;
	return 0;
}



Measured memory_bytes: 3636
using System;

class Rating{
  static void Main(){
      
      var input = Console.ReadLine().Split(' ');
      var times = int.Parse(input[0]);
      var pre_rate = int.Parse(input[1]);
      var rate = 0;
      
      if(times < 10){
          rate = pre_rate + (10 - times)* 100;  
      }else{
          rate = pre_rate ;
      }
      
      Console.WriteLine(rate);
  }
}

Measured memory_bytes: 11092
from sys import stdin, stdout

input = lambda: stdin.readline()
write = stdout.write

def main():
    N, K = map(int, input().split())
    X = tuple(map(int, input().split()))

    org = 0 - X[0]
    x = [0] * N
    for i, n in enumerate(X):
        x[i] = n + org

    ans = float('inf')
    for i in range(N - K + 1):
        dist = x[i+K-1] - x[i] + min(abs(org - x[i]), abs(x[i+K-1] - org))
        ans = min(ans, dist)
    print(ans)

main()


Measured memory_bytes: 14540
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define fst first
#define snd second
using ll = long long;
using I = pair<int, int>;

int main() {
  int A, B;
  while (cin >> A >> B) {
    int C = 16 - A - B;
    int mx = max(A, B), mn = min(A, B);
    bool res = (mn + C) >= mx;
    cout << (res ? "Yay!" : ":(") << endl;
  }
  return 0;
}


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

using namespace std;

#define FOR(i,n) for(int i=0; i<n; ++i)
#define FORR(i,a,n) for(int i=a; i<n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

const int INF = 0x3f3f3f3f;

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
 
//int in() { int x; scanf("%d", &x); return x; }
//ll lin() { ll x; scanf("%lld", &x); return x; }
//void printfv(VI a){ int n = a.size(); FOR(i, n) cout << a[i] << " "; }

int main(void){

    int n;
    cin >> n;

    set<string> st;
    FOR(i, n){
        string s;
        cin >> s;
        st.insert(s);
    }

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


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

// macro
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
void dep(int depth, string &u, int n, int bmax)
{
  if(depth==n)
  {
    cout<<u<<endl;
    return;
  }
  else
  {
    for(int i=0;i<=bmax+1;i++)
    {
      if(depth==0&&i>0)return;
      char pp='a'+i;
      u+=pp;
      dep(depth+1,u,n,max(i,bmax));
      u=u.substr(0,u.size()-1);
    }
  }
  
}

int main()
{
  int n;cin>>n;
  string uu="";
  dep(0,uu,n,0);
}


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

int main(){
  int n;
  cin >> n;
  int a[n], b[n];
  vector<int> ca(n+1), cb(n+1);
  rep(i,n) {
    cin >> a[i];
    ca[a[i]]++;
  }
  rep(i,n) {
    cin >> b[i];
    cb[b[i]]++;
  }
  set<P> st;
  vector<int> r;
  rep(i,n+1) {
    if(ca[i] and cb[i]) st.insert(P(ca[i],i));
    else if(cb[i]) rep(j,cb[i]) r.push_back(i);
  }
  int ans[n];
  rep(i,n) {
    if(ca[a[i]] and cb[a[i]]) st.erase(P(ca[a[i]],a[i]));
    if(st.size() == 0) {
      if(r.size() == 0) {
        cout << "No" << endl;
        return 0;
      }
      ans[i] = r.back();
      r.pop_back();
    } else {
      P p = *st.rbegin();
      st.erase(p);
      ans[i] = p.second;
      cb[p.second]--;
      if(cb[p.second]) st.insert(p); 
    }
    if(i < n and a[i+1] != a[i] and cb[a[i]] > 0) rep(j,cb[a[i]]) r.push_back(a[i]);
  } 
  cout << "Yes" << endl;
  rep(i,n) cout << ans[i] << " ";
  cout << endl;
  return 0;
}


Measured memory_bytes: 16364
def readinput():
    n=int(input())
    c=[0]
    s=[0]
    f=[0]
    for _ in range(1,n):
        l=list(map(int,input().split()))
        c.append(l[0])
        s.append(l[1])
        f.append(l[2])
    return n,c,s,f

def main(n,c,s,f):
    tList=[]
    t=[0]*(n+1)
    #print(s)
    #print(t)
    for e in range(1,n):
        t[e]=s[e]
        for i in range(e+1,n):
            t[i]=t[i-1]+c[i-1]
            if t[i]<=s[i]:
                t[i]=s[i]
            else:
                if t[i]%f[i]==0:
                    pass
                else:
                    t[i]=((t[i]//f[i])+1)*f[i]
        t[n]=t[n-1]+c[n-1]
        tList.append(t[n])
    tList.append(0)
    return tList

if __name__=='__main__':
    n,c,s,f=readinput()
    ans=main(n,c,s,f)
    for t in ans:
        print(t)


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

vector<vector<int>> G;
vector<int> preorder;
vector<int> low;
using P = pair<int,int>;

void lowlink(int v,int prev, int &pre, vector<P>& ans){
  preorder[v]=pre;
  low[v]=pre;
  for(auto to:G[v]){
    if(preorder[to]==-1){
      lowlink(to,v,++pre,ans);
      if(low[to]==preorder[to]){
        ans.emplace_back(min(v,to),max(v,to));
      }
      low[v]=min(low[v],low[to]);
    }else if(to!=prev){
      low[v]=min(low[v],preorder[to]);
    }
  }
}

int main(){
  int V,E;
  cin>>V>>E;
  G.resize(V);
  preorder.resize(V,-1);
  low.resize(V);

  for(int i=0;i<E;i++){
    int s,t;
    cin>>s>>t;
    G[s].push_back(t);
    G[t].push_back(s);
  }
  int p=1;
  vector<P> ans;
  lowlink(0,-1,p,ans);
  sort(ans.begin(), ans.end());
  for(auto a:ans){
    cout<<a.first<<' '<<a.second<<endl;
  }
  // for(int i=0;i<V;i++){
  //   cout<<i<<' '<<preorder[i]<<' '<<low[i]<<endl;
  // }
}


Measured memory_bytes: 4640
#include<bits/stdc++.h>
using namespace std;
int n;
long long int a[100005];
long long int x;
int main()
{
    scanf("%d %lld",&n,&x);
    for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);
    long long int meghans=0;
    for(int i=2;i<=n;i++)
    {
        if((a[i]+a[i-1])<=x)
            continue;
        long long int sum=a[i]+a[i-1];
        long long int ex=sum-x;
        meghans+=ex;
        if(a[i]<=ex)
        {
            ex-=a[i];
            a[i]=0;
            a[i-1]-=ex;
        }
        else
        {
            a[i]-=ex;
        }

    }
    printf("%lld\n",meghans);
    return 0;
}


Measured memory_bytes: 1024
X,Y,Z,K = map(int,input().split())

list_a = list(map(int,input().split()))
list_b = list(map(int,input().split()))
list_c = list(map(int,input().split()))

list_a.sort(reverse=True)
list_b.sort(reverse=True)
list_c.sort(reverse=True)

sum_ = []
for a in range(X):
    for b in range(Y):
        for c in range(Z):
            if (a+1)*(b+1)*(c+1) > K:
                break
            sum_.append(list_a[a]+list_b[b]+list_c[c])

sum_.sort(reverse=True)

for i in range(K):
    print(sum_[i])

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

#define sz(a) ((int)a.size())
#define forn(i,n) for(int i=0;i<(int)n;i++)
#define forse(i,s,e) for(int i=(int)s;i<(int)e;i++)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

using dbl=double;
using ll=long long;
using pii=pair<int, int>;
using pll=pair<ll, ll>;

dbl PI=3.141592653589793;


void solve(){
	int n;
	cin >> n;
	cout << (1000-n%1000)%1000;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); 
	int T=1;
//	cin >> T;
	for(int c=1;c<=T;c++){
		solve();
	}
}


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

int main() {
  int A, B, Ans, a, b, c, d;
  cin>>A>>B;
  Ans=0;
  
  for (int i=A; i<B+1; i++){
    a=i%10;
    b=i/10%10;
    c=i/1000%10;
    d=i/10000;
    if (a==d && b==c)
      Ans++;
  }
  cout<<Ans<<endl;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

void Main()
{
	int N;
  	cin >> N;
  	int low = N/1.08;
  	int high = (N+1)/1.08; 
  
  	rep3(i,low,high){
	  	if(N==(int)(i*1.08)){
          	cout << i << endl;
        	return;
        }	
    }
  	cout << ":(" << endl;
	return;
}

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

Measured memory_bytes: 256
#coding: UTF-8
N, A, B=map(int, input().split())
lis=list(map(int,input().split()))
#print(lis)
out=0
for i in range(0,N-1):
    d=(lis[i+1]-lis[i])*A
    if d < B:
        out=out+d
    else:
        out=out+B
print(out)

Measured memory_bytes: 14252
n,m=map(int,input().split())
A=[list(input()) for i in range(n)]
B=[list(input()) for j in range(m)]
c=0
flag2=0
for l in range(n-m+1):
    for t in range(n-m+1):
        for k in range(m):
            if A[t+k][l:l+m]==B[k]:
                c+=1
        if c==m:
            flag2=1
        c=0  
print('Yes' if flag2==1 else 'No')

Measured memory_bytes: 3064
x1,y1,x2,y2=map(int,input().split())
y3=y2 + (x2-x1)
x3=x2 - (y2-y1)

y4=y3 + (x3-x2)
x4=x3 -(y3-y2)
print("{} {} {} {}".format(x3,y3,x4,y4))

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main() {
  
  string sa,sb,sc;
  int len_a,len_b,len_c;
  char card;
  int ai=0,bi=0,ci=0;
  
  cin >> sa >> sb >> sc;
  
  len_a = sa.length();
  len_b = sb.length();
  len_c = sc.length();
  
  card = sa[0];
  
  while ( len_a >= 0 && len_b >= 0 && len_c >= 0 ) {
    if ( card == 'a' ) {
      len_a--;
      card = sa[ai];
      ai++;
    } else if ( card == 'b' ) {
      len_b--;
      card = sb[bi];
      bi++;
    } else {
      len_c--;
      card = sc[ci];
      ci++;
    }
  }
  
  if ( len_a < 0 ) cout << "A\n";
  else if ( len_b < 0 ) cout << "B\n";
  else cout << "C\n";
  
  return 0;
  
}


Measured memory_bytes: 256
N = int(input())
t = [0]*(N+1)
x = [0]*(N+1)
y = [0]*(N+1)
for i in range(N):
    t[i+1], x[i+1], y[i+1] = map(int, input().split())
for i in range(N):
    dt = t[i+1] - t[i] 
    dx = x[i+1] - x[i]
    dy = y[i+1] - y[i]
    if dx+dy > dt or (dt-dx-dy)%2!=0:
        print('No')
        break
    if i == N-1:
        print('Yes')

Measured memory_bytes: 11636
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
int N;
ll DP[101][4][4][4];
ll modpow4[101];

const char S[4] = {'A', 'C', 'G', 'T'};
/* 
  ngな文字列
  agc, acg, gac
  agxc, axgc
*/

int henkan(char c) {
  rep(i, 4) {
    if (S[i]==c) return i;
  }
  return -1;
}

ll dfs(int idx, char preprepre, char prepre, char pre) {
  if (idx == N) return 0;
  if (DP[idx][henkan(preprepre)][henkan(prepre)][henkan(pre)] > 0) return DP[idx][henkan(preprepre)][henkan(prepre)][henkan(pre)];
  ll ret = 0ll;
  rep(i, 4) {
    char now = S[i];
    if (preprepre == 'A') {
      if ((pre == 'G' || prepre == 'G') && now == 'C') {
        ret += modpow4[N-idx-1];
        continue;
      }
    }
    if (prepre=='A') {
      if ((pre == 'G' && now == 'C') || (pre == 'C' && now == 'G')) {
        ret += modpow4[N-idx-1];
        continue;
      }
    }
    if (prepre == 'G' && pre == 'A' && now == 'C') {
      ret += modpow4[N-idx-1];
      continue;
    }
    ret += dfs(idx+1, prepre, pre, now);
  }
  ret %= MOD;
  DP[idx][henkan(preprepre)][henkan(prepre)][henkan(pre)] = ret;
  return ret;
}

// DP[idx][4] // idx文字目がa,g,c,tで大丈夫な場合の和
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  cin >> N;
  ll ans = 1ll;
  rep(i, N+1) {
    ans %= MOD;
    modpow4[i] = ans;
    ans*=4ll;
  }
  ll ret = dfs(0, 'T', 'T', 'T');
  cout << (modpow4[N] + MOD - ret) % MOD<< endl;
  return 0;
}

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

int main() {
	
	int n,s[10],sum = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	sort(s, s + n);
	for (int i = 0; i < n - 1; i++)	{
		sum += s[i];
	}

	if (sum <= s[n - 1]) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
//ABC154C
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;

int main(){
	int n;
	cin >> n;
	set<long long int> x;
	for(int i=0;i<n;i++){
		long long int a;
		cin >> a;
		x.insert(a);
	}
	if(x.size() == n){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 9600
#include<bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<ll,ll> pi;

int main(){
    char ar[7];
    scanf(" %s",ar);
    if(ar[2] == ar[3] && ar[4] == ar[5]) puts("Yes");
    else puts("No");
    return 0;
}


Measured memory_bytes: 256
N, T = map(int, input().split())
c = []
t = []
ans = 10 ** 9
for _ in range(N):
  c_i, t_i = map(int, input().split())
  c.append(c_i)
  t.append(t_i)
for i in range(N):
  if t[i] <= T:
    ans = min(ans, c[i])
if ans == 10 ** 9:
  ans = 'TLE'
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  bool flag = true;
  
  rep(i, n) {
    if (a[i] % 2 == 0) {
      if (!((a[i] % 3 == 0) || (a[i] % 5 == 0))) {
        flag = false;
        break;
      }
    }
  }
  
  if (flag) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define MD 1000000007
#define INF 1ll<<60
typedef pair<ll, ll> P;
template <typename T>
std::string tostr(const T &t){std::ostringstream os;os << t;return os.str();}
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};

//掛け算
ll mul(ll a,ll b){
    return ((a%MD)*(b%MD)) % MD;
}

//累乗・指数乗(aのb乗)
ll power(ll a,ll b){
    if(b==0){
        return 1;
    }else if(b==1){
        return a % MD;
    }else if(b%2==0){
        return power(a*a%MD,b/2) % MD;
    }else{
        return a*power(a,b-1)%MD;
    }
}

//割り算
ll wal(ll a,ll b){
    return mul(a,power(b,MD-2));
}

//計算量O(r)
ll nCr(ll n,ll r){
    if(r>n) return 0;
    if(mul(r,2)>n) r=n-r;
    if(r==0) return 1;
    ll ans=n;
    for(ll i=2;i<=r;i++){
        ans=mul(ans,n-i+1);
        ans=wal(ans,i);
    }
    return ans;
}

int main(){
    ll n,k;
    cin>>n>>k;
    for(int i=1;i<=k;i++) cout<<mul(nCr(n-k+1,i),nCr(k-1,i-1))<<endl;
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

int main(){

    int i,j,x[10000],y[10000];
     i=1;
    
    while(1){
	  
	  scanf("%d",&x[i]);
	  scanf("%d",&y[i]);
      if ((x[i]==0)&&(y[i]==0)) break;
      if (x[i]>y[i]) {
		  j=x[i];
		  x[i]=y[i];
		  y[i]=j;
	  }
      ++i;
    }	  
     
       for (j=1;j<i;++j){
	 	printf("%d %d\n",x[j],y[j]);
	  }
		
	return 0;
}

Measured memory_bytes: 628
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m;i<n;i++)
#define fix(n) cout<<fixed<<setprecision(n)
#define co(n) cout<<n<<endl
#define all(n) (n).begin(),(n).end()
using namespace std;
typedef long long ll;
const ll mod=1000000007;
double pi=3.1415926535;

int main(){
  int n,a,b,c;
  string s;
  cin>>s>>n;
  for(int i=0; i<s.size(); i+=n) cout<<s[i];

  return 0;
}

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


int main()
{
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
   int s;cin>>s;
   vector<int>dp(s+1);
   dp[0]=1;
   dp[3]=1;
   for(int i=4;i<=s;i++)
   {
   	for(int j=3;j<=s;j++)
   	{
   		if(i>=j)
   		{
   			dp[i]=(dp[i]+dp[i-j])%m;

   		}
   		
   	}
   }
   cout<<dp[s];
  


   

}

   	
   	


	
	

	




Measured memory_bytes: 3580
/***** TheAnshul *****/

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll int,ll int>
#define msi         map<string,ll int>
#define mis         map<ll int, string>
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define mpi         map<pair<ll int,ll int>,ll int>
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define vii         vector<pair<ll int, ll int>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;
#define N  100005
ll dp[105][N],a[105],v[105],w,n;
void solve()
{
	cin>>n>>w;
	rep(i,1,w+1)
	dp[0][i]=0;
	rep(i,1,n+1)
	{
		cin>>v[i]>>a[i];
	}
	rep(i,1,n+1)
	{
		ll vl=0;
		rep(j,0,w+1)
		{
			if(j<v[i])
				dp[i][j]=max(vl,dp[i-1][j]);
			else
				dp[i][j]=max(vl,max(dp[i-1][j-v[i]]+a[i],dp[i-1][j]));
			vl=dp[i][j];
		}
	}
	// rep(i,0,n+1)
	// {
	// 	rep(j,0,w+1)
	// 	{
	// 		cout<<dp[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }
	cout<<dp[n][w];
	return;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		solve();
	}
	time
	return 0;
}

Measured memory_bytes: 80128
#include <iostream>
#include <map>
#include <cstring>
using namespace std;

typedef long long ll;
const ll mod = 1e9 + 7;
string sam = "ACGT";
map<string,ll> dp;
ll n;

bool contain(string s) {
  if(s.substr(0,3) == "AGC") return true;
  if(s.substr(1,3) == "AGC") return true;
  return false;
}

string add(string s, char c) {
  string res = s + c;
  if(contain(res)) return "";

  for(int i = 0; i < 3; i++) {
    string tmp = res;
    swap(tmp[i],tmp[i+1]);
    if(contain(tmp)) return "";
  }
  return res.substr(1);
}

  
int main() {
  cin >> n;
  dp["###"] = 1;

  for(int i = 0; i < n; i++) {
    map<string,ll> tmp;
    for(auto itr = dp.begin(); itr != dp.end(); ++itr) {
      string nxt;
      for(int j = 0; j < sam.size(); j++) {
	nxt = add(itr->first,sam[j]);
	if(nxt != "") {
	  tmp[nxt] += itr->second;
	  tmp[nxt] %= mod;
	}
      }
    }
    /* for(auto itr = tmp.begin(); itr != tmp.end(); ++itr) {
      dp[itr->first] = itr->second;
      }*/swap(dp,tmp);
  }

  ll ans = 0;
  for(auto tr = dp.begin(); tr != dp.end(); ++tr) {
    if(tr->first[0] == '#' || tr->first[1] == '#' || tr->first[2] == '#') continue;
    //   cout << tr->first <<"   "<< tr->second<<endl;
    ans += tr->second;
    ans %= mod;
  }
  cout << ans << endl;
}
	
  


Measured memory_bytes: 256
import sys
w=input()
w_unique=list(set(w))
#count=[0 for i in range(25)]
#print(count)				
count={i:0 for i in w_unique}
if len(w)%2 != 0:
  print("No")
  sys.exit()

for i in w:
  count[i]+=1

  
for i in w_unique:
  if count[i]%2 != 0:
    print("No")
    sys.exit()
print("Yes")






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

#define pii pair<int,int> 

const int maxn=100010;
const int maxc=1000010;
const int maxm=200010;
const int maxn2=600010;

int N,M;
vector<pii> e[maxn];
vector<int> allc[maxc];
int used[maxn];
int stp[maxc];
vector<int> re[maxn2];
int dist[maxn2];

int Q[maxn2];

main()
{
	ios::sync_with_stdio(false);
	
	cin>>N>>M;
	for(int i=0,u,v,c;i<M;i++)
	{
		cin>>u>>v>>c; u--; v--;
		e[u].push_back({c,v});
		e[v].push_back({c,u});
		allc[c].push_back(u);
		allc[c].push_back(v);
	}
	for(int i=0;i<N;i++)
	{
		sort(e[i].begin(),e[i].end());
	}
	memset(used,-1,sizeof(used));
	int vid=N;
	for(int c=0;c<maxc;c++)
	{
		for(int i=0;i<allc[c].size();i++)
		{
			int& pos=allc[c][i];
			if(used[pos]==c) continue;
			
			int bg=0,en=0;
			Q[en++]=pos;
			used[pos]=c;
			while(bg<en)
			{
				for(int k=stp[Q[bg]];k<e[Q[bg]].size();k++)
				{
					pii& to=e[Q[bg]][k];
					if(to.first==c)
					{
						if(used[to.second]!=c)
						{
							Q[en++]=to.second;
							used[to.second]=c;
						}
						stp[Q[bg]]++;
					}
					else break;
				}
				bg++;
			}
			for(int k=0;k<en;k++)
			{
				re[Q[k]].push_back(vid);
				re[vid].push_back(Q[k]);
			}
			vid++;
		}
	}
	
//	for(int i=0;i<vid;i++)
//	{
//		cout<<i<<" : ";
//		for(auto j:re[i]) cout<<j<<" ";
//		cout<<endl;
//	}
	
	memset(dist,-1,sizeof(dist));
	int bg=0,en=0;
	Q[en++]=0;
	dist[0]=0;
	while(bg<en)
	{
		for(auto to:re[Q[bg]])
		{
			if(dist[to]==-1)
			{
				dist[to]=dist[Q[bg]]+1;
				Q[en++]=to;
			}
		}
		bg++;
	}
	if(dist[N-1]==-1) cout<<"-1"<<endl;
	else cout<<dist[N-1]/2<<endl;
}






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

using namespace std;


int main() {
    int n,m;
    long long mod=1000000007;
    cin>>n>>m;
    long long count=1;
    if(abs(n-m)>=2){
        cout<<0<<endl;
        return 0;
    }
    if(n==m){
        for (int i = 1; i < n+1; ++i) {
            count = count * i % mod;
            count=count *i %mod;
        }
        cout<<count*2%mod<<endl;
        return 0;
    }
    else{
        for (int i = 1; i <= n;i++){
            count= count*i%mod;
        }
        for (int j = 1; j <= m; ++j) {
            count= count*j%mod;
        }
        cout<<count<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
bool is[10010];

int main(){
  for(int i = 0; i < 10010; i++) is[i] = true;
  is[0]=is[1]=false;
  for(int i = 2; i < 10010; i++){
    if(is[i]){
      for(int j = 2; j*i < 10010; j++){
	is[j*i]=false;
      }
    }
  }
  int n,i;
  while(1){
    cin >> n;
    if(n == 0)break;
    for(i = n; i > 2; i--){
      if(is[i] && is[i-2]) break;
    } 
    cout << i-2 << " " << i << endl;
  }
  return 0;
}

Measured memory_bytes: 1168
N, K = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)

for i in range(N-1):
  if a[i] >= K:
    a[i] = K
    a[i+1] = 0
  else:
    a[i+1] = min(a[i+1], K - a[i])

print(s - sum(a))


Measured memory_bytes: 63856
tmp = [int(i) for i in input().split()]
H, W = tmp[0], tmp[1]

matrix = [[0 for i in range(W+2)] for j in range(H+2)]
real = [input().split() for _ in range(H)]
tmp = []

for rs in real:
  for r in rs:
    tmp.append([1 if l == '#' else 0 for l in r])

for i in range(H):
    for j in range(W):
        matrix[i+1][j+1] = tmp[i][j]
tmp = [[0 for i in range(W)] for j in range(H)]

for i in range(1, H+1):
    for j in range(1, W+1):
        if not matrix[i][j] == 1:
            tmp[i-1][j-1] = (sum(matrix[i-1][j-1:j+2]) + matrix[i][j-1] + matrix[i][j+1] + matrix[i+1][j] + matrix[i+1][j-1] + matrix[i+1][j+1])
for i in range(1, H+1):
    for j in range(1, W+1):
        if matrix[i][j] == 1:
            tmp[i-1][j-1] = '#'
        else:
            tmp[i-1][j-1] = str(tmp[i-1][j-1])
for t in tmp:
    mojiretsu = ""
    for i in t:
        mojiretsu += i
    print(mojiretsu)

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

int main() {
  string t;
  cin >> t;
  int s=t.size();
  for(int i=0;i<s;i++){
    if(t.at(i)=='?')
    t.at(i)='D';
  }
  cout << t << endl;
}


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

using namespace std;

typedef pair< long long, long long > P;
typedef pair< long long, P > PP;
typedef pair< P, P > PPP;

const long long MOD = 1e9 + 7;
const long long  INF = 5e18;
const double DINF = 5e14;
const double eps = 1e-10;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };

#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second

int q, c, a, n;

int main() {
	cin >> q;
	while (q) {//CCA CCC CAN
		q--;
		int ans = 0;
		cin >> c >> a >> n;
		for (int i = 0;i <= n;i++) {
			int cc = c - i, aa = a - i;
			if (cc < 0 || aa < 0)continue;
			for (int j = 0;j <= aa;j++) {
				int ccc = cc - j * 2;
				if (ccc < 0)continue;
				ans = max(ans, i + j + ccc / 3);
			}
		}
		cout << ans << endl;
	}
	return 0;
}




Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
int main(){
  int D;
  cin >> D;
  if (D==22){
    cout << "Christmas Eve Eve Eve";
  } else if (D==23){
    cout << "Christmas Eve Eve";
  } else if (D==24){
    cout << "Christmas Eve";
  } else {
    cout << "Christmas";
  }
}

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

int main() {
    long H,W;
    cin>>H>>W;
    
    vector<string> S(H);
    for(int i=0;i<H;i++) cin>>S.at(i);
    
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(S.at(i).at(j)=='#') cout<<"#";
            else{
                long count=0;
                for(int x=-1;x<2;x++){
                    for(int y=-1;y<2;y++){
                        count+=(0<=i+x && i+x<H && 0<=j+y && j+y<W && S.at(i+x).at(j+y)=='#');
                    }
                }
                
                cout<<count;
            }
        }
        cout<<endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
 
#define MAXX 300001
#define PI 3.14159265358979323846264338327950
 
#define ll    long long int 
#define mod  1000000007

ll dp[205];

int main()
{
	FAST;
	ll n;
	cin >> n; ll ans= 0;
	ll a[n+ 5];
	for(ll i = 1; i <= n; i ++){
		cin >> a[i];
		if(i % 2 && a[i]% 2){
			ans ++;
		}
	} cout << ans ; return 0;
}

Measured memory_bytes: 3508
#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;

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

int n;
const int MAX_V=100010;

vector<vector<int>> g(MAX_V);
vector<vector<int>> rev(MAX_V);
vector<int> revv;
bool visited[MAX_V];
int indeg[MAX_V];
int parent[MAX_V];
vector<int> out;
int st;

void bfs(int s){
    st=s;
    queue<int> que;
    que.push(s);
    visited[s]=true;

    while(que.size()){
        int cv=que.front(); que.pop();
        out.push_back(cv);
        for(int i=0; i<g[cv].size(); i++){
            int nv=g[cv][i];
            indeg[nv]--;
            if(indeg[nv]==0 && !visited[nv]){
                visited[nv]=true;
                parent[nv]=cv;
                que.push(nv);
            }
        }
    }
}

void tsort(){
    for(int i=0; i<n; i++){
        for(int j=0; j<g[i].size(); j++){
            int v=g[i][j];
            indeg[v]++;
        }
    }

    for(int i=0; i<n; i++){
        if(indeg[i]==0 && !visited[i]) bfs(i);
    }
/*
    for(int i=0; i<n; i++){
        cout << out[i] << endl;
    }*/
}

int main(){
    int m; cin>>n>>m;
    for(int i=0; i<n+m-1; i++){
        int x, y; cin>>x>>y;
        x--, y--;
        g[x].eb(y);
        rev[y].eb(x);
    }

    tsort();
    
    for(int i=0; i<n; i++){

        if(i==st) cout << 0 << endl;
        else cout << parent[i]+1 << endl;
    }
}


Measured memory_bytes: 13180
(defun main (a b c)
  (let ((rst "No"))
    (if (or (and (equal a b) (not (equal a c)))
            (and (equal a c) (not (equal a b)))
            (and (equal b c) (not (equal a b))))
        (setf rst "Yes")
      
      )
    rst))

(format t "~A~%" (main (read) (read) (read)))



Measured memory_bytes: 8164
from collections import Counter

n=int(input())
ans=''
counter={}
for i in range(1,n+1):
    if i==1:
        s=input()
        counter=Counter()
        counter=Counter(s)
    else:
        s=input()
        counter=Counter(s)&counter

for c in [chr(i) for i in range(ord('a'), ord('z')+1)]:
    ans=ans+c*counter[c]
print(ans)

Measured memory_bytes: 3316
#include <iostream>
#include <limits.h>
#include <utility>
#include <cmath>
#include <string>

using namespace std;

int main()
{
  int A,B,K;
  cin >> A >> B >> K;

  int ii;
  int count = 0;
  for (ii=A; ii>0; --ii) {
    if ( A%ii ==0 && B%ii == 0) {
      ++count;
      //cerr << ii << endl;
      if (count == K) {
	break;
      }
    }
  }

  
  cout << ii << endl;

  return 0;
}

Measured memory_bytes: 256