akhauriyash/Code-Regression huggingface dataset:
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); cout << '\n';}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); cout << '\n';}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;

ll div1(ll p, ll q){
	ll res = p/q;
	if(q*res > p) res--;
	return res;
}

ll div2(ll p, ll q){
	ll res = p/q;
	if(q*res < p) res++;
	return res;
}

int main(void){
	ll n, k;
	cin >> n >> k;
	Vec a(n), b(n);
	rep(i, n) cin >> a[i];
	rep(i, n) b[i] = -a[i];
	sort(all(a));
	sort(all(b));

	ll l = -LINF, r = LINF;
	while(r-l > 1){
		ll m = (l+r)/2;
		ll sum = 0;
		for(ll i : a){
			if(i == 0){
				if(m >= 0) sum += n-1;
				continue;
			}
			ll p;
			if(i >= 0){
				p = upper_bound(all(a), div1(m, i))-a.begin();
			}else{
				p = upper_bound(all(b), div1(m, -i))-b.begin();
			}
			if(i*i <= m) p--;
			sum += p;
		}

		if(sum/2 < k) l = m;
		else r = m;
	}
	co(r);

	return 0;
}


Measured memory_bytes: 3328
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main()
{
	int n, r;
	scanf("%d%d", &n, &r);
	if (n >= 10) printf("%d\n", r);
	else printf("%d\n", r + (10 - n) * 100);
	return 0;
}

Measured memory_bytes: 256
# coding:utf-8

N, K = map(int, input().split(' '))
ans = N

while True:
    if N >= K:
        d, m = divmod(N, K)
        if m == 0:
            print(0)
            exit(0)
        N = N - (K * d)
    else:
        N = K - N
    if ans > N:
        ans = N
    else:
        break
print(ans)

Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void){
  int X, Y, min, max, TF;
  TF = 0;
  scanf("%d %d", &X, &Y);

  min = X*2;
  max = X*4;

  if(min <= Y && Y <= max)
    TF = 1;

  if(Y%2 == 1) TF = 0;

  if(TF == 1) printf("Yes\n");
  else printf("No\n");

}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long int n;
    long long int ac=0,re=0,wa=0,tle=0;
    cin>>n;
    while(n--){
    	string s;
    	cin>>s;
    	if(s=="AC"){
    		ac++;
		}
		else if(s=="WA"){
			wa++;
		}
		else if(s=="RE"){
			re++;
		}
		else{
			tle++;
		}
	}
	cout<<"AC x "<<ac<<"\n";
	cout<<"WA x "<<wa<<"\n";
	cout<<"TLE x "<<tle<<"\n";
	cout<<"RE x "<<re;
	return 0;
}

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

using namespace std;


void solve(){
    int n, m, x, y, big = -1e9, small = 1e9 + 2;
    cin >> n >> m >> x >> y;
    bool war = false;
    for(int i = 0; i < n; ++i){
        int element;
        cin >> element;
        big = max(big, element);
    }
    int z = big + 1;
    for(int i = 0; i < m; ++i){
        int elemnt;
        cin >> elemnt;
        small = min(small, elemnt);

    }
    if(x < z && z <= y){
        if(z <= small){
            cout << "No War" << endl;
            return;
        }
    }
    cout << "War" << endl;
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,w; cin >> n >> w;
  long long knap[n][2];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < 2; j++)
        cin >> knap[i][j];
  //入力
  long long dp[n+1][w+1];
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= w; j++)
      dp[i][j] = 0;
  //dp表
  for (int i = 1; i <= n; i++){
    for (int j = 1; j <= w; j++){
      if (j >= knap[i-1][0])
        dp[i][j] = max(dp[i-1][j],dp[i-1][j-knap[i-1][0]]+knap[i-1][1]);
      else
        dp[i][j] = dp[i-1][j];
    }
  }
  cout << dp[n][w] << endl;
}

Measured memory_bytes: 79104
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>

