akhauriyash/Code-Regression huggingface dataset:
// RAKSHIT KADAM
 
//  -- Declare array globally...
 #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int ,  null_type ,  less<int> ,  rb_tree_tag ,  tree_order_statistics_node_update>
// find_by_order returns iterator to  element present at that index...
// order_of_key returns no. of elements having value stricktly less than that given in the order_of_key();
#warning !!!check the size of arrayss!!!
 
// NUMERIC DEFINITIONS :
    #define INF 1000000000000000005
    #define inf 1000000003
    #define MOD  1000000007
    #define newMOD  998244353
    #define MAX 200006
    #define pi 3.1415926535897932384626433832795
#define ld long double
 #define ll long long
 #define int long long
 
 #define P(gg) for(auto rax:gg){cout<<rax<<" ";}cout<<endl;
 #define Need_for_speed(activated) ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
 #define satisfy ll t; cin>> t; while(t--)
 #define inp(n) int n;cin >> n
 #define mp make_pair
 #define pb push_back
 #define endl "\n"
 #define x first
 #define y second
 #define fore(i,a,b) for(ll i=a;i<b;i++)
 #define forci(i,n) for(ll i=0;i<n;i++)
 #define vi vector<ll>
 #define Endl endl
 #define lb lower_bound
 #define ub upper_bound
#define pii pair<ll,ll>
 
 #define input freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout)
 #define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
int power(int x, unsigned int y, unsigned int m){ if (y == 0) return 1;int p = power(x, y/2, m) % m;  p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m;}
ll modInverse(int a, int m){{ return power(a, m-2, m);}}
const int maxn = 500066;

 vi v[maxn];
void solve()
{
    ll n,m;cin>>n>>m;
    ll cost[m+2];
   
    for(ll i=0;i<m;i++)
    {
        cin>>cost[i];
        ll x,c;cin>>x;
        while(x--)
        {
            cin>>c;
            v[i].pb(--c);
        }
    }
    ll dp[5005];
    for(ll i=0;i<=5000;i++)dp[i]=1e9;
    dp[0]=0;
    for(ll i=0;i<m;i++)
    {
        ll cur_mask = 0;
        for(auto it:v[i])
            cur_mask|=(1<<it);
        for(ll j=0;j<(1<<n);j++)
        {
            dp[j|cur_mask] =  min(dp[j|cur_mask],dp[j]+cost[i]);
        }
    }
    if(dp[(1<<n)-1]>=1e9)dp[(1<<n)-1]=-1;
    cout<<dp[(1<<n)-1];
}

signed main()
{
   Need_for_speed(activated);

//satisfy
//    {
//  solve();
//   }
   
    solve();
    return 0;
}


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

#ifdef DEBUG
#define NDEBUG
#include "cout11.h"
#endif
#undef NDEBUG
#include <cassert>

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))



#define INTSPACE 11
char _buf[INTSPACE*1000000 + 3];

int loadint() {
    if (fgets(_buf, INTSPACE+3, stdin)==NULL) return 0;
    return atoi(_buf);
}
int loadvec(vector<int>& v, int N=-1) {
    if (N == -1) {
        N = loadint();
        if (N==0) return 0;
    }
    int bufsize = INTSPACE*N + 3;
    if (fgets(_buf, bufsize, stdin)==NULL) return 0;
    v.resize(N);

    int i=0;
    bool last = false;
    for (char *p=&_buf[0]; ;) {
        char *q = p;
        while (*q > ' ') ++q;
        if (*q == 0x0D || *q == 0x0A) last = true;
        *q = 0;
        v[i++] = atoi(p);
        if (last || i == N) break;
        p = q+1;
    }
    // assert(i <= N);
    return i;
}


#define INF 0x7fffffffLL
// 100000 x 199 = 19900000 ; 2e7; x7 = 1.4e8

int main() {
    vector<int> tmp(3);
    loadvec(tmp, 3);
    int N=tmp[0], M=tmp[1], R=tmp[2];
    assert(IN(N,2,200));
    assert(IN(M,1,19900));
    assert(IN(R,2,min(8,N)));

    vector<int> r(R);
    loadvec(r, R); rep(i,R) --r[i];

    vector<vector<ll>> d(N, vector<ll>(N, INF));
    rep(i,N) d[i][i] = 0LL;

    rep(m,M){
        loadvec(tmp, 3);
        int a=tmp[0], b=tmp[1], c=tmp[2];
        assert(IN(a,1,N));
        assert(IN(b,1,N));
        assert(a != b);
        assert(IN(c,1,100000));
        --a; --b;
        d[a][b] = d[b][a] = c;
    }
    rep(k,N) rep(i,N) rep(j,N) { // 8e6
        if (d[i][j] > d[i][k] + d[k][j]) {
            d[i][j] = d[i][k] + d[k][j];
        }
    }

    // assert(IN(R,2,8));
    sort(ALL(r));
    ll best = INF*9;
    do {
        ll dtotal = 0;
        rep(i, R-1) {
            dtotal += d[r[i]][r[i+1]];
        }
        best = min(best, dtotal);
    } while (next_permutation(ALL(r)));
    cout << best << endl;
    return 0;
}


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

int main(){
  string data;
  vector<string> d;
  int n,len;
  cin>>n>>len;
  for(int i=0;i<n;i++){
    cin>>data;
    d.push_back(data);
  }
  sort(d.begin(),d.end());
  for(int i=0;i<n;i++){
    cout<<d[i];
  }
}

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


