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

const int64_t mod = 1000000007;
vector<int64_t> fact, inv;

int64_t power(int64_t n, int64_t k) {
  if (k == 0) return 1;
  int64_t ans = power(n * n % mod, k / 2);
  if (k % 2) ans = ans * n % mod;
  return ans;
}

void init(int n) {
  fact.push_back(1);
  inv.push_back(1);
  for (int i = 1; i <= n; i++) {
    fact.push_back(fact.at(i - 1) * i % mod);
    inv.push_back(power(fact.at(i), mod - 2));
  }
}

int64_t ncr(int64_t n, int64_t r) {
  return fact.at(n) * inv.at(r) % mod * inv.at(n - r) % mod;
}

int main() {
  int64_t r1, c1, r2, c2;
  cin >> r1 >> c1 >> r2 >> c2;
  r2++; c2++;
  init(r2 + c2);
  cout << (ncr(r2 + c2, r2) + ncr(r1 + c1, r1) - ncr(r2 + c1, r2) - ncr(r1 + c2, r1) + 2 * mod) % mod << endl;
}


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

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

ll n;
ll a[100001];

int main() {
    std::cin >> n;
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    sort(a,a+n);
    
    if(n==2){
        std::cout << a[1]-a[0] << std::endl;
        return 0;
    }
    
    ll result = 0;
    
    result += a[n-1]-a[0] + a[n-2] - a[0];
    
    for (int i = 1; i < (n-1)/2; i++) {
        if(i%2==0){
            result += a[n-i-1] - a[i-1];
            result += a[n-i-2] - a[i];
        }else{
            result += a[n-i] - a[i];
            result += a[n-i-1] - a[i+1];
        }
    }
    if(n%2 ==0 && n%4 != 0){
        result += a[n/2] - a[n/2-2];
    }else if(n%2==0){
        result += a[n/2+1] - a[n/2-1];
    }
    
    ll result_min = result;
    
    result = 0;
    
    sort(a,a+n,greater<ll>());
    
    result += a[n-1]-a[0] + a[n-2] - a[0];
    
    for (int i = 1; i < (n-1)/2; i++) {
        if(i%2==0){
            result += a[n-i-1] - a[i-1];
            result += a[n-i-2] - a[i];
        }else{
            result += a[n-i] - a[i];
            result += a[n-i-1] - a[i+1];
        }
    }
    if(n%2 ==0 && n%4 != 0){
        result += a[n/2] - a[n/2-2];
    }else if(n%2==0){
        result += a[n/2+1] - a[n/2-1];
    }
    
    std::cout << max(result_min,-result) << std::endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

string divide[4] = {"dream", "dreamer", "erase", "eraser"};

int main(void) {
    string S;
    cin >> S;

    reverse(S.begin(), S.end());
    for (int i = 0; i < 4; i++) reverse(divide[i].begin(), divide[i].end());

    bool can = true;
    for (int i = 0; i < S.size();) {
        bool can2 = false;
        for (int j = 0; j < 4; j++) {
            if (S.substr(i, divide[j].size()) == divide[j]) {
                can2 = true;
                i += divide[j].size();
            }
        }

        if (can2==false) {
            can = false;
            break;
        }
    }

    if (can) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }

}


Measured memory_bytes: 512
#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];
  vector<int> s=a;
  sort(s.rbegin(),s.rend());
  rep(i,n){
    int ans=s[0];
    if (a[i]==s[0]) ans=s[1];
    cout<<ans<<endl;
  }
}

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

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

int main() {
    // input, ready
    char a,b;
    cin >> a >> b;

    int aint=a-'0';
    int bint=b-'0';
    string aAns = string(bint, a);
    string bAns = string(aint, b);

    // output
    if(aAns>=bAns) cout << bAns << endl;
    else cout << aAns << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define deb(x) cout<<#x<<" : "<<x<<"\n";
#define debug(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\n";
#define deb_arr(a,n) {cout<<#a<<":";for(int i=0;i<n;i++) {cout<<a[i]<<" ";} cout<<'\n';}
#define deb_mat(dist,n,m) {cout<<#dist<<"\n";for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<dist[i][j]<<" ";}cout<<'\n';}}
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define all(a) (a).begin(),(a).end()
#define bs binary_search
#define sz size()
#define vi vector<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define clr fflush(stdout);
//#define clr cout.flush();
#define N 200001
#define fpr(i,a,b) for(int i=a;i<b;i++)
#define fdr(i,a,b) for(int i=a;i>b;i--)
#define repp(i,a,b,d) for(int i=a;i<b;i+=d)
#define repd(i,a,b,d) for(int i=a;i>b;i-=d)
#define LLMIN LLONG_MIN
#define LLMAX LLONG_MAX
#define AKASH_PATEL ios_base::sync_with_stdio(false);
#define SVNIT_SURAT cin.tie(NULL);cout.tie(NULL);
#define mset(x,a) memset(x,a,sizeof(x));
#define nl cout<<'\n';
#define print(c) cout<<c<<'\n';
#define setp(n) cout << fixed << setprecision(n)
#define take_arr(a,n) fpr(i,0,n) cin>>a[i];
#define print_arr(a,n) for(int i=0;i<n;i++) {cout<<a[i]<<" ";} cout<<'\n';
#define take_mat(mat,n,m) fpr(i,0,n) fpr(j,0,m) cin>>mat[i][j];
#define set_mat(mat,n,m,k) fpr(i,0,n) fpr(j,0,m) mat[i][j]=k;
#define print_mat(dist,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<dist[i][j]<<" ";}cout<<'\n';}
template< class T > bool inside(T a, T b, T c) { return a<=b && b<=c; }
template< class T > bool odd(T a) { return a&1; }
template< class T > bool even(T a) { return !(a&1); }
long long power(long long x,long long n)
{
    long long ans=1;
    x=x;
    while(n>0)
    {
        if(n&1)
        {
            ans=ans*x;
        }
        n=n>>1;
        x=x*x;
    }
    return ans;
}
ll am(ll a,ll b)
{
    return (a+b)%mod;
}
ll sm(ll a,ll b)
{
    return (a-b+mod)%mod;
}
ll mm(ll a,ll b)
{
    return (a*b)%mod;
}
long long modpower(long long x,long long n)
{
    ll m=mod;
    long long ans=1;
    x=(x+m)%m;
    while(n>0)
    {
        if(n&1)
        {
            ans=(ans*x)%m;
        }
        n=n>>1;
        x=(x*x)%m;
    }
    return ans;
}
ll dm(ll a,ll b)
{
    return (a*modpower(b,mod-2))%mod;
}
int main()
{
//#ifndef ONLINE_JUDGE
//    freopen("../ip.txt", "r", stdin);
//    freopen("../op.txt", "w", stdout);
//#endif
    AKASH_PATEL;
    SVNIT_SURAT;
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll n,k;cin>>n>>k;
        ll res=0;
        ll p[k+1];mset(p,0)
        ll tm=0;
        fdr(i,k,0)
        {
            ll a=k/i,b=modpower(a,n);
            repp(j,2*i,k+1,i)
            {
                b=sm(b,p[j]);
            }
            p[i]=b;
            res+=mm(b,i);
        }
        res%=mod;
        print(res)
    }
    return 0;
}