using namespace std;
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 100000000;
const long long LINF = 1000000000000000000;
const long long MOD = 998244353;
const double EPS = 1e-6;
using pii = std::pair<int, int>;
using ll = long long;
using pLL = std::pair<ll, ll>;
#define SORT(v) std::sort(v.begin(), v.end())
#define RSORT(v) std::sort(v.rbegin(), v.rend())
constexpr auto PI = 3.14159265358979323846264338327950L;
int main() {
    string S;
    cin >> S;
    int N = S.size();
    long long res = 0;
    for (int bit = 0; bit < (1 << (N - 1)); ++bit) {
        long long tmp = 0;
        for (int i = 0; i < N - 1; ++i) {
            tmp *= 10;
            tmp += S[i] - '0';

            if (bit & (1 << i)) res += tmp, tmp = 0;
        }
        tmp *= 10;
        tmp += S.back() - '0';

        res += tmp;
    }
    cout << res << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int cnt;
int w, h;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
char tile[200][200];

void dfs(int x, int y);

int main()
{
	int x, y;

	while (true){
		scanf("%d %d", &w, &h);

		if (w == 0){
			break;
		}

		for (int i = 0; i < h; i++){
			scanf("%s", tile[i]);

			for (int j = 0; j < w; j++){
				if (tile[i][j] == '@'){
					y = i;
					x = j;
				}
			}
		}

		cnt = 0;
		dfs(x, y);

		printf("%d\n", cnt);
	}

	return (0);
}

void dfs(int x, int y)
{
	tile[y][x] = '#';
	cnt++;

	for (int i = 0; i < 4; i++){
		int nx = x + dx[i];
		int ny = y + dy[i];

		if (nx >= 0 && nx < w && ny >= 0 && ny < h && tile[ny][nx] == '.'){
			dfs(nx, ny);
		}
	}
}

Measured memory_bytes: 1208
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

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

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;

string button[10];

int main(void){
	button[1]=".,!? ";
	button[2]="abc";
	button[3]="def";
	button[4]="ghi";
	button[5]="jkl";
	button[6]="mno";
	button[7]="pqrs";
	button[8]="tuv";
	button[9]="wxyz";
	int t;
	cin >> t;
	rep(i,t){
		string in;
		cin >> in;
		int n=in.size();
		int cur=0,num=0;
		string ans="";
		rep(i,n){
			int tmp=in[i]-'0';
			if(tmp){
 				cur=tmp;
				num++;
			}else{
				if(cur){
					int p=button[cur].size();
					ans+=button[cur][(num-1)%p];
				}
				cur=0;
				num=0;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

signed main() {
    int h, w;
    while (cin >> h >> w and h and w) {
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) {
                cout << '#';
            }
            cout << endl;
        }
        cout << endl;
    }
}


Measured memory_bytes: 3084
use std::io;
use std::collections::BTreeSet;

fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split(' ')
        .map(|s| s.trim().parse().unwrap())
        .collect()
}
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

fn main() {

    let a = read_one::<String>();
    let mut bt = BTreeSet::new();
    for s in a.chars() {
        bt.insert(s);
    }
    if bt.len() == 3 {
        println!("Yes");
    } else {
        println!("No");
    }
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define pi 3.14159265359
#define int long long
#define pii pair<int,int>
const int mod=1e9 + 7;
 
int dx[]={-1, 0, 1, 0};
int dy[]={0, -1, 0, 1};



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


   string x,y; cin>>x>>y;
   cout<<y<<x;
}

Measured memory_bytes: 256
#include <iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;

int main()
{
    int  a=0,b=0,c=0;
    cin >> a >> b;
    if(a<b){
        swap(a,b);
    }
    while(b>0){
        c = a%b;
        a=b;
        b=c;
    }
    cout << a;
    cout << endl;
}

Measured memory_bytes: 1164
/* [Template].cpp 
Example code to use when starting new code. This particular problem was problem 
977A_Wrong_Subtraction from CodeForces

Compile: g++  -o D.exe D.cpp 
Execute: ./D
*/ 

#include <cstdio>
#include <iostream>
#include <cmath> 
#include <limits> 
#include <iomanip>
#include <cstring> 
#include <bits/stdc++.h>
#include <string>  
using namespace std;

int main() { 	
	long n, a[100000], q, b[100000], c[100000]; 
	long table[100001] = {0}; 
	long sum = 0; 
	
	// Input 
	cin >> n; 
	for(int i = 0; i < n; i++) {
		cin >> a[i]; 
		table[a[i]]++;		// Store number of occurrences of a[i]. 
		sum += a[i]; 		// Calculate sum of a[i] up front. 
	}
	cin >> q; 
	for(int i = 0; i < q; i++) {
		cin >> b[i] >> c[i]; 
	}
	
	/*
	for(int j = 0; j <= n; j++) 
		cout << table[j] << " "; 
	cout << endl; 
	*/
	
	// Work through q test cases
	for(int i = 0; i < q; i++) {
		sum = sum - b[i]*table[b[i]] + c[i]*table[b[i]]; 
		table[c[i]] += table[b[i]]; 
		table[b[i]] = 0; 
		cout << sum << endl; 
		/*
		for(int j = 0; j <= n; j++) 
			cout << table[j] << " "; 
		cout << endl; 
		*/
	}
	
	return 0; 
} 


Measured memory_bytes: 6696
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  string s;
  cin>>s;
  int n=s.size();

  int alp[3]={};
  for(int i=0;i<n;i++){
    alp[s[i]-'a']++;
  }

  int three=0,four=0;
  for(int i=0;i<3;i++){
    if(alp[i]==n/3) three++;
    else if(alp[i]==n/3+1) four++;
  }

  if(three==3-n%3&&four==n%3) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define reg register int
#define il inline
#define fi first
#define se second
#define mk(a,b) make_pair(a,b)
#define numb (ch^'0')
#define pb push_back
#define solid const auto &
#define enter cout<<endl
#define pii pair<int,int>
using namespace std;
typedef long long ll;
template<class T>il void rd(T &x){
    char ch;x=0;bool fl=false;while(!isdigit(ch=getchar()))(ch=='-')&&(fl=true);
    for(x=numb;isdigit(ch=getchar());x=x*10+numb);(fl==true)&&(x=-x);}
template<class T>il void output(T x){if(x/10)output(x/10);putchar(x%10+'0');}
template<class T>il void ot(T x){if(x<0) putchar('-'),x=-x;output(x);putchar(' ');}
template<class T>il void prt(T a[],int st,int nd){for(reg i=st;i<=nd;++i) ot(a[i]);putchar('\n');}
namespace Modulo{
const int mod=924844033;
il int ad(int x,int y){return x+y>=mod?x+y-mod:x+y;}
il int sub(int x,int y){return ad(x,mod-y);}
il int mul(int x,int y){return (ll)x*y%mod;}
il void inc(int &x,int y){x=ad(x,y);}
il void inc2(int &x,int y){x=mul(x,y);}
il int qm(int x,int y=mod-2){int ret=1;while(y){if(y&1) ret=mul(x,ret);x=mul(x,x);y>>=1;}return ret;}
template<class ...Args>il int ad(const int a,const int b,const Args &...args) {return ad(ad(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
}
using namespace Modulo;
namespace Miracle{
const int N=2002;
int f[N][N][2];
int n,k;
int jie[N];
int main(){
    rd(n);rd(k);
    f[0][0][0]=1;
    int now=1,tc=1;
    for(reg i=1;i<=n;++i){
    	for(reg j=0;j<=n;++j){
    		inc(f[i][j][0],ad(f[i-1][j][0],f[i-1][j][1]));
    		if(j&&now>k) inc(f[i][j][0],f[i-1][j-1][0]);
    		if(j&&now+k<=n) inc(f[i][j][1],ad(f[i-1][j-1][0],f[i-1][j-1][1]));
		}		
    	now+=2*k;
    	if(now>n) {
    		for(reg j=0;j<=n;++j){
    			inc(f[i][j][0],f[i][j][1]);
    			f[i][j][1]=0;
			}
			now=++tc;
		}
	}
	int ans=0;
	jie[0]=1;
	for(reg i=1;i<=n;++i) jie[i]=mul(jie[i-1],i);
	for(reg i=0;i<=n;++i){
		if(i&1) inc(ans,mod-mul(jie[n-i],f[n][i][0]));
		else inc(ans,mul(jie[n-i],f[n][i][0]));
	}
	ot(ans);
	return 0;
}

}
signed main(){
    Miracle::main();
    return 0;
}

/*
   Author: *Miracle*
*/

Measured memory_bytes: 31488
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
bool is_integer( double x ){
  return (floor(x)==x); 
}
 
int main() {

    int n;
    cin>>n;
    double a[n];
  	ll ai[n];
    vector<tuple<ll,ll,ll>>b;
    ll f[11][51][51];
    ll ans=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        int j=9;  
        ai[i]= floor(a[i]*1000000000+0.5);
        while(ai[i]%10==0){
            ai[i]/=10;
            j--;
            if(j==0)break;
        }
        b.push_back(make_tuple(j,0,0));
    }
    for(int i=0;i<n;i++){
        int j=0;       
        while(ai[i]%2==0){
            ai[i]/=2;
            j++;
        }
        get<1>(b[i])=j;
    }
    for(int i=0;i<n;i++){
        int j=0;       
        while(ai[i]%5==0){
            ai[i]/=5;
            j++;
        }
        get<2>(b[i])=j;
    }

  	for(int i=0;i<=10;i++){
        for(int j=0;j<=50;j++){
            for(int k=0;k<=50;k++){
                f[i][j][k]=0;
            }
        }
    }
  
    for(int i=0;i<n;i++){
      int x,y,z;
      tie(x,y,z)=b[i];
        f[x][y][z]+=1;
    }
    for(int i=0;i<=10;i++){
        for(int j=0;j<=50;j++){
            for(int k=0;k<=20;k++){
                for(int ii=0;ii<=10;ii++){
                    for(int jj=0;jj<50;jj++){
                        for(int kk=0;kk<=20;kk++){
                            if((i+ii)<=min(j+jj,k+kk)){
                              	if(i==ii&&j==jj&&k==kk){
                                  	ans+=f[ii][jj][kk]*(f[i][j][k]-1);
                                  
                                }else{
                              		ans+=f[ii][jj][kk]*f[i][j][k]; 
                                }
                            }
                        }
                    }
                }         
            }
        }
    }
    cout<<ans/2<<endl;


}

Measured memory_bytes: 12336
package main

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

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, bufio.MaxScanTokenSize*1024)
	log.SetFlags(log.Lshortfile)
}

func main() {
	N := nextInt()
	M := nextInt()
	Q := nextInt()
	A := make([]int, N)
	for i := 0; i < N; i++ {
		A[i] = 1
	}
	ques := make([]que, Q)
	for i := 0; i < Q; i++ {
		ques[i].a = nextInt() - 1
		ques[i].b = nextInt() - 1
		ques[i].c = nextInt()
		ques[i].d = nextInt()
	}
	ans := 0
	var dfs func([]int, int)
	dfs = func(a []int, idx int) {
		if idx == len(a) {
			sum := 0
			for _, q := range ques {
				if a[q.b]-a[q.a] == q.c {
					sum += q.d
					// log.Println(a)
				}
			}
			ans = max(ans, sum)
		} else {
			for i := a[idx-1]; i <= M; i++ {
				a[idx] = i
				dfs(a, idx+1)
			}
		}
	}
	for i := 1; i <= M; i++ {
		A[0] = i
		dfs(A, 1)
	}
	fmt.Println(ans)
}

type que struct {
	a, b, c, d int
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

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

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

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

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


Measured memory_bytes: 1780
#include <cstdio>
using namespace std;

int main(){
	int n;
	int f[201], s[201], t[201];
	int p[201] = {};
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d", &f[i]);
		scanf("%d", &s[i]);
		scanf("%d", &t[i]);
	}
	
	int u = 0;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (f[i] == f[j]){
				u++;
			}
		}
		if (u == 1){
			p[i] += f[i];
		}
		u = 0;
	}
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (s[i] == s[j]){
				u++;
			}
		}
		if (u == 1){
			p[i] += s[i];
		}
		u = 0;
	}
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (t[i] == t[j]){
				u++;
			}
		}
		if (u == 1){
			p[i] += t[i];
		}
		u = 0;
	}

	for (int i = 0; i < n; i++){
		printf("%d\n", p[i]);
	}

	return 0;
}