int main(){

  lint N,K;
  cin >> N >> K;
  
  vector<lint> A(N);
  for(int i=0; i<N; i++){
    cin >> A[i];
    A[i]--;
  }
  
  lint place = 0;
  vector<lint> history(1,0);
  vector<bool> been(N,false);
  been[0] = true;
  
  while(true){
    place=A[place];
    history.push_back(place);
    if(been[place] == true) break;
    been[place] = true;
  }
  
  lint big = history.size()-1;
  lint small;
  
  for(int i=0; i<=big; i++){
    if(history[big]==history[i]){
      small = i;
      break;
    }
  }
  
  lint loop = big - small;
  
  lint ans = 0;
  
  if(K<=small){
    for(int i=0; i<K; i++){
      ans = A[ans];
    }
    cout << ans+1 << endl;
  }
  else{
    K = (K - small) % loop;
    ans = history[small];
    
    for(int i=0; i<K; i++){
      ans = A[ans];
    }
    cout << ans+1 << endl;
  }
}
    


Measured memory_bytes: 6896
#include <iostream>

using namespace std;

int main(void) {

	char S[5];

	cin >> S;

	char str = S[0];

	for (int i = 1; i < 4; ++i) {
		
		if (S[i] == str) {
			cout << "Bad" << endl;
			return 0;
		}
		str = S[i];
	}

	cout << "Good" << endl; 
	return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max<R>(x,0.0));}

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

// Problem Specific Parameter:
const ll inf=1LL<<60;
ll x[200010];
ll dp[200010];

// Description: セグメント木　点更新 区間クエリ 
// TimeComplexity: 初期化$\mathcal{O}(n \log n)$ 更新とクエリ$\mathcal{O}(\log n)$
// Verifyed: AOJ DSL_2_A

struct Segment_tree{
    using T=ll;

    int n;
    vector<T> data;
    const T out=(1LL<<50)-1;

    inline T vmerge(T l,T r){return min(l,r);}

    Segment_tree(int n):n(n){data.assign(2*n,out);}

    void update(int p,T x) {  // set value at position p
        for(data[p+=n]=x; p > 1; p >>= 1) data[p>>1]=vmerge(data[p],data[p^1]);
    }

    T query(int l, int r) {  // sum on interval [l, r)
        T resl = out,resr = out;
        for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
            if (l&1) resl = vmerge(data[l++], resl);
            if (r&1) resr = vmerge(resr, data[--r]);
        }
        return vmerge(resl,resr);
    }
};


int main(void){
	ll n,e,t;
	cin >> n >> e >> t;
	rep(i,1,n+1) cin >> x[i];
    x[n+1]=e;

    Segment_tree seg(n+1);

    int lft=0;
    seg.update(0,-2*x[1]);

	rep(i,1,n+1){
        dp[i]=inf;
        while(lft<i and 2*(x[i]-x[lft+1])>t) lft++;
		dp[i]=min(2*x[i]+seg.query(0,lft),dp[lft]+t);
        seg.update(i,dp[i]-2*x[i+1]);
	}

	cout << dp[n]+e << endl;

	return 0;
}

Measured memory_bytes: 3456
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <set>
#include <map>
#include <queue>

#define sz(v) int(v.size())
#define sqr(x) ((x) * (x))

using ll = long long;
using ld = long double;
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

template <class T>
using indexed_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T1, class T2>
istream& operator >> (istream &in, pair <T1, T2> &a) {
    in >> a.first >> a.second;
    return in;
}

template <class T1, class T2>
ostream& operator << (ostream &out, pair <T1, T2> &p) {
    out << p.first << ' ' << p.second;
    return out;
}

template <class T>
istream& operator >> (istream &in, vector <T> &a) {
    for (T &i: a) in >> i;
    return in;
}

template <class T>
ostream& operator << (ostream &out, vector <T> &a) {
    for (T i : a) out << i << ' ';
    return out;
}

void fastIO() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr); cout.tie(nullptr);
}

void solve();

int main() {
    fastIO();

    int t = 1;
    ///cin >> t;
    for (int i = 0; i < t; ++i) solve();

    return 0;
}

void solve() {

    int n, m;
    cin >> n >> m;
    if (n > m) cout << "safe";
    else cout << "unsafe";

}

/// ЗАПУСКАЕМ ГУСЯ
/*
     ▄▀▀▀▄
▄███▀░◐░░░▌
    ▌░░░░░▐
    ▐░░░░░▐
    ▌░░░░░▐▄▄
    ▌░░░░▄▀▒▒▀▀▀▀▄
   ▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
   ▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
    ▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄
      ▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄
           ▌▌░▌▌
           ▌▌░▌▌
         ▄▄▌▌▄▌▌        */

Measured memory_bytes: 3640
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) std::memset(arg,n,sizeof(arg))
#define mp(a,b) std::make_pair(a,b)
#define pb push_back
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
typedef std::string str;
const int INF=1e+9;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int H,W;
char S[2010][2010];
int yo[2010][2010];
int ta[2010][2010];
vi v[2010];
vi vv[2010];
int main(){
  cin>>H>>W;
  rep(i,H){
    rep(j,W){
      cin>>S[i][j];
    }
  }
  rep(i,H){
    int cnt=0;
    rep(j,W){
      if(S[i][j]=='.') cnt++;
      else{
	if(cnt==0) continue;
	else{
	  v[i].pb(cnt);
	  cnt=0;
	}
      }
    }
    if(cnt==0) continue;
    else{
      v[i].pb(cnt);
    }
  }
  rep(i,H){
    int k=0;
    bool f=false;
    rep(j,W){
      if(S[i][j]=='.'){
	yo[i][j]=v[i][k];
	f=true;
      }
      else if(f){
	yo[i][j]=0;
	k++;
	f=false;
      }
    }
  }
 rep(j,W){
    int cnt=0;
    rep(i,H){
      if(S[i][j]=='.') cnt++;
      else{
	if(cnt==0) continue;
	else{
	  vv[j].pb(cnt);
	  cnt=0;
	}
      }
    }
    if(cnt==0) continue;
    else{
      vv[j].pb(cnt);
    }
  }
  rep(j,W){
    int k=0;
    bool f=false;
    rep(i,H){
      if(S[i][j]=='.'){
	ta[i][j]=vv[j][k];
	f=true;
      }
      else if(f){
	ta[i][j]=0;
	k++;
	f=false;
      }
    }
  }
  /*
  rep(i,H){
    rep(j,W){
      std::cout<<yo[i][j];
    }
    std::cout<<"\n";
  }
  rep(i,H){
    rep(j,W){
      std::cout<<ta[i][j];
    }
    std::cout<<"\n";
  }  
  */
  int res=0;
  rep(i,H){
    rep(j,W){
      if(yo[i][j]==0||ta[i][j]==0) continue;
      else{
	int temp=yo[i][j]+ta[i][j]-1;
	res=std::max(temp,res);
      }
    }
  }
  prin(res);
  return 0;
}


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