Measured memory_bytes: 4396
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MS(a) memset(a,0,sizeof(a))
#define MP make_pair
#define PB push_back
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3fLL;
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
//////////////////////////////////////////////////////////////////////////
const int maxn = 1e5+10;

int main(){
	int n; string ans="",s;
	cin >> n >> s;
	int len = s.size();
	int cnt=0;
	for(int i=0; i<len; i++){
		if(s[i] == '(') cnt++,ans+='(';
		else {
			if(cnt > 0) {
				cnt--;
				ans += ')';
			}else{
				ans = '('+ans+')';
			}
		}
	}
	while(cnt--) ans+=')';
	cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
//#pragma GCC optimize("Ofast")
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
//#define int ll
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX / 2;
const ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
const double EPS = 1e-9;

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  string s;
  cin >> s;
  
  ll N;
  N = s.size();
  
  ll K;
  cin >> K;
  
  //長さk以下のみなのでいける
  
  set<string> st;
  rep(i, N) {
    rep(j, 5) {
      st.insert(s.substr(i, j + 1));
    }
  }
  
  int i = 1;
  for(string b : st) {
    if(i == K) {
      fin(b);
      return 0;
    }
    i ++;
  }
}

Measured memory_bytes: 1664
#include<stdio.h>

long int kouyaku(long int a, long int b){
	long int r;
	while( (r= a%b) != 0){
		a=b;
		b=r;
	}
	return b;
}

long int koubai(long int a, long int b, long int c){
	int l;
	l= (a*b)/c;
	return l;
}

int main(void){
	long int a,b,c,d;
	while( scanf("%ld %ld",&a,&b)!= EOF){

	c= kouyaku(a, b);
	d= koubai(a, b, c);

	printf("%ld %ld\n",c, d);
	}
	return 0;
}

Measured memory_bytes: 592
N = int(input())
A = input()
B = input()
C = input()


kaisuu = 0

for i in range(N):
    set_ = set([A[i], B[i], C[i]])
    if len(set_)==3:
        kaisuu += 2
    elif len(set_) == 2:
        kaisuu += 1

print(kaisuu)

Measured memory_bytes: 3064
import java.util.*;

class Main {
 public static void main(String[] args){
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int count = 0;
     int tmp = 0;
     for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     }
     System.out.print(count);
 }
 
 private static int flipNum(int tmp){
     String tmpStr = String.valueOf(tmp);
     StringBuilder sb = new StringBuilder(tmpStr).reverse();
     String flipTmpStr = sb.toString();
     int flipTmp = Integer.parseInt(flipTmpStr);
     return flipTmp;
 }
}

Measured memory_bytes: 39508
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;
using static AtCoderTemplate.MyLibrary;

namespace AtCoderTemplate
{
    class Program
    {
        static void Main (string[] args)
        {
            string[] str = Console.ReadLine ().Split (' ');

            int N = int.Parse (str[0]);
            int M = int.Parse (str[1]);

            str = Console.ReadLine ().Split (' ');
            int sum = 0;

            for (int i = 0; i < M; i++)
            {
                sum += int.Parse (str[i]);
                if (sum > N) { Console.WriteLine (-1); return; }
            }

            Console.WriteLine (N - sum);
        }
    }

    class MyLibrary
    {

        // 自作の関数
        public static int MyFunction (int n)
        {
            return 0;
        }
    }
}

Measured memory_bytes: 28272
local n, c, k = io.read("*n", "*n", "*n")
local t = {}
for i = 1, n do
  t[i] = io.read("*n")
end
table.sort(t)
local pos = 1
local busnum = 0
while(pos <= n) do
  busnum = busnum + 1
  local klim = t[pos] + k
  local clim = pos + c - 1
  local i = pos + 1
  while(i <= n) do
    if(clim < i) then break end
    if(klim < t[i]) then break end
    i = i + 1
  end
  pos = i