Measured memory_bytes: 1028
#include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>


using namespace std;

typedef long long ll;
typedef long double ld;

int s[1000];
set<ll> S;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }

  for(int i=1;i<=17;i++){
    for(int j=0;j<n;j++){
      if(j+i>n)break;
      ll v=0;
      for(int k=0;k<i;k++){
        v=v*10+s[j+k];
      }
      S.emplace(v);
      //cout<<v<<endl;
    }
  }
  ll key=-1;
  while(1){
    auto ub=S.upper_bound(key);
    if(*ub-key>1){
      cout<<key+1<<endl;
      return 0;
    }
    key=*ub;
  }
}


Measured memory_bytes: 3744
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



def main():
    k=[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(k[int(input())-1])

if __name__ == "__main__":
    main()

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

#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;

constexpr long long MOD = (long long)1e9 + 7;
constexpr long long MOD2 = 998244353;
constexpr long long HIGHINF = (long long)1e18;
constexpr long long LOWINF = (long long)1e15;
constexpr long double PI = 3.1415926535897932384626433L;

template <class T> vector<T> multivector(size_t N,T init){return vector<T>(N,init);}
template <class... T> auto multivector(size_t N,T... t){return vector<decltype(multivector(t...))>(N,multivector(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max(a,b);}
template <class T> void chmin(T& a, const T b){a=min(a,b);}
void YN(bool flg) {cout << (flg ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << (flg ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << (flg ? "yes" : "no") << endl;}

int main() {
    int X,N; cin >> X >> N;
    set<int> st;
    for(int i = 0; i < N; ++i) {
        int a; cin >> a;
        st.insert(a);
    }
    pair<int,int> ans={1234567,1234567},cnt;

    for(int i = 0; i < 200; ++i) {
        if(st.count(X+i)) continue;
        cnt = {i,X+i};
        chmin(ans,cnt);
    }
    for(int i = 0; i < 200; ++i) {
        if(st.count(X-i)) continue;
        cnt = {i,X-i};
        chmin(ans,cnt);
    }
    cout << ans.second << endl;
    return 0;
}


Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MAX 1000000
#define MOD 1000000007

vector<vector<int>> tree;
vector<ll> counter;

void solve(int v,int par){
  for(auto nv : tree.at(v)){
    if(nv==par){
      continue;
    }
    counter.at(nv)+=counter.at(v);
    solve(nv,v);
  }
}

int main(){
  int N,Q;
  cin>>N>>Q;
  tree.resize(N);
  for(int i=0;i<N-1;i++){
    int a,b;
    cin>>a>>b;
    a--;
    b--;
    tree.at(a).push_back(b);
    tree.at(b).push_back(a);
  }
  counter.resize(N,0);
  vector<int> p(N);
  for(int i=0;i<Q;i++){
    int p,x;
    cin>>p>>x;
    counter.at(p-1)+=x;
  }
  solve(0,0);

  for(int i=0;i<N;i++){
    cout<<counter.at(i)<<" ";
  }
  cout<<endl;
}


Measured memory_bytes: 28160
#include <iostream>
#include <vector>
#include <math.h>
#include <limits.h>

using namespace std;
int dist(int x1,int y1,int x2,int y2){
  return abs(x1-x2)+abs(y1-y2);
}

int main(){
  ios::sync_with_stdio(false);
  int N,M;
  vector<int> a,b,c,d;
  cin >> N >> M;
  a.resize(N);
  b.resize(N);
  c.resize(M);
  d.resize(M);
  for(int i=0;i<N;i++){ cin >> a[i] >> b[i]; }
  for(int j=0;j<M;j++){ cin >> c[j] >> d[j]; }
  for(int i=0;i<N;i++){
    int min=INT_MAX;
    int index=0;
    for(int j=0;j<M;j++){
      int distance = dist(a[i],b[i],c[j],d[j]);
      if(min >  distance ){
         min = distance;
         index=j;
      }
     }
     cout << index+1 << endl;
  }
  return 0;
}

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

using namespace std;

typedef long long int li;
typedef long double ld;
typedef vector<li> vi;
typedef pair<li,li> pi;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define B begin()
#define E end()
#define f(i,l,r) for(li i=l;i<=r;++i)
#define fr(i,l,r) for(li i=l;i>=r;--i)
#define u_map unordered_map
#define endl "\n"

li fastpow(li base,li exp,li M) 
{
    li res=1;
    while(exp>0) {
        if(exp&1)
            res=(res*base)%M;

        base=(base*base)%M;
        exp>>=1;
    }
    return res;
}

int main()
{    

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

    li n,m;

    cin>>n>>m;

    char a[n][m];

    f(i,0,n-1)
    {
        f(j,0,m-1)
        {
            cin>>a[i][j];
        }
    }

    vector<vi> dp(n,vi(m,0));

    dp[0][0]=1;

    li M=1e9+7;

    f(i,0,n-1)
    {
        f(j,0,m-1)
        {
            if(i+j==0)
                continue;

            if(a[i][j]=='.')
            {
                li tp=0,tp2=0;

                if(j>0)
                    tp=dp[i][j-1];

                if(i>0)
                    tp2=dp[i-1][j];

                dp[i][j]=(tp2+tp)%M;
            }
            else
            {
                dp[i][j]=0;
            }
        }
    }

    cout<<dp[n-1][m-1];

    return 0;
}

Measured memory_bytes: 9088
def m(L,R):
 global c
 i=j=0
 for _ in L[:-1]+R[:-1]:
  if L[i]<R[j]:yield L[i];i+=1
  else:yield R[j];j+=1
  c+=1
def d(A):
 s=len(A)//2
 if len(A)>1:A[:]=m(d(A[:s])+[1e9],d(A[s:])+[1e9])
 return A
c=0
input()
print(*d(list(map(int,input().split()))))
print(c)


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

template <class T>
void chmax(T &x,T y)
{
    x=max(x,y);
}

const int mod=1e9+7;
long long mpow(long long x, int y)
{
    long long res=1;
    while(y)
    {
        if(y&1) (res*=x)%=mod;
        x*=x;
        x%=mod;
        y/=2;
    }
    return res;
}

main()
{
    const int siz=1<<20;
    long long fa[siz]={1},ifa[siz];
    for(int i=1; i<siz; i++) fa[i]=fa[i-1]*i%mod;
    ifa[siz-1]=mpow(fa[siz-1],mod-2);
    for(int i=siz-1; i>0; i--)
    {
        ifa[i-1]=ifa[i]*i%mod;
    }

    int n; cin>>n;
    int m; cin>>m;
    i64 ans=0;
    for(int i=0; i<=n; i++)
    {
        long long bi=fa[n]*ifa[i]%mod*ifa[n-i]%mod;
        i64 bi2=fa[m]*ifa[m-i]%mod;
        i64 prd=fa[m-i]*ifa[m-n]%mod;
        i64 tmp=bi*bi2%mod*prd%mod*prd%mod;
        if(i&1) ans-=tmp;
        else ans+=tmp;
    }
    ans%=mod;
    if(ans<0) ans+=mod;
    cout << ans << "\n";
}

Measured memory_bytes: 20008
require 'prime'
class NCK_mod
  def initialize(mod)
    raise "incompatible error" unless mod.prime?
    @MOD = mod
    @fac = [1,1]
    @finv = [1,1]
    @inv = [0,1]
    @n = 1
  end

  def prepare(n)
    return if @n >= n
    (@n+1..n).each{|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;
    }
    @n = n
  end

  def calc(n,k)
    raise "range error" if n < 0 || k < 0
    raise "incompatible error" if n >= @MOD
    return 0 if n < k
    prepare(n)
    return @fac[n] * (@finv[k] * @finv[n - k] % @MOD) % @MOD;
  end
end

x,y=gets.split.map(&:to_i)

kkk = [(2*x-y),(2*y-x)].min
if kkk < 0 || kkk % 3 != 0 
  p 0
  exit
end

k = kkk/3
n = (x+y)/3
nCk = NCK_mod.new(1000000007)

p nCk.calc(n,k)


Measured memory_bytes: 19300
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln = '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll X,K; cin >> X >> K;
    vector<ll> r(K+1);
    rep(i,K) cin >> r[i+1];

    vector<ll> L(K+1),R(K+1,X),A(K+1),A0(K+1),AX(K+1,X);
    rep(i,K) {
        L[i+1] = L[i];
        R[i+1] = R[i];       
        if (~i&1) {
            A[i+1] = A[i]-(r[i+1]-r[i]);
            A0[i+1] = max(0LL,A0[i]-(r[i+1]-r[i]));
            AX[i+1] = max(0LL,AX[i]-(r[i+1]-r[i]));
        } else {
            A[i+1] = A[i]+(r[i+1]-r[i]);
            A0[i+1] = min(X,A0[i]+(r[i+1]-r[i]));
            AX[i+1] = min(X,AX[i]+(r[i+1]-r[i]));
        }
        if (A[i+1] <= 0) chmax(L[i+1],-A[i+1]);
        if (A[i+1] >= 0) chmin(R[i+1],X-A[i+1]);
    }
    int Q; cin >> Q;
    while (Q--) {
        ll t,a;
        cin >> t >> a;
        int k = upper_bound(all(r),t) - r.begin();
        k--;
        ll ans = 0;
        if (a <= L[k]) {
            ans = A0[k];
        } else if (a >= R[k]) {
            ans = AX[k];
        } else {
            ans = a + A[k];
        }
        if (k&1) ans = min(X,ans+(t-r[k]));
        else ans = max(0LL,ans-(t-r[k]));
        cout << ans << ln;
    }
}


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

int main(){
    ll N,K;
  cin >>N>>K;
  vector<ll> H;
  ll a;
  for(int i=0;i<N;i++){
    cin>>a;
H.push_back(a);
  }
sort(H.begin(),H.end());//昇順ソート
ll sum=0;
  for(int i=0;i<N-K;i++){
  sum=sum+H[i];
  }
  cout<<sum<<endl;
  
}

Measured memory_bytes: 2420
#include <iostream>
#include <string>
#define maxn 1000006
using namespace std;
string s, t;
int q[maxn];
int main(){
	int n;
	cin >> n >> s >> t;
	if (s == t){
		cout << 0 << endl;
		return 0;
	}
	int ans = 0, head = 1, tail = 0;
	for (int i = n - 1, pos = n - 1; i >= 0; -- i){
		if (i && t[i] == t[i - 1])
			continue;
		pos = min(pos, i);
		while (pos >= 0 && s[pos] != t[i])
			-- pos;
		if (pos == -1){
			cout << -1 << endl;
			return 0;
		}
		while (head <= tail && q[head] - (tail - head + 1) + 1 > i)
			++ head;
		q[++ tail] = pos;
		if (i != pos)
			ans = max(ans, tail - head + 1);
	}
	cout << ans + 1 << endl;
}


Measured memory_bytes: 6280
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) ((int)(a).size())
#define F first
#define S second
typedef pair<int,int> PI;

int m,n;

PI app[5100000];
int nu[2000][2000];

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

bool isp[5000000];

PI vis[2000][2000];

void solve(){
  queue<PI> q;
  q.push(app[n]);//nu,-tu
  memset(vis,0,sizeof(vis));
  int a=0,b=0;

  if(isp[n])
    vis[app[n].F][app[n].S]=mp(1,n);
  
  while(!q.empty()){
    int cx = q.front().F;
    int cy = q.front().S;
    q.pop();
    if(nu[cx][cy]>m) continue;
    if(vis[cx][cy]!=mp(0,0) && !q.empty()) continue;
    
    if(nu[cx-1][cy-1]<=m){
      vis[cx][cy]=max(vis[cx][cy],
                      mp(vis[cx-1][cy-1].F+isp[nu[cx][cy]],
                         isp[nu[cx][cy]]?nu[cx][cy]:vis[cx-1][cy-1].S));
    }
    
    if(nu[cx-1][cy]<=m){
      vis[cx][cy]=max(vis[cx][cy],
                      mp(vis[cx-1][cy].F+isp[nu[cx][cy]],
                         isp[nu[cx][cy]]?nu[cx][cy]:vis[cx-1][cy].S));
    }
    
    if(nu[cx-1][cy+1]<=m){
      vis[cx][cy]=max(vis[cx][cy],
                      mp(vis[cx-1][cy+1].F+isp[nu[cx][cy]],
                         isp[nu[cx][cy]]?nu[cx][cy]:vis[cx-1][cy+1].S));
    }    
    
    
    //cout << cx << " " << cy << " " << num << " " << last << endl;    
    //vis[cx][cy] = mp(num,last);
    if(mp(a,b) < vis[cx][cy]){
      a=vis[cx][cy].F;
      b=vis[cx][cy].S;
    }
    
    q.push(mp(cx+1,cy+1));
    q.push(mp(cx+1,cy));
    q.push(mp(cx+1,cy-1));
    
  }

  
  cout << a << " " << b << endl;
}

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

int main(){
  // rep(i,100) cout << i << ispr(i) << endl;
  // return 0;
  int cx=1000,cy=1000;
  int dir = 0;
  rep(i,2100000){
    nu[cx][cy]=i+1;
    isp[i+1]=ispr(i+1);
    //cout << cx << " " << cy << endl;
    app[i+1]=mp(cx,cy);
    cx += dx[dir];
    cy += dy[dir];
    if(!nu[cx+dx[dir+1]][cy+dy[dir+1]])
      dir=(dir+1)%4;
  }
  
  rep(i,10){
    rep(j,10){
      //printf("%5d %d",nu[1000+i-5][1000+j-5],isp[nu[1000+i-5][1000+j-5]]);
      //cout << nu[1000+i-5][1000+j-5] << " ";
    }
    //cout << endl;
  }
  
  //return 0;
  
  while(cin >> m >> n && n) solve();
}

Measured memory_bytes: 90804
N = int(input())
S = input()
ans = 0
for i in range(1000):
    i = str(i).zfill(3)
    match = 0
    idx = 0
    for s in S:
        if i[idx] == s:
            match += 1
            idx += 1
        if match == 3:
            break
    if match == 3:
        ans += 1
print(ans)

Measured memory_bytes: 42520
"""
A個口の電源タップをいくつか使って未使用の差込口をB口以上に拡張
A個口の電源タップ1つと未使用の差込口1口を使って、新たに差込口をA口増やすことができます。
"""

data = list(map(int, input().split()))
a = data[0]
b = data[1]

q = (b-a) // (a-1)
mod = (b-a) % (a-1)

ans = 0

if mod == 0:
  ans = q + 1
else:
  ans = q + 2

print(ans)

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

int main() 
{
    // How to add to a vector of pairs?
    int n;
    cin >> n;
    vector<int> v(n);
    vector<int> w(n);
    for (int i=0; i<n; i++)
        cin >> v[i];
    for (int i=0; i<n; i++)
        cin >> w[i];
    int sum = 0;
    // Be careful of if1 if2 else1 as else2
    for (int i=0; i<n; i++)
        if (v[i]-w[i] > 0)
            sum += v[i]-w[i];
    cout << sum;    
    return 0;
}

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

int main()
{
	int x,y,z;
	int arr[3];
	for(int i=0;i<3;i++){
		cin>>arr[i];
	}
	std::sort(arr,arr+3);
	 
	
	int s=(arr[2]*10+arr[1])+arr[0];
	cout<<s;

	 
	return 0;
}


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

// Begin {{{
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (i64 i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (i64 i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<>>;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
inline i64 sigma(i64 n) { return n * (1 + n) >> 1; }
inline i64 updiv(i64 n, i64 d) { return (n + d - 1) / d; }
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;
#ifndef DEBUG
#define dump(...)
#endif

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
  cin >> head;
  input(forward<Tail>(tail)...);
}

inline void outs() { cout << "\n"; }
template <class Head, class... Tail>
inline void outs(Head&& head, Tail&&... tail) {
  cout << head << (sizeof...(tail) ? " " : "");
  outs(forward<Tail>(tail)...);
}

template <class T>
inline void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e == &vec.back()]; }

template <class T>
inline void outs(vector<vector<T>> &df) { for (auto &vec : df) outs(vec); }

inline void outl() { cout << "\n"; }
template <class Head, class... Tail>
inline void outl(Head&& head, Tail&&... tail) {
  cout << head << (sizeof...(tail) ? "\n" : "");
  outl(forward<Tail>(tail)...);
}

template <class T>
inline void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

inline void outn() {}
template <class Head, class... Tail>
inline void outn(Head&& head, Tail&&... tail) {
  cout << head;
  outn(forward<Tail>(tail)...);
}

template <class T>
inline void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

template <class T>
inline vector<T> make_v(const T &initvalue, size_t sz) {
  return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
  return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}
// }}} End

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

  var(string, s, s1, s2);

  string res;
  res.push_back(s[0]);
  res.push_back(s1[0]);
  res.push_back(s2[0]);

  for (auto &e : res) {
    e = toupper(e);
  }

  outl(res);

  return 0;
}


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

using namespace std;

int main(){
  int N;
  cin >> N;
  
  map<long long, long long> m;
  long long sum = 0;
  for(int i = 0; i < N; i++){
    int A;
    cin >> A;
    m[A]++;
    sum += A;
  }
  
  int Q;
  cin >> Q;
  while(Q--){
    int B, C;
    cin >> B >> C;
    
    sum -= m[B] * B;
    sum += m[B] * C;
    m[C] += m[B];
    m[B] = 0;
    cout << sum << endl;
  }
  
  return 0;
}

Measured memory_bytes: 9368
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	int i,j;

	int n,k;
	cin >> n >> k;

	if(n<=11){
	int a=0;
	for(i=1;i<=n-2;i++){
		for(j=1;j<=5;j++){
			if((9*(7*i+j-7)+72)%11==k){ a++;

			}
		}
	}

	cout << a << endl;
	return 0;

	}

	ll s=0;
	for(i=1;i<=11;i++){
		for(j=1;j<=5;j++){
			if((9*(7*i+j-7)+72)%11==k) s++;
		}
	}

	int x=n/11,y=n%11;
	ll r=0;
	for(i=1;i<=y-2;i++){
		for(j=1;j<=5;j++){
			if((9*(7*i+j-7)+72)%11==k) r++;
		}
	}

	ll t9=0;
	for(i=1;i<=9;i++){
		for(j=1;j<=5;j++){
			if((9*(7*i+j-7)+72)%11==k) t9++;
		}
	}

	ll t10=0;
	for(i=1;i<=10;i++){
		for(j=1;j<=5;j++){
			if((9*(7*i+j-7)+72)%11==k) t10++;
		}
	}

	if(y==0) cout << s*((ll)(x-1LL))+t9 << endl;
	else if(y==1) cout << s*((ll)(x-1LL))+t10 << endl;
	else cout << s*((ll)x)+r << endl;

	return 0;
}


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