int main(){

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

   	int n;
   	cin>>n;

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

   	vector<int> toadd;

   	int solarr[n];
   	memset(solarr,0,sizeof(solarr));

   	for(int i=n;i>=1;i--){
   		int curr=0;
   		for(int j=2;i*j<=n;j++){
   			curr^=solarr[i*j-1];
   		}

   		if(curr==arr[i-1]){
   			solarr[i-1]=0;
   		}
   		else{
   			solarr[i-1]=1;
   			toadd.push_back(i);
   		}
   	}

   	cout<<toadd.size()<<endl;
   	for(int i=0;i<toadd.size();i++){
   		cout<<toadd[i]<<" ";
   	}
   	cout<<endl;
}

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

 int main(){
    int arr[100000];
    int H , N, M=0;
    cin>>H>>N;
    for(int i=0;i<N;i++){
        cin>>arr[i];
    }for(int i=0 ; i<N;i++){
        M+=arr[i];

    }if(H-M<=0){
        cout<<"Yes";
    }else {
         cout << "No";
     }}

Measured memory_bytes: 640
k,a,b=map(int,input().split())
if b-a<=2:
    print(1+k)
else:
    if 1<=k<=a-1:
        print(1+k)
    else:
        s=k-(a-1)
        if s%2==0:
            print(a+(b-a)*(s//2))
        else:
            print(1+a+(b-a)*(s//2))


Measured memory_bytes: 2940
#include<stdio.h>
int main()
{ char S[200001],T[200001];
 int i=0;
 int count = 0;
 scanf("%s%s",S,T);
 for(i=0;i<strlen(S);i++)
 {
   if(S[i]!=T[i])
   { 
     count = count+1;
   }
 }
 printf("%d",count);
 return 0;
}
    
 


Measured memory_bytes: 2092
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

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

Measured memory_bytes: 3572
#写経させていただきました。
def spin(p):
    ret = [[None] * 8 for _ in range(8)]
    for i in range(8):
        for j in range(8):
            ret[i][j] = p[7 - j][i]
    return ret

def print_p(p):
    for line in p:
        print("".join(line))

p = [input() for _ in range(8)]

print(90)
p = spin(p)
print_p(p)

print(180)
p = spin(p)
print_p(p)

print(270)
p = spin(p)
print_p(p)


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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define rep(i, a) for (int i=0; i<(a); i++) 
#define ub        upper_bound            // first element >  val(itr)
#define lb        lower_bound            // first element >= val(itr)

#define mp make_pair
#define pb push_back
#define pi 3.141592653589793
#define endl "\n"
#define FAST ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define bitcount(a) __builtin_popcount(a) // count set bits
#define all(x) (x).begin(),(x).end()

const ll MOD = 1e9 + 7;
const int inf = 1e9+9;
const long long INF = 1e18+3;

//to debug 
#define dbg(x) cout << "Line " << __LINE__ << " | " #x ": " << (x) << endl

template<typename T> T gcd(T a,T b){ if(b>a) return gcd(b,a);return b==0?a:gcd(b,a%b); }
template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template<typename T> T fast_power(T x,T y,ll m=MOD){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

inline ll mod(ll x,ll n) {if (x < n) return x; if (x >= n) return x - n;}
string IntToString(ll a){ ostringstream temp; temp << a; return temp.str();}
ll findMMI_fermat(ll n,ll M) {ll ans= fast_power(n,M-2,M);return ans;}//i.e In (a/b)%M..it calculates MMI of b wrt M
ll add(ll a,ll b,ll M)  { return ( mod(a,M ) + mod(b,M ))%M;     }
ll sub(ll a, ll b,ll M) { return (mod(a,M ) + M - mod(b,M ))%M;   }
ll mult(ll a,ll b,ll M) { return  ( mod(a,M)*mod(b,M) ) %M ; }
bool isprime(ll a){ if(a==2) {return 1;}if(!(a&1) ) {return 0;}for(ll i=3;i*i<=a;i+=2){if(a%i==0) {return 0;} } return 1;} 

  
               /* -------------------------------Main Code------------------------------- */



int main(){
	FAST;
	int n;cin>>n;
	vector <int> dp(3);
	for(int i=0;i<n;i++){
		vector <int> new_dp(3, 0);
		vector <int> arr(3);
		for(int i=0;i<3;i++){
			cin>>arr[i];
		}
		for(int i=0;i<3;i++){
			for(int j=0;j<3;j++){
				if(i!=j){
					new_dp[j] = max(new_dp[j],dp[i]+arr[j]);
				}
			}
		}
		dp = new_dp;
	}
	cout<< max( dp[0], max(dp[1],dp[2]) );
	return 0;
}

	

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct edge{ int to,cap,rev; };
class Max_Flow{
public:
	vector<vector<edge>>G;
	vector<bool>used;int size__;
	void init(int _size){ G.resize(_size); used.resize(_size); size__=_size; }
	void add_edge(int from,int to,int cap){
		G[from].push_back((edge){to,cap,(int)G[to].size()});
		G[to].push_back((edge){from,0,(int)G[from].size()-1});
	}
	int dfs(int v,int t,int f){
		if(v==t)return f;
		used[v]=true;
		for(int i=0;i<G[v].size();i++){
			edge &e=G[v][i];
			if(!used[e.to] && e.cap>0){
				int d=dfs(e.to,t,min(t,e.cap));
				if(d>0){
					e.cap-=d;
					G[e.to][e.rev].cap+=d;
					return d;
				}
			}
		}
		return 0;
	}
	int max_flow(int s,int t){
		int ret=0;
		while(true){
			for(int j=0;j<size__;j++)used[j]=false;
			int f=dfs(s,t,1000000007);
			if(f==0)return ret;
			ret+=f;
		}
		return ret;
	}
};

int N,M,L,a,b,c,d[100][100],e1[1000],e2[1000];
int main(){
	while(true){
		cin>>N>>M>>L;if(N+M+L==0)break;
		for(int i=0;i<N;i++){for(int j=0;j<N;j++)d[i][j]=1e9;d[i][i]=0;}
		for(int i=0;i<M;i++){
			cin>>a>>b>>c;
			d[a][b]=c;d[b][a]=c;
		}
		for(int k=0;k<N;k++){for(int i=0;i<N;i++){for(int j=0;j<N;j++){d[i][j]=min(d[i][j],d[i][k]+d[k][j]);}}}
		for(int i=0;i<L;i++){
			cin>>e1[i]>>e2[i];
		}
		Max_Flow X;
		X.init(2*L+2);
		for(int i=0;i<L;i++){
			for(int j=0;j<L;j++){
				if(i==j || d[e1[i]][e1[j]]>e2[j]-e2[i])continue;
				X.add_edge(i,j+L,1);
			}
		}
		for(int i=0;i<L;i++){X.add_edge(2*L,i,1);}
		for(int i=0;i<L;i++){X.add_edge(i+L,2*L+1,1);}
		cout<<L-X.max_flow(2*L,2*L+1)<<endl;
	}
	return 0;
}

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

int main() {

  int A,B,C;
  cin>> A >> B >> C;
  
  
  while(C>0){
    
    if(A<=B){
      break;
    }
    
    B++;
    C--;
    
    //if(A==B){
      //break;
    //}

  }
  
  cout<< C <<endl;
  cout<<endl;
}
    
  
  
  
  


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

using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &x : a)
        cin >> x;
    ll best = (ll)1e15;
    for(int i=0; i<=101; i++){
        ll s = 0;
        for(auto x : a)
            s += (x-i)*(x-i);
        best = min(best, s);
    }
    cout << best;
    return 0;
}


Measured memory_bytes: 256
s = input()
k = int(input())
cnt = 0
if len(s) == 1:
  print(int(s))
elif s[0] == '1' and k != 1:
  for i in range(len(s)):
    if s[i] == '1':
      cnt += 1
      if cnt == k:
        print(1)
        exit()
    if s[i] != '1'  :
      print(s[i])
      exit()
else:
  print(s[0])

Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<string>

using namespace std;

int main(void) {

	int k, num = 0;

	string s;

	cin >> s;

	if (equal(s.begin(), s.begin() + 4, "YAKI"))cout << "Yes\n";
	else cout << "No\n";

	return 0;
}

Measured memory_bytes: 256
n = int(input())
a = [[0, 0, 0]]
for _ in range(n):
  a.append(list(map(int, input().split())))

flag = 0
for i in range(n):
  delta = a[i+1][0]-a[i][0]
  distance = abs(a[i+1][1]-a[i][1]) + abs(a[i+1][2]-a[i][2])
  if delta < distance or delta%2 != distance%2:
    flag = 1
    break
    
if flag == 1:
  print("No")
else:
  print("Yes")

Measured memory_bytes: 26972
n = int(input())
lis = list(map(int,input().split()))
num = [0 for i in range(10**5+1)]
for nu in lis:
    if nu > 0:
        num[nu-1] += 1
    num[nu] += 1
    if nu < 10 ** 5:
        num[nu+1] += 1
print(max(num))

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


void solve(long long A, long long B){
    if(A<=8 && B <=8){
        cout << "Yay!" <<endl;
    }else{
        cout << ":(" << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
//AtCoder ABC113 B - Palace
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;
int main() {
    ll N; cin>>N;
    ll T,A; cin>>T>>A;
    vector<ll> hn(N);
    for(auto&& h:hn){
        cin>>h;
    }
    double tmin=1e6;
    ll idx=-1;
    for(ll i=0;i<hn.size();++i){
        double t=A-(T-hn[i]*0.006);
        t=abs(t);
        if(tmin>t){
            idx=i;
            tmin=t;
        }
    }
    cout<<idx+1<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int a = sc.nextInt();
        if(a <= 1199){
            System.out.println("ABC");
            
        }else{
            System.out.println("ARC");
        }
    }
}

Measured memory_bytes: 24916
import java.util.Scanner; 
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;

class Main{

	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);	
		while(true){
			int num1 = scan.nextInt();
			int num2 = scan.nextInt();

			//System.out.println(num1+" "+num2);

			if(num1==0&&num2==0){
				break;
			}

			int[] list = new int[21];

			String str = patting(num1,num2);		
			//System.out.println(str);
			list[0]=Integer.parseInt(str);

			boolean flag=false;

			for(int i=1;i<21;i++){
				str=patting(Integer.parseInt(str),num2);
				int max = maxNum(str);
				int min = minNum(str);
				int ans = max-min;			
				

				int count=0;
				for(int j=0;j<i;j++){
					if(list[j]==ans){
						System.out.println(count+" "+ans+" "+(i-count));
						flag=true;	
						break;
					}
					count++;
				}

				if(flag){
					break;
				}

				list[i]=ans;

				str=Integer.toString(ans);

			}
		}
	}

	static String patting(int num1,int num2){
		String[] str1 = Integer.toString(num1).split("");
		String[] patNum;

		StringBuilder build = new StringBuilder();

		//System.out.println(str1.length);

		if(num2!=str1.length-1){
			for(int i=0;i<=num2-str1.length;i++){
				build.append("0");	
			}

		}

		for(int i=0;i<str1.length;i++){
			build.append(str1[i]);	
		}

		return build.toString();
	}

	static int maxNum(String str){
		String[] nums = str.split("");	
		StringBuilder build = new StringBuilder();

		Arrays.sort(nums, Collections.reverseOrder());
		
		for(int i=0;i<nums.length;i++){
			build.append(nums[i]);		
		}

		return Integer.parseInt(build.toString());
	}

	static int minNum(String str){
		String[] nums = str.split("");	
		StringBuilder build = new StringBuilder();

		Arrays.sort(nums);

		for(int i=0;i<nums.length;i++){
			build.append(nums[i]);		
		}

		return Integer.parseInt(build.toString());
	}

}

Measured memory_bytes: 33264
def resolve():
    n = int(input())
    aaa = [int(input()) for _ in range(n)]
    sorta = sorted(aaa, reverse=True)
    maxa = sorta[0]
    seconda = sorta[1]
    for i in range(n):
        if maxa == aaa[i]:
            print(seconda)
        else:
            print(maxa)
resolve()

Measured memory_bytes: 14112
import sys
def main():
    input = sys.stdin.readline
    K=int(input())
    N=max(2,min(50,K))
    ans=[i+K//N for i in range(N)]
    m=K%N
    for i in range(m):
        for j in range(N):
            if i==j: ans[j]+=N
            else: ans[j]-=1
    print(N)
    print(*ans)

if __name__ == '__main__':
    main()

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

ll solve() {
    ll R, C, K, v;
    cin >> R >> C >> K;
    vector<vector<ll>> V(R, vector<ll>(C));
    int r, c;
    for ( int i = 0; i < K; i++ ) {
        cin >> r >> c >> v;
        r--, c--;
        V[r][c] = v;
    }
    vector<vector<vector<ll>>> dp(R, vector<vector<ll>>(C, vector<ll>(4)));
    for ( int h = 1; h < 3; h++ ) {
        dp[0][0][h] = V[0][0];
    }
    for ( int i = 0; i < R; i++ ) {
        for ( int j = 0; j < C; j++ ) {
            for ( int h = 0; h <= 3; h++ ) {
                if ( j > 0 ) dp[i][j][h] = max(dp[i][j][h], dp[i][j-1][h]);
                if ( j > 0 && h < 3 ) dp[i][j][h+1] = max(dp[i][j][h+1], dp[i][j-1][h] + V[i][j]);
            }
            for ( int h = 0; h <= 3; h++ ) {
                if ( i > 0 ) dp[i][j][0] = max(dp[i][j][0], dp[i-1][j][h]);
                if ( i > 0 ) dp[i][j][1] = max(dp[i][j][1], dp[i-1][j][h] + V[i][j]);
            }
        }
    }
    ll ans = 0;
    for ( int h = 0; h <= 3; h++ ) {
        ans = max(ans, dp[R-1][C-1][h]);
    }
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 706464
#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define int long long
#define gcd __gcd
const int inf = 0x3f3f3f3f;
const int maxn = 201110;
const int M = 1e9+7;
int n,a,b,ok;

signed main()
{
    cin>>n>>a>>b;
    int ans = 0;
    int m = n%(a+b);
    ans = a*((n-m)/(a+b));
    ans += min(m,a);
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

int main() {
	int n, m;
	long long counter = 0;
	long long x;
	deque<long long>max;
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		cin >> x;
		max.push_back(x);
	}
	sort(max.rbegin(), max.rend());
	while (m--) {
		if (!max.empty())
			max.pop_front();
	}
	while (!max.empty())
	{
		counter += max.front();
		max.pop_front();
	}
	cout << counter << endl;
	return 0;
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define int long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

int32_t main()
{
    IOS;

    string str;

    cin>>str;

    if(str.size()==2)
        cout<<str;
    else
    {
        reverse(str.begin(),str.end());
        cout<<str;
    }

    return 0;

}

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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 1000000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;



int main(){
  string s;
  cin>>s;
  if(s.at(2)==s.at(3)&&s.at(4)==s.at(5))cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*
 
fun main(args: Array<String>) {
 
  val sc = Scanner(System.`in`)
  var h = sc.nextInt()
  val a = sc.nextInt()
  var numOfAtack = 0
  
  while(h > 0) {
    h -= a
    numOfAtack++
  }
  
  println("$numOfAtack")
}

Measured memory_bytes: 29608
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		System.out.print(check(S) ? "AC" : "WA"); 
	}
	
	private static boolean check (String S) {
		int len = S.length();
		int cCount = 0;
		for (int i = 0 ; i < len ; i++) {
			char ch = S.charAt(i);
			if (i == 0) {
				if (ch != 'A') {
					return false;					
				}
			} else if (i == 1) {
				if (!checkSmall(ch)) {
					return false;
				}
			} else if (i > 1 && i < len - 1) {
				if (ch == 'C') {
					cCount++;
				} else if (!checkSmall(ch)){
					return false;
				}
			} else {
				if (cCount != 1) {
					return false;
				} else if (!checkSmall(ch)){
					return false;
				}
			}
		}
		
		return true;
	}
	
	private static boolean checkSmall (char ch) {
		if (!(ch >= 0x61 && ch <= 0x7A)){
			return false;
		}
		return true;
	}
}

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

using namespace std;

int main()
{
int a,b,c,x;

cin >> a >> b >>c >>x;
int ans = 0;
for(int i = 0 ; i <= a ;i++)
{
for(int j = 0 ; j <=b ;j++)
{
    
for(int k = 0 ; k <= c; k++)
{
    
if((i*500 + j*100 + k*50)==x) ++ans; 
}

}
}

cout << ans;


}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define ALL(V) V.begin(),V.end()
#define RALL(V) V.rbegin(),V.rend()
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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

void func(long long N, std::vector<long long> P){

    multiset<lli> large;
    large.insert(0);
    large.insert(0);
    large.insert(N+1);
    large.insert(N+1);

    map<lli,lli> toI;
    REP(i,0,N)toI[-P[i]] = i+1;

    lli ans = 0;
    for(auto e:toI){
        lli now = e.second;
        lli sum = 0;
        auto rig = large.lower_bound(now);
        auto rig2 = rig;
        rig2++;
        auto lef = large.lower_bound(now);
        lef--;
        auto lef2 = lef;
        lef2--;
        LOG4(ans,now,*lef,*rig);
        LOG4(*lef2,*lef,*rig,*rig2);
        sum += (*rig-now)*(*lef-*lef2);
        sum += (now-*lef)*(*rig2-*rig);
        sum *= (-e.first);

        large.insert(now);
        ans += sum;
    }

    cout<<ans<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    long long N;
    scanf("%lld",&N);
    std::vector<long long> P(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&P[i]);
    }
    func(N, std::move(P));
    return 0;
}


Measured memory_bytes: 12032
#include <iostream>
 
#define N 1000000007
 
using namespace std;
 
typedef unsigned long long int ULLI;
 
int count_ways(ULLI n, ULLI d, ULLI x) {
  int last_i;
  bool has_initialized = false;
  ULLI count_bin[50][2001], count[50][2001];
  for (int i=0; d>0; i++) {
    if (i == 0) {
      for (int j=0; j<=n; j++) {
        if (j < x) {
          count_bin[0][j] = 1;
        }
        else {
          count_bin[0][j] = 0;
        }
      }
    }
    else {
      for (int j=0; j<=n; j++) {
        count_bin[i][j] = 0;
        for (int k=0; k<=j; k++) {
          count_bin[i][j] = (count_bin[i][j]+count_bin[i-1][k]*count_bin[i-1][j-k])%N;
        }
      }
    }
    if (has_initialized) {
      if (d%2 == 0) {
        for (int j=0; j<=n; j++) {
          count[i][j] = count[i-1][j];
        }
      }
      else {
        for (int j=0; j<=n; j++) {
          count[i][j] = 0;
          for (int k=0; k<=j; k++) {
            count[i][j] = (count[i][j]+count[i-1][j-k]*count_bin[i][k])%N;
          }
        }
      }
    }
    else if (d%2 > 0) {
      for (int j=0; j<=n; j++) {
        count[i][j] = count_bin[i][j];
      }
      has_initialized = true;
    }
    d >>= 1;
    last_i = i;
  }
  return count[last_i][n];
}
 
int main() {
  ULLI n, d, x;
  while (true) {
    cin >> n >> d >> x;
    if (n == 0) {
      return 0;
    }
    cout << count_ways(n, d, x) << endl;
  }
}

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

int main() {
  string s,t; cin >> s >> t;
  ll b = 0;
  rep(i,s.size()){
    if(s[i]!=t[i]) b++;
  }
  cout << b << endl;
    
  return 0;
}


Measured memory_bytes: 3824
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;
 
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x first
#define y second
 
const int MOD = 1e9 + 7;
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0}; 
const char dir[] = {'R', 'L', 'D', 'U'};
 
int add(int a, int b){
    a += b;
    if(a >= MOD){
        a -= MOD;
    }
    return a;
}
 
int sub(int a, int b){
    a -= b;
    if(a < 0) a += MOD;
    return a;
}
 
int mult(int a, int b){
    return ((ll) a * b) % MOD;
}
 
void setIO() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
//    freopen((s+".in").c_str(),"r",stdin);
//    freopen((s+".text").c_str(),"w",stdout);
}
 
//ctrl q is comment
//ctrl b is run
//ctrl s is compile
//alt r is search & replace
//alt d is delete a line
 
bool comp(pii a, pii b){
    return a.y < b.y;
}
 
int main(){
    setIO();
    int n; cin >> n;
    int a[n];
    int mx = 0;
    ll amt = 0;
    for(int i = 0; i < n; ++i){
        cin >> a[i];
        mx = max(mx, a[i]);
        amt += mx - a[i];
    }
    cout << amt << "\n";
}

Measured memory_bytes: 4432
#include<stdio.h>
#define MAX 100005
#define NIL -1
 struct Node{
  int p;
  int l;
  int r;
};
struct Node T[MAX];
int n,D[MAX];

void pri(int u){
  int i,c;
  printf("node %d: ",u);
  printf("parent = %d, ",T[u].p);
  printf("depth = %d, ",D[u]);

  if(T[u].p==NIL)printf("root, ");
  else if(T[u].l==NIL)printf("leaf, ");
  else printf("internal node, ");

  printf("[");
  for(i=0,c=T[u].l;c!=NIL;i++,c=T[c].r){
    if(i)printf(", ");
printf("%d",c);
  }
printf("]\n");
}

void rec(int u,int p){
  D[u]=p;
  if(T[u].r != NIL)rec(T[u].r,p);
  if(T[u].l !=NIL)rec(T[u].l,p+1);
}

int main(){
  int i,j,d,v,c,l,r;
  scanf("%d",&n);
  for(i=0;i<n;i++)T[i].p=T[i].l=T[i].r=NIL;

  for(i=0;i<n;i++){
    scanf("%d%d",&v,&d);
    for(j=0;j<d;j++){
     scanf("%d",&c);
     if(j==0)T[v].l=c;
     else T[l].r=c;
     l=c;
     T[c].p=v;
    }
  }
for(i=0;i<n;i++){
  if(T[i].p==NIL)r=i;
}
rec(r,0);
for(i=0;i<n;i++)pri(i);
return 0;
}



Measured memory_bytes: 6412
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		TreeMap<String,Integer> map=new TreeMap<>();
		int q=Integer.parseInt(in.next());
		for(int i=0;i<q;i++) {
			int odr=Integer.parseInt(in.next());
			
			switch(odr) {
			case 0:
				String key0=in.next();
				int x0=Integer.parseInt(in.next());
				map.put(key0,x0);
				break;
				
			case 1:
				String key1=in.next();
				Integer num1=map.get(key1);
				out.println((num1!=null)? num1:0);
				break;
				
			case 2:
				String key2=in.next();
				map.remove(key2);
				break;
			}
		}
		out.flush();
	}

}