end
print(busnum)


Measured memory_bytes: 1280
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 1000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144*4
#define REP(a,b) for(long long a = 0;a < b;++a)
#define int long long
int union_tree[300000];
int union_find(int now) {
	if (union_tree[now] == now) return now;
	return union_tree[now] = union_find(union_tree[now]);
}
void union_merge(int a, int b) {
	a = union_find(a);
	b = union_find(b);
	union_tree[a] = b;
	return;
}
long long gogo[300000];
#undef int
int main() {
#define int long long
	long long n, query;
	cin >> n >> query;
	vector<tuple<long long, long long, long long>> edges;
	REP(i, n) {
		gogo[i] = 1e15;
	}
	REP(i, query) {
		long long a, b, c;
		cin >> a >> b >> c;
		edges.push_back(make_tuple(c, a, b));
		gogo[a] = min(gogo[a], c + 1LL);
		gogo[b] = min(gogo[b], c + 2LL);
	}
	REP(i, 3) {
		REP(j, n) {
			gogo[j] = min(gogo[j], gogo[(j + n - 1) % n] + 2LL);
		}
	}
	REP(q, n) {
		edges.push_back(make_tuple(gogo[q], q, (q + 1) % n));
	}
	sort(edges.begin(), edges.end());
	long long ans = 0;
	REP(i, n) {
		union_tree[i] = i;
	}
	REP(i, edges.size()) {
		if (union_find(get<1>(edges[i])) != union_find(get<2>(edges[i]))) {
			union_merge(get<1>(edges[i]), get<2>(edges[i]));
			ans += get<0>(edges[i]);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 17896
// -*- coding:utf-8-unix -*-

#[macro_use]
extern crate lazy_static;
extern crate num_bigint; // 0.2.2
extern crate num_traits; // 0.2.8
use num_bigint::BigInt;
use num_traits::Pow;

// use proconio::derive_readable;
use proconio::fastout;
use proconio::input;
// use std::convert::TryInto;
use libm::*;
use std::cmp::*;
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::*;
use std::ops::Range;
use std::str::FromStr;
use superslice::*;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//abc088-D
// #[fastout]
fn main() {
    input![h: usize, w: usize, s: [String; h]];

    // let a: String = String::new("abc");
    // let b = ;

    let mut num_white_without_se = 0;
    for i in 0..w {
        for j in 0..h {
            if s[j].chars().nth(i).unwrap() == '.' {
                eprintln!("num_white_without_se: {}", num_white_without_se);
                num_white_without_se += 1;
            } else if s[j].chars().nth(i).unwrap() == '#' {
            }
        }
    }

    let mut q = VecDeque::new();

    let mut is_visits = vec![vec![false; w]; h];
    //h,w,depth
    q.push_back(((0, 0), 1));
    is_visits[0][0] = true;
    let mut target = None;

    while !q.is_empty() {
        let current = q.pop_front().unwrap();
        let (current_pos, d) = &current;

        if *current_pos == (h - 1, w - 1) {
            target = Some(current);
            break;
        }

        let (c_h, c_w) = *current_pos;
        if c_h > 0 && s[c_h - 1].chars().nth(c_w).unwrap() != '#' && !is_visits[c_h - 1][c_w] {
            q.push_back(((c_h - 1, c_w), *d + 1));
            is_visits[c_h - 1][c_w] = true;
        }
        if c_h < h - 1 && s[c_h + 1].chars().nth(c_w).unwrap() != '#' && !is_visits[c_h + 1][c_w] {
            q.push_back(((c_h + 1, c_w), *d + 1));
            is_visits[c_h + 1][c_w] = true;
        }

        if c_w > 0 && s[c_h].chars().nth(c_w - 1).unwrap() != '#' && !is_visits[c_h][c_w - 1] {
            q.push_back(((c_h, c_w - 1), *d + 1));
            is_visits[c_h][c_w - 1] = true;
        }
        if c_w < w - 1 && s[c_h].chars().nth(c_w + 1).unwrap() != '#' && !is_visits[c_h][c_w + 1] {
            q.push_back(((c_h, c_w + 1), *d + 1));
            is_visits[c_h][c_w + 1] = true;
        }
    }

    eprintln!("num_white_without_se: {}", num_white_without_se);
    let ans = target.map(|(_, d)| num_white_without_se - d).unwrap_or(-1);
    println!("{}", ans);
}

// use lazy_static::lazy_static;
// use std::sync::Mutex;

// lazy_static! {
//     static ref VALUES: Mutex<Vec<i32>> = Mutex::default();
// }

// let mut values = VALUES.lock().unwrap();
// values.extend_from_slice(&[1, 2, 3, 4]);
// assert_eq!(&*values, &[1, 2, 3, 4]);

// -100000000
//  1000000000


Measured memory_bytes: 2188
#include<iostream>
using namespace std;
 
int data[10];
 
bool solve(int i, int a, int b){
 
  if(i == 10) return true;
 
  if(data[i] > a) return solve(i+1, data[i], b);
  if(data[i] > b) return solve(i+1, a, data[i]);
  
  return false;
}
 
int main(){
 
  int n;
 
  cin >> n;
  while(n--){
 
    for(int i=0;i<10;i++) cin >> data[i];
 
    cout << (solve(0, 0, 0)?"YES\n":"NO\n");
 
  }
 
}

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

int main() {
  int N, K;
  cin >> N >> K;

  vector<long long> vec(N);

  for (int i = 0; i < N; i++) {
    cin >> vec[i];
  }

  sort(vec.begin(), vec.end());
  long long mi = 10000000000;
  for (int i = 0; i <= N - K; i++) {
    long long sa = vec[i + K - 1] - vec[i];
    mi = min(mi, sa);
  }
  cout << mi << endl;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#define inf 1<<30
#define maxn 100010
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define ll long long
inline void read(ll &x){
    x=0;ll f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
using namespace std;
ll n,pt,px,py;
ll t=0,x=0,y=0,nt,nx,ny,k;
int main(){
	read(n);
	ll i;
	for(i=1;i<=n;i++){
		read(nt);read(nx);read(ny);
		pt=nt-t;px=abs(nx-x);py=abs(ny-y);
		k=pt-px-py;
		if(k&1||k<0){
			printf("No\n");
			return 0;
		}
		t=nt;x=nx;y=ny;
	}
	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    string S;
    cin >> S;
    
    if (S == "zyxwvutsrqponmlkjihgfedcba") {
        cout << -1 << endl;
        return 0;
    }
    if (S.size() == 26) {
        bool x = false;
        string s = S;
        string T = "";
        do {
            if (x) {
                T = s;
                break;
            }
            x = true;
        } while (next_permutation(s.begin(), s.end()));
        string ans = "";
        rep(i, S.size()) {
            ans.push_back(T[i]);
            if (S[i] != T[i]) break;
        }
        cout << ans << endl;
    }
    vector<int> cnt(26, 0);
    rep(i, S.size()) ++cnt[S[i] - 'a'];
    rep(i, 26) {
        if (!cnt[i]) {
            char c = 'a' + i;
            cout << S << c << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(string, s);
	VAR(string, t);
	int n = s.size();
	map< char, char > s_mp, t_mp;
	bool ok = true;
	REP(i, n) {
		if (s_mp.count(s[i])) {
			ok &= (s_mp[s[i]] == t[i]);
		}
		if (t_mp.count(t[i])) {
			ok &= (t_mp[t[i]] == s[i]);
		}
		s_mp[s[i]] = t[i];
		t_mp[t[i]] = s[i];
	}

	OUT(ok ? "Yes" : "No")BR;
  
  return 0;
}


Measured memory_bytes: 916
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {
    int H, W;
    cin >> H >> W;
    vector<string> d(H+2);
    string tmp;
    rep(i, 1, H+1){
        cin >> tmp;
        d[i] = '.' + tmp + '.';
    }
    string tmp1(W+2, '.');
    d[0] = tmp1;
    d[H+1] = tmp1;
    vector<string> ans(H, string(W, '#'));
    REP(i, H)REP(j, W){
        int cnt = 0;
        if(d[i+1][j+1] == '#') continue;
        if(d[i][j] == '#') cnt++;
        if(d[i][j+1] == '#') cnt++;
        if(d[i][j+2] == '#') cnt++;
        if(d[i+1][j] == '#') cnt++;
        if(d[i+1][j+2] == '#') cnt++;
        if(d[i+2][j] == '#') cnt++;
        if(d[i+2][j+1] == '#') cnt++;
        if(d[i+2][j+2] == '#') cnt++;
        ans[i][j] = '0' + cnt;
    }
    REP(i, H) cout << ans[i] << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
 
int main(void){
  int R,G;
  if(scanf("%d",&R) == 1);
  if(scanf("%d",&G) == 1);
  if(R >=0 && G >=0 && R <= 4500 && G <= 4500){
    printf("%d",((2*G)-R));
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	string s;
	cin >> s;
	
	string a = s.substr(0, 2);
	string b = s.substr(2, 2);
	int flag = 0;
	if (1 <= stoi(a) && stoi(a) <= 12) {
		flag |= 0b10;
	}
	if (1 <= stoi(b) && stoi(b) <= 12) {
		flag |= 0b01;
	}
	
	if ((flag & 0b11) == 0b11) {
		cout << "AMBIGUOUS" << endl;
	} else if (flag & 0b10) {
		cout << "MMYY" << endl;
	} else if (flag & 0b01) {
		cout << "YYMM" << endl;
	} else {
		cout << "NA" << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
//#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

//#include <cv.h>
//#include <highgui.h>
#include <stdlib.h>
#include <string>

int A, B, T;

int main(int argc, char **argv) {
    std::cin >> A >> B >> T;
    
    int ret = (T / A) * B;

    std::cout << ret << std::endl;

    return 0;
}

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

#define rep(i,a,b) for(int i=a;i<b;i++)
#define INF INT_MAX/2

typedef long long int ll;
typedef int Node;
typedef tuple<Node, Node, ll> Edge;
typedef pair<Node, ll> Cost;

typedef vector<Node> Nodes;
typedef map<Node, vector<Edge> > Edges;
typedef vector<Cost> Costs;

struct Comp {
	bool operator() (Cost a, Cost b) {
		return a.second > b.second;
	}
};

vector<Cost> dijkstra(Nodes V, Edges E, Node r)
{
	map<Node,ll> costs;
	Costs result;
	priority_queue<Cost, vector<Cost>, Comp> que;
	set<Node> done;

	for (Node n : V)
	{
		if (n == r)
		{
			Cost c = Cost(n, 0);
			costs[n] = 0;
			que.push(c);
		}
		else
			costs.insert(Cost(n, INF));
	}

	while (!que.empty())
	{
		Cost c = que.top();
		que.pop();

		if (done.find(c.first) != done.end()) continue;

		done.insert(c.first);
		result.push_back(c);

		for (Edge e : E[c.first])
		{
			Node from = c.first;
			Node to = get<1>(e);
			ll cost = get<2>(e);
			
			ll newcost = c.second + cost;
			if (newcost < costs[to])
			{
				costs[to] = newcost;
				que.push(Cost(to, newcost));
			}
		}
	}

	return result;
}

int main()
{
	int V, E, r;
	cin >> V >> E >> r;

	Nodes nodes;
	rep(i, 0, V) nodes.push_back(i);

	Edges edges;
	rep(i, 0, V) edges[i] = vector<Edge>();
	rep(i, 0, E)
	{
		int s, t, d;
		cin >> s >> t >> d;
		edges[s].push_back(Edge(s, t, d));
		//edges[t].push_back(Edge(t, s, d));
	}

	Costs costs = dijkstra(nodes, edges, r);
	vector<ll> ans(V, INF);
	for (Cost c : costs) ans[c.first] = c.second;

	rep(i, 0, V)
	{
		if (ans[i] == INF)
			cout << "INF" << endl;
		else
			cout << ans[i] << endl;
	}
}

Measured memory_bytes: 52560
#include <stdio.h>

#define MAX (1 << 18) /* 262144 */

int hocchann[MAX * 2 - 1];

void init(const int* data, int num) {
	int i;
	for (i = 0; i < MAX; i++) {
		hocchann[MAX - 1 + i] = i < num ? data[i] : 0;
	}
	for (i = MAX - 1 - 1; i >= 0; i--) {
		int c1 = hocchann[i * 2 + 1];
		int c2 = hocchann[i * 2 + 2];
		hocchann[i] = c1 > c2 ? c1 : c2;
	}
}

int get_i(int idx, int qmin, int qmax, int smin, int smax) {
	if (qmax <= smin || smax <= qmin) return 0;
	else if (qmin <= smin && smax <= qmax) return hocchann[idx];
	else {
		int smid = smin + (smax - smin) / 2;
		int l = get_i(idx * 2 + 1, qmin, qmax, smin, smid);
		int r = get_i(idx * 2 + 2, qmin, qmax, smid, smax);
		return l > r ? l : r;
	}
}

int get(int min, int max) {
	return min < max ? get_i(0, min, max, 0, MAX) : 0;
}

int N, K;
int a[271828];

char nokosu[271828];

int main(void) {
	int i;
	int start, left;
	if (scanf("%d%d", &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &a[i]) != 1) return 1;
	}
	init(a, N);
	start = 0;
	left = K;
	while (start + left < N) {
		int max = get(start, start + left + 1);
		int no = 0, yes = left + 1;
		while (no + 1 < yes) {
			int mid = no + (yes - no) / 2;
			if (get(start, start + mid) == max) yes = mid; else no = mid;
		}
		printf("%d", max);
		start += yes;
		left -= yes - 1;
	}
	putchar('\n');
	return 0;
}



Measured memory_bytes: 4560
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const long long INFL = 2e18;
const int MOD = 1000000007;
int main(){
	int n;
	cin >> n;
	ll min_a = INFL, max_a = -INFL, min_b = INFL, max_b = -INFL;
	for(int i = 0;i < n;i++){
		ll x,y;
		cin >> x >> y;
		ll a = x - y;
		ll b = x + y;
		min_a = min(min_a,a);
		max_a = max(max_a,a);
		min_b = min(min_b,b);
		max_b = max(max_b,b);
	}


	cout << max(max_a-min_a,max_b-min_b) << endl;
}


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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

int main()
{
    int n;
    while(cin >>n,n)
    {
        string s;
        cin >>s;
        vector<int> a(n), b(n);
        rep(i,n)
        {
            cin >>a[i] >>b[i];
            --a[i]; --b[i];
        }

        for(int i=n-1; i>=0; --i)
        {
            int d=b[i]-a[i];
            swap(s[a[i]],s[b[i]]);

            s[a[i]] = ((s[a[i]]-'a'+d)%26)+'a';
            s[b[i]] = ((s[b[i]]-'a'+d)%26)+'a';
        }

        cout << s << endl;
    }
    return 0;
}

Measured memory_bytes: 3196
#include<iostream>
#include<vector>
using namespace std;
signed main(){
    int n;
    cin>>n;
    vector<int> a(n);
    for(auto& ai:a)cin>>ai;
    int ans = 0;
    for(int i=0;i<n-1;++i){
        if(a[i]<a[i+1])ans++;
    }
    cout<< ans <<endl;
}


Measured memory_bytes: 3108
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();

    // input
    let h: usize = read(&mut stdin_lock, &mut buf, b' ');
    let n: usize = read(&mut stdin_lock, &mut buf, b'\n');
    let mut abv = vec![(0usize, 0usize); n];
    for i in 0..n {
        abv[i].0 = read(&mut stdin_lock, &mut buf, b' ');
        abv[i].1 = read(&mut stdin_lock, &mut buf, b'\n');
    }

    let mut tbl = vec![usize::max_value(); h + 1];
    tbl[0] = 0;
    for hp in 1..h + 1 {
        tbl[hp] = abv
            .iter()
            .map(|&(a, b)| if hp > a { tbl[hp - a] + b } else { b })
            .min()
            .unwrap();
    }

    println!("{}", tbl[h]);
}


Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
using namespace std;
int N;
long A[2<<17];
long dp[2<<17][3];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	for(int i=0;i<=N;i++)for(int j=0;j<3;j++)dp[i][j]=-9e18;
	dp[0][0]=0;
	for(int i=0;i<N;i++)for(int j=0;j<3;j++)
	{
		if(dp[i][j]<-1e18)continue;
		dp[min(i+2,N)][j]=max(dp[min(i+2,N)][j],dp[i][j]+A[i]);
		if(j<2)dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]);
	}
	long ans=max(dp[N][0],dp[N][1]);
	if(N%2==1)ans=max(ans,dp[N][2]);
	cout<<ans<<endl;
}


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

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int x = sc.nextInt();
		
		// 計算
		String result = "No";
		if(x >= 30) result = "Yes";
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}


Measured memory_bytes: 25408
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define DEBUG true
#ifdef ONLINE_JUDGE
#undef DEBUG
#define DEBUG false
#endif 

using namespace std;

#define MAXN ((int)2e5+5)
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9 + 9)
#define ll long long
#define _ << " " <<
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define TRACE(x) if(DEBUG) cerr << #x << " = " << x << endl;
#define TRACE2(x,y) if(DEBUG) cerr << #x << " = " << x << " | " << #y << " = " << y << endl;
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl "\n"
#define pii pair<int,int>
#define mid ((l+r)/2)

int n,k,q,a;

map <int,int> mp;

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);
	cin >> n >> k >> q;

	for (int i = 0; i < q; ++i)
	{
		cin >> a;
		mp[a]++;
	}

	for (int i = 1; i <= n; ++i)
	{
		if(k > q-mp[i])
			cout << "Yes\n";
		else
			cout << "No\n";
	}


}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;

using ll = long long;
using ull = unsigned long long;

int main() {
    ll N, P;
    string S;
    //cin >> N >> P;
    cin >> S;
    N=S.size();
    P=2019;
    // P が 2 or 5 の時
    if (P == 2 || P == 5) {
        ll ans = 0;
        for (int i = 0; i < N; i++) {
            if ((int)(S[i] - '0') % P == 0) {
                ans += i + 1;
            }
        }
        cout << ans << endl;
        return 0;
    }

    // P が 2 でも 5 でも無い時
    vector<ll> sum(N + 1, 0), ten(N + 1, 1);
    for (int i = N - 1; i >= 0; i--) {  // ten の前計算
        ten[i] = ten[i + 1] * 10 % P;
    }
    for (int i = N - 1; i >= 0; i--) {  // sum の計算
        sum[i] = ((ll)(S[i] - '0') * ten[i + 1] % P + sum[i + 1]) % P;
    }

    map<ll, ll> m;  // 剰余が同じものを数える
    for (auto i : sum) {
        m[i]++;
    }

    ll ans = 0;
    for (auto i : m) {
        ans += i.second * (i.second - 1) / 2;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 6828
n = int(input())
ab = [list(map(int,input().split())) for i in range(n)]
cd = [list(map(int,input().split())) for i in range(n)]
ab = sorted(ab, key = lambda x:x[1], reverse=True)
cd = sorted(cd)
log = [0] * n
cnt = 0
for i in range(n):
    c, d = cd[i]
    for j in range(n):
        if log[j]:continue
        a, b = ab[j]
        if a < c and b < d:
            cnt += 1
            log[j] = 1
            break
print(cnt)

Measured memory_bytes: 38896
#include <cstdio>
#include <cstring>
#include <algorithm>
const int N=2010;
using namespace std;
int n,k,tot,h[N],d[N];
struct Edge{int u,v,nxt;}e[N<<1];
void add(int a,int b){e[++tot]=Edge{a,b,h[a]},h[a]=tot;}
void dfs(int x,int fx){
	for(int i=h[x];i;i=e[i].nxt){
		int v=e[i].v;
		if(v==fx) continue;
		d[v]=d[x]+1,dfs(v,x);
	}
}int main(){
	scanf("%d%d",&n,&k);
	for(int i=1,a,b;i<n;i++) scanf("%d%d",&a,&b),add(a,b),add(b,a);
	int ans=1<<30;
	if(k&1){
		for(int i=1;i<=tot;i++){
			d[e[i].u]=d[e[i].v]=0;
			dfs(e[i].u,e[i].v),dfs(e[i].v,e[i].u);
			int tmp=0;
			for(int j=1;j<=n;j++)
				if(d[j]>k/2) ++tmp;
			ans=min(ans,tmp);	
		}
	}else{
		for(int i=1;i<=n;i++){
			d[i]=0,dfs(i,-1);
			int tmp=0;
			for(int j=1;j<=n;j++)
				if(d[j]>k/2) ++tmp;
			ans=min(ans,tmp);	
		}
	}printf("%d\n",ans);	
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main(){
  int x;
  string c;
  bool Y=false;
  cin >> x;
  for(int i=0;i<x;i++){
    cin >> c;
    if(c=="Y")Y=true;
  }
  if(Y) cout << "Four" << endl;
  else cout << "Three" << endl;
}

Measured memory_bytes: 256
S = input()
T = input()


def main():
    StoT = {}
    TtoS = {}

    for i in range(len(S)):

        if S[i] in StoT:
            if StoT[S[i]] != T[i]:
                print("No")
                return

        else:
            StoT[S[i]] = T[i]

            if T[i] in TtoS:
                if TtoS[T[i]] != S[i]:
                    print("No")
                    return
            else:
                TtoS[T[i]] = S[i]

    print("Yes")


if __name__ == '__main__':
    main()


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

int main() {
  string s;
  cin >> s;
  sort(s.begin(),s.end());
  
  if(s[0] == s[1] && s[2] == s[3] && s[1] != s[2]){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int a[1000001],sum=0;
int main(){
	int i,j,k,n;
	cin>>n;
	n*=2;
	for(i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	for(i=1;i<=n;i+=2)sum+=a[i];
	cout<<sum<<endl;
	return 0;
}

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

int main(){
  ll n;cin>>n;
  vector<ll> a(n+1),b(n);
  rep(i,n+1)cin>>a.at(i);
  rep(i,n)cin>>b.at(i);
  
  ll ans=0;
  rep(i,n){
  if(a.at(i)>=b.at(i)){
    ans+=b.at(i);

  }
  else if(a.at(i)+a.at(i+1)>=b.at(i)){
    a.at(i+1)+=a.at(i)-b.at(i);
    ans+=b.at(i);
   
  } 
  else{
    ans+=a.at(i)+a.at(i+1);
    a.at(i+1)=0;
  }
  }
  cout<<ans;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define inf 20021225
#define ll long long
#define mxn 100100
using namespace std;

int a[mxn],n,id[mxn];
bool cmp(int x,int y)
{
	return a[x]<a[y];
}
int main()
{
	scanf("%d",&n);ll ans=0;
	for(int i=1;i<=n;i++)	scanf("%d",&a[i]),id[i]=i;
	sort(id+1,id+n+1,cmp);
	for(int i=1;i<=n;i++)	ans+=abs(id[i]-i)&1;
	printf("%lld\n",ans/2);
	return 0;
}

Measured memory_bytes: 1024
# /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math



N = int(input())
Vn = list(map(int, input().split()))
Cn = list(map(int, input().split()))

ans = 0
for i in range(N):
  if Vn[i] > Cn[i]:
    ans += Vn[i] - Cn[i]

print(ans)  


Measured memory_bytes: 38384
#include <iostream>
#include <array>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

static inline int charToInt(char c) {
  switch(c) {
  case 'A':
    return 0;
  case 'C':
    return 1;
  case 'G':
    return 2;
  case 'T':
    return 3;
  default:
    return -1;
  }  
}

static inline int strToInt(const string& str) {
  int total = charToInt(str[0]);
  int cur;
  for (int i = 1; i < str.length(); i++) {
    cur = charToInt(str[i]);
    total += pow(4, i) + pow(4, i) * cur;
  }  
//  cout << " " << total;
  return total;
}

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

  vector<bool> dictionary(static_cast<size_t>(pow(4, 12)) + 4, false);
  string command, str;

  for (int i = 0; i < n; i++) {
    cin >> command >> str;
    if (command[0] == 'i') {
      dictionary[strToInt(str)] = true;
    } else {
        cout << (dictionary[strToInt(str)] ? "yes" : "no") << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 4880
package main

import (
	"bufio"
	"fmt"
	"os"
)

func isAlpha(c rune) bool {
	return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')
}

func toLower(c rune) rune {
	if 'a' <= c && c <= 'z' {
		return c
	}
	return c + 0x20
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	var a [26]int
	for sc.Scan() {
		s := sc.Text()
		for _, c := range s {
			if !isAlpha(c) {
				continue
			}
			c2 := toLower(c)
			i := int(c2 - 'a')
			a[i]++
		}
	}
	for i, e := range a {
		c := 'a' + i
		fmt.Printf("%c : %d\n", c, e)
	}
}



Measured memory_bytes: 1112
from heapq import heappush,heappop
import queue
import re

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def make1d_arr(n,val=INF):
    return [val for i in range(n)]

def make2d_arr(h,w,val =INF):
    return [[val for i in range(w)]for i in range(h)]


A,B,T = ints_raw()


def main():

    return (T//A)*B
    
print(main())


Measured memory_bytes: 4320
#include <iostream>
#include <string>

int main(int argc, char *argv[]){
    int a;
    std::string s;
    std::cin >> a >> s;
    if(a>=3200){
        std::cout << s << std::endl;
    }else{
        std::cout << "red" << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.math.*;
public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int M = 1000000007;
    nckinit(M);
    long ao = 0;
    long aka = 0;
    for(int i=1; i<=K; i++){
      if(K-1<i-1 || N-K+1<i){
        System.out.println(0);
      } else {
        ao = nck(K-1, i-1, M);
        aka = nck(N-K+1, i, M);
        System.out.println((ao * aka) % M);
      }
    }
  }

  static final int MAX = 10000000;
  static long[] fac = new long[MAX];
  static long[] inv = new long[MAX];
  static long[] finv = new long[MAX];

  static void nckinit(int MOD) {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int 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;
    }
  }

  static long nck(int n, int k, int MOD) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
  }
}

Measured memory_bytes: 257876
K = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[K-1])

Measured memory_bytes: 38384
from math import gcd
import math
n, k= map(int, input().split())
mod = 10**9+7
#全ての倍数の数を求める
ans = 0
count = [0 for i in range(k+1)]
for i in range(k,0,-1):
    num = k // i
    count[i] = pow(num,n,mod) 
    for j in range(i*2,k+1,i):
        count[i] -= count[j]
    ans += (count[i] * i)
    ans %= mod
print(ans)




Measured memory_bytes: 73764
#include <stdio.h>

int main()
{
    int num,tNum,digit = 2,count;
    int rem;
    scanf("%d",&num);

    count=0;
    tNum=num;

    while(tNum>0)
    {
        rem=tNum%10;
        if(rem==digit)
            count++;
        tNum/=10;
    }

    printf("%d",count);

    return 0;
}


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

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)
#define INF 1000000000

typedef long long ll;
typedef pair<ll,ll> P;

int main()
{
	ll n,k;cin >> n >> k;
	ll ans = 0;
	
	for(ll i = k+1;i <= n;i++)
	{
		ll tmp = n % i;
		if(tmp > 0)
		{
			ans += max(tmp - k + 1,0LL);
			if(k == 0)ans--;
		}
		ans += max(0LL,(n / i)*(i - k));
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int R, G, B, N;
    cin >> R >> G >> B >> N;

    int completeCount = 0;

    int maxR = N / R;
    for(int i_R = 0; i_R < maxR + 1; i_R++)
    {
        // 残数
        int remainingN_R = N - R * i_R;
        if(remainingN_R < 0) break;

        int maxG = remainingN_R / G;
        for(int i_G = 0; i_G < maxG + 1; i_G++)
        {
            int remainingN_G = remainingN_R - G * i_G;
            if(remainingN_G < 0) break;

            if(remainingN_G % B == 0)
            {
                completeCount++;
            }
        }
    }

    cout << completeCount << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    
    int number[3] = {0};

    scanf("%d %d %d",&number[0],&number[1],&number[2]);
    

    for(int i = 0; i < (3-1) ; i++){
        for(int j = 1; j < 3 ;j++){
            if(number[i] > number[j]){
                int tmp = number[i];
                number[i] = number[j];
                number[j] = tmp;
            }
        }
    }

    for(int k = 0 ; k < 3 ; ){
        printf("%d",number[k]);
        k++;
        if(k >= 3){
            printf("\n");
            break;
        }else{
            printf(" ");
        }
    }    
    
    return 0;
}

Measured memory_bytes: 1032
N, X, Y = map(int, input().split())
X -= 1
Y -= 1
D = [0] * N

for i in range(N):
    for j in range(i, N):
        m = min(abs(j - i), abs(i - X) + 1 + abs(j - Y), abs(i - Y) + 1 + abs(j - X))
        D[m] += 1

for v in D[1:N]:
    print(v)

Measured memory_bytes: 3444
n, t = map(int, input().split())
flag = False
for x in range(n+1):
    if flag is True:
        break
    for y in range(n-x+1):
        # print(10000 * x + 5000 * y + 1000 * (n-x-y))
        if (10000 * x + 5000 * y + 1000 * (n-x-y)) == t:
            print(str(x) + ' ' + str(y) + ' ' + str(n-x-y))
            flag = True
            break

if flag is False:
    print('-1 ' * 3)

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#define ll int 
using namespace std;
int main()
{
	ll n,k;
	cin>>n>>k;
	ll a[n];
	for(int i=0;i<n;i++)
	cin>>a[i];
	
	sort(a,a+n);
	
	ll d[k+1];
	d[0]=2;
	for(int i=1;i<=k;i++)
	{
		int c=0;
		for(int j=0;j<n;j++)
		{
			if(i-a[j]>=0)
			{
				if(d[i-a[j]]==2)
				{
					c=1;
					break;
				}
			}
			else
			break;
		}
		if(c==1)
		d[i]=1;
		else
		d[i]=2;
	}
	
//	for(int i=0;i<=k;i++)
//	{
//		cout<<d[i]<<"   ";
//	}
	if(d[k]==1)
	cout<<"First";
	else
	cout<<"Second";
	
}

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

int main(void) {
  int x, y, z, k;
  cin >> x >> y >> z >> k;
  vector<lint> a(x), b(y), c(z);
  rep (i, x) cin >> a[i];
  rep (i, y) cin >> b[i];
  rep (i, z) cin >> c[i];
  const int xy = x * y;
  vector<lint> ab(xy);
  rep (i, x) {
    rep (j, y) {
      ab[y * i + j] = a[i] + b[j];
    }
  }
  sort(all(ab), greater<lint>());
  sort(all(c), greater<lint>());
  vector<int>  checked(z);
  vector<lint> ans(k);
  rep (i, k) {
    pair<lint, int> maxi_idx = {-1, -1};
    rep (j, z) {
      if (checked[j] < xy) maxi_idx = max(maxi_idx, {c[j] + ab[checked[j]], j});
    }
    ans[i] = maxi_idx.first;
    ++checked[maxi_idx.second];
  }
  allrep (x, ans) cout << x << "\n";
  return 0;
}

Measured memory_bytes: 8192
H,W,h,w = gets.split.map(&:to_i)

if H % h == 0 && W % w == 0
  puts "No"
  exit
end

ans = Array.new(H){[]*W}
cntM = (h==1 || w==1) ? [h,w].max-1 : (h-1)*(w-1)
cntP = h*w-cntM
valM = -cntP * 10**3
valP = cntM * 10**3

H.times do |i|
  W.times do |j|
    if (h!=1 && i%h == 0) || (w!=1 && j%w == 0)
      ans[i][j] = valP
    elsif i%h == h-1 && j%w == w-1
      ans[i][j] = valM-1
    else
      ans[i][j] = valM
    end
  end
end
#sum = 0
puts "Yes"
ans.each do |r|
  puts r.join(" ")
  #sum += r.reduce(:+)
end
#p sum


Measured memory_bytes: 6140
#include <iostream>
#include <list>

using namespace std;

int main()
{
  int n;
  cin >> n;
  list <int> a;
  int hoge;
  for(int i=0;i<(n*2);i++){
	cin >> hoge;
	a.push_back(hoge);
	// cout << a.back()<< endl;
  }

  a.sort();
  a.reverse();

  int ans = 0;
  for(int j = 0;j < (n*2);j+=2){
	ans += a.back();
	// cout << a.back() << endl;
	a.pop_back();
	a.pop_back();
	// cout << j << endl;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256