int main(){
    int X;
    cin>>X;
    cout<<10-X/200<<endl;
    return 0;
}

Measured memory_bytes: 3592
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
using namespace std;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)
#define rrep(i,a,b) for(int (i)=int(a);(i)>=int(b);(i)--)

#define put(a) cout << (a) << endl
#define puts(a) cout << (a) << " "

#define llint long long int

#define INF (long long)1e9+1
#define MOD (long long)1e9+7
#define INF64 (long long)1e18+1

#define F first
#define S second

#define Pii  pair<int,int>
#define Pll  pair<long long,long long>
#define Piii pair<int,pair<int,int>>
#define Plll pair<long long,pair<long long,long long>>

#define Vll(a,b,c)    vector<vector<long long>> (a)((b),vector<long long>((c))
#define Vlll(a,b,c,d) vector<vector<vector<long long>>> (a)((b),vector<vector<long long>>((c),vector<long long>((d)))

#define MAX_N 1000000

int main (void)
{
	//INPUT
	llint N;
	cin >> N;
	vector<llint> H(N);
	rep(i,0,N) {
		llint bufh;
		cin >> H[i];
	}

	//SOLVE
	llint ans = 0;
	llint now;
	llint bufa;
	for(now=0;now<N;now++) {
		// auto itl = upper_bound(H.begin()+now,H.end(), H[now]);
		// bufa = H.end() - (H.begin()+now);
		// ans = max(ans,bufa);
		// now = now + bufa -1;
		bufa=0;
		for(int i = now; i<N-1;i++) {
			if (H[i] >= H[i+1]) {
					bufa++;
			} else {
				break;
			}
		}

		now += bufa;

		ans = max(ans,bufa);
	}

	//OUTPUT
	cout << ans << endl;



	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A,B,C,K;
  cin >> A >> B >> C >> K;
  if(A > K){
    cout << K << endl;
  }
  else{
    K-=A;
    if(B > K){
      cout << A << endl;
    }
    else{
      K-=B;
      cout << A-K << endl;
    }
  }
}