Measured memory_bytes: 128932
#include <cmath>
#include <iomanip>
#include <ios>
#include <iostream>

int main(int argc, char *argv[]) {
  int a, b, h, m;
  std::cin >> a >> b >> h >> m;
  h *= 60;
  int t = h + m;

  double at = (double)t / (12. * 60.);
  double ax = a * std::cos(2 * M_PI * at);
  double ay = a * std::sin(2 * M_PI * at);
  double bt = (double)(t % 60) / 60.;
  double bx = b * std::cos(2 * M_PI * bt);
  double by = b * std::sin(2 * M_PI * bt);

  std::cout << std::setprecision(12) << std::fixed;
  std::cout << sqrt(pow(ax - bx, 2) + pow(ay - by, 2)) << std::endl;
}


Measured memory_bytes: 3668
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <limits.h>
#include <queue>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)

int main(){
    ll x;
    cin >> x;
    ll ans = 0;
    ll num = 0;

    ans += 2*(x/11);
    x = x % 11; 

    while(1){
        if(num >= x) break;
        num += 6;
        ans++;

        if(num >= x) break;
        num += 5;
        ans++;
    }

    cout << ans << endl;
    return 0;
}


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

using namespace std;

int v[109], dp[100009];

int main()
{
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i)
        cin >> v[i];
    for (int j = 1; j <= k; ++j) {
        for (int i = 0; i < n; ++i) {
            if (v[i] <= j) {
                dp[j] |= (1 - dp[j - v[i]]);
            }
        }
    }
    if (dp[k])
        cout << "First";
    else
        cout << "Second";
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) noexcept {
  return std::vector<T>(n, std::forward<T>(val));
}