Measured memory_bytes: 3636
#import numpy as np
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop
import bisect

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

A = list(map(int,input().split()))

A = sorted(A)

if A[0] == A[1] and A[1] != A[2]:
  print('Yes')
elif A[0] != A[1] and A[1] == A[2]:
  print('Yes')
else:
  print('No')










Measured memory_bytes: 65132
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int n;

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

  ll ans = 0;
  for(int a = 1; a <= n; a++) {
    for(int b = 1; b <= n; b++) {
      if (n <= a*b) break;
      ans ++;
    }
  }

  COUT(ans);
  return 0;
}


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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;
using PP = pair<int, pair<int, int> >;

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

const int INF = 1e9;
const int INFLL = 1e18;
const int MOD = 1e9 + 7;

const int MAX_V = 1e5 + 10;

struct Edge{
    int to, cost;
};

vector<Edge> G[MAX_V];
int d[MAX_V];

signed main(){
    int V, E, r; cin >> V >> E >> r;
    REP( i, E ){
        int from, to, cost; cin >> from >> to >> cost;
        G[from].emplace_back( Edge{ to, cost } );
    }

    fill( d, d + MAX_V, INF );
    d[r] = 0;

    priority_queue<P, vector<P>, greater<P>> que;
    que.emplace( 0, r );
    while( !que.empty() ){
        P p = que.top(); que.pop();
        int v = p.second;
        if( p.first > d[v] ) continue;
        for( auto nv : G[v] ){
            if( chmin( d[nv.to], d[v] + nv.cost ) ){
                que.emplace( d[nv.to], nv.to );
            }
        }
    }

    REP( i, V ){
        if( d[i] != INF ) cout << d[i] << endl;
        else cout << "INF" << endl;
    }
}



Measured memory_bytes: 19504
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val (t, a) = readLine()!!.split(" ").map(String::toInt)
    val hs = readLine()!!.split(" ").map(String::toInt)

    var idx = 0
    var d = 100000.0
    for (i in 0..n-1) {
        val result = t - (hs[i] * 0.006)
        var ds =  Math.abs(a - result)
        if (ds == d) {
            idx = i + 1
            break;
        }

        if ( ds < d) {
            d = ds
            idx = i + 1
        }
    }

    println("$idx")
}


Measured memory_bytes: 36076
<?php
fscanf(STDIN, "%d", $number); // STDIN から数値を読み込む
fscanf(STDIN, "%d %d", $number2,$number3); // STDIN から数値を読み込む
//$number = 10;
//$number2 = 15;
//$number3 = 30;

$x1 = (int)($number2 / $number);
$x2 = (int)($number3 / $number);
//echo "x1:$x1 x2:$x2";
for($i = 0;$i < 1000; $i++){
$n = $i*$number;
if($n >= $number2 && $n <= $number3) {
   $f = 1;
break;
  }else{
  $f = 0;
  }


}


if($f){
echo "OK";
}else{
echo "NG";
}


?>

Measured memory_bytes: 16184