template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}

template<class T, class Cond>
struct chain {
  Cond cond; chain(Cond cond) : cond(cond) {}
  bool operator()(T& a, const T& b) const {
    if(cond(a, b)) { a = b; return true; }
    return false;
  }
};
template<class T, class Cond>
chain<T, Cond> make_chain(Cond cond) { return chain<T, Cond>(cond); }

int main() {
  i64 A, B, C, K;
  cin >> A >> B >> C >> K;
  i64 a = std::min(A, K);
  K -= a;
  i64 b = std::min(B, K);
  K -= b;
  i64 c = std::min(C, K);
  K -= c;
  cout << a - c << endl;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long
#define pb push_back
#define pi pair<int, int>
#define fastio  ios_base::sync_with_stdio(false);  cin.tie(NULL);

using namespace std;
const ll mod = 1e9+7;
/*
    c a b
*/
int main() {
    fastio
    string s;
    getline(cin, s);
    int n = s.length();
    s = " " + s;
    string ans = "";
    for(int i=0; i<n; i++) {
        if(s[i] == ' ') {
            ans += s[i+1] - 32;
        }
    }
    cout << ans << "\n";
}

/*

*/

Measured memory_bytes: 256
h = list(map(int,input().split()))
h.sort()

if (h[1]-h[0])%2 == 0:
    print(h[2]-h[1] + (h[1]-h[0])//2)
else:
    print(h[2]-h[1] + (h[1]-h[0]+1)//2 + 1)


Measured memory_bytes: 2940
#include<stdio.h>
int main()
{
    int n,a[10000],i,d,ans=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        d=a[i];
        while(d)
        {
            if(d%2==0)
            {
                ans++;
                d=d/2;
            }
            else
                break;
        }
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  int N; ll K; cin >>N >>K;
  vector<ll> A(N); rep(i, N) cin >>A[i];
  vector<ll> Asum(N+1, 0);
  rep(i, N) Asum[i+1] = Asum[i] + A[i];
  /*
  0 <= i < j <= N を満たす正の整数i,jの組について、
  (Asum[j]-Asum[i]) % K = j-i を満たすものを数え上げよ。
  * Asum[j] := [0, j)
  * Asum[i] := [0, i)
  * Asum[j]-Asum[i] := [i, j)
  
  Asum[j]-Asum[i] = j-i + x * K
  Asum[j]-j = Asum[i]-i + x*K
  (Asum[j]-j)%K = (Asum[i]-i)%K
  */
  
  for (int i=0; i<=N; i++){
    Asum[i] += K*i - i;
    Asum[i] %= K;
  }
  map<ll,ll> mods;
  ll res = 0;
  for (int i=0; i<=N; i++){
    if (i >= K) mods[Asum[i-K]]--;
    res += mods[Asum[i]];
    mods[Asum[i]]++;
  }
  cout <<res <<endl;
}


Measured memory_bytes: 15872
X = int(input())

import math
import sys

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

while True:
    if is_prime(X) == True:
        print(X)
        sys.exit()
    X+=1

Measured memory_bytes: 2940
n,m,k=map(int, input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
import bisect
AR=[0]
BR=[0]
for i in range(n):
	AR.append(A[i]+AR[i])
for i in range(m):
	BR.append(B[i]+BR[i])

ans=0
for i in range(n+1):
	if AR[i]>k:
		break
	s=k-AR[i]
	t=bisect.bisect(BR,s)-1
	ans=max(ans,i+t)
print(ans)

Measured memory_bytes: 47376
#include <bits/stdc++.h>
#define div1 1000000007
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef long double ld;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(void)
{
    ll A, B, H, M;
    ld d, x, y;

    cin >> A >> B >> H >> M;

    x = 30*H + M/(ld)2;
    y = 6*M;

    d = fabs(x-y);

    d = min(d, (ld)360-d);

    d *= M_PI;
    d /= (ld)180;

    cout << setprecision(20) << sqrt(A*A+B*B-2*A*B*cos(d)) << endl;

    return 0;
}

Measured memory_bytes: 4184
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

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

  vector<pair<int,int>> v;
  for(int i=0;i<N;i++) v.push_back(mkp(A[i],i));
  sort(v.begin(),v.end());

  vector<int> ans(N);
  rep(i,N) ans[i]=v[i].second;

  for(int i=0;i<N;i++) cout<<ans[i]+1<<" ";
  cout<<endl;

  return 0;
}


Measured memory_bytes: 2420
/**
 * author:    Ziel
 * created:   17.04.2020 23:39:20
**/

// ~zaletaet~

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>

#define fi first
#define se second
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define pb push_back

using namespace std;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

const ll N = 1e5 + 123, MOD = 1e9 + 7, oo = 1e9 + 9, INF = 1e18 + 9;
const double EPS = 1e-9, PI = acos(-1); // 3.14159265358979323846
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1}, dy[] = {0, 0, 1, -1, 1, -1, -1, 1};

int x, y, z, K;
vector<ll> a, b, c;

main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	
	cin >> x >> y >> z >> K;
	
	a.resize(x);
	b.resize(y);
	c.resize(z);
	auto read = [&](vector<ll>& a) {
		for (ll& i: a) cin >> i;
	};
	read(a);
	read(b);
	read(c);
	
	sort(all(a), greater<ll>());
	sort(all(b), greater<ll>());
	sort(all(c), greater<ll>());
	
	multiset<tuple<ll, ll, ll, ll>, greater<tuple<ll, ll, ll, ll>>> m;
	map<tuple<ll, ll, ll>, bool> s;
	m.insert(make_tuple(a[0] + b[0] + c[0], 0ll, 0ll, 0ll));
	while (K) {
		ll cur, i, j, k;
		tie(cur, i, j, k) = *m.begin();
		if (s.count(make_tuple(i, j, k))) {
			m.erase(m.begin());
			continue;
		}
		cout << cur << '\n';
		s[make_tuple(i, j, k)] = true;
		m.erase(m.begin());
		K--;
		if (K <= 0) return 0;
		
		if (i + 1 < x) m.insert(make_tuple(cur - a[i] + a[i + 1], i + 1, j, k));
		if (j + 1 < y) m.insert(make_tuple(cur - b[j] + b[j + 1], i, j + 1, k));
		if (k + 1 < z) m.insert(make_tuple(cur - c[k] + c[k + 1], i, j, k + 1));
	}
	return 0;
}



Measured memory_bytes: 896
#include <stdio.h>
#include <math.h>
#define LL long long int

int main()
{
  LL n,fla,ans;

  scanf("%lld", &n);

  LL s = 1;

  ans = n/s - 1;
  for(s=2; s<= sqrt(n); s++)
  {
    if(n%s == 0)
      ans = (n/s - 1) +(s - 1);
  }

  printf("%lld", ans);
  return 0;
}


Measured memory_bytes: 2152
#include<stdio.h>
#include<algorithm>
using namespace std;
int p[8];
double dp[1<<8][30];
int g[30][30];
int main(){
	int a,b,c,d,e;
	while(scanf("%d%d%d%d%d",&a,&b,&c,&d,&e),a){
		d--;
		e--;
		for(int i=0;i<a;i++)scanf("%d",p+i);
		for(int i=0;i<256;i++)
			for(int j=0;j<30;j++)
				dp[i][j]=999999999;
		dp[0][d]=0;
		for(int i=0;i<30;i++)
			for(int j=0;j<30;j++)
				g[i][j]=-1;
		for(int i=0;i<c;i++){
			int x,y,z;
			scanf("%d%d%d",&x,&y,&z);
			x--;y--;
			g[x][y]=g[y][x]=z;
		}
		for(int i=0;i<(1<<a);i++){
			for(int j=0;j<b;j++){
				for(int k=0;k<b;k++){
					if(~g[j][k]){
						for(int l=0;l<a;l++)
							if(!(i&(1<<l)))dp[i+(1<<l)][k]=min(dp[i+(1<<l)][k],dp[i][j]+(double)g[j][k]/p[l]);
					}
				}
			}
		}
		double ret=999999999;
		for(int i=0;i<(1<<a);i++)ret=min(ret,dp[i][e]);
		if(ret>100000000)printf("Impossible\n");
		else printf("%f\n",ret);
	}
}

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

typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
const ll INF = 1001001001;
const ll MOD = 1e9 + 7;

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt1 = 0, cnt2 = 0, lo = 0, ro = 0;
  for(int i = 0; i<n; i++){
    if(s.at(i) == '(') cnt1++;
    else cnt2++;
    lo = max(lo, cnt2 - cnt1);
  }
  cnt1=0;cnt2 =0 ;
  for(int i = n-1; i>=0; i--){
    if(s.at(i) == '(') cnt1++;
    else cnt2++;
    ro = max(ro, cnt1 - cnt2);
  }
  while(lo){
    s = '(' + s;
    lo--;
  }
  while(ro){
    s = s + ')';
    ro--;
  }
  cout << s <<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(){
  int nagasa;
  string a;
  cin >> nagasa >> a;
  int kotae= 0;
  for(int i = 0;i <= nagasa - 1;i++){
    if(a[i] == 'A' && a[i + 1] == 'B' && a[i + 2] == 'C'){
      kotae++;
      i = i + 2;
    }
  }
  cout << kotae << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String o = sc.nextLine();
		String e = sc.nextLine();
		int n = o.length() + e.length();

		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				//文字列oからi番目
				System.out.print(o.charAt(i / 2));
			} else {
				System.out.print(e.charAt(i / 2));
			}
		}
		System.out.println("");
	}
}


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

#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int,int>
#define mod 998244353
#define debug(x) cerr<<#x<<"="<<x<<'\n'

int n,k;

int main(){
	cin>>n>>k;
	int cnt=0;
	while (n) {
		cnt++;
		n/=k;
	}
	cout<<cnt;
	return 0;
}


Measured memory_bytes: 256