akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
 
int main(){
 string s;

 cin>>s;

 for(int i=1;i<4;i++){
     if(s.at(i)==s.at(i-1)){

         cout<<"Bad";
         return 0;
     }
 }


cout<<"Good";
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n,m,x,y;
	int a[101];
	int b[101];
	cin>>n>>m>>x>>y;
	int i;
	int MAXX=-1;
	int MINY=INT_MAX;
	bool flg,flg1;
	for(i=0;i<n;i++){
		cin>>a[i];
		MAXX=max(MAXX,a[i]);
	}
	for(i=0;i<m;i++){
		cin>>b[i];
		MINY=min(MINY,b[i]);
	}
	
	for(i=x+1;i<=y;i++){
		flg=false;
		flg1=false;
		if(MAXX<i) flg=true;
		if(MINY>=i)	flg1=true;
		if(flg&&flg1) break;
	}
	if(flg&&flg1){
		cout<<"No War"<<endl;
	}
	else{
		cout<<"War"<<endl;
	}
	return 0;
}

Measured memory_bytes: 384
#! /usr/bin/python3
# AtCoDeerくんとボール色塗り / Painting Balls with AtCoDeer
"""
    1≦N≦1000
    2≦K≦1000
    答えは 2^(31)−1 以下
"""
test_mode = True

N, K = map(int, input().split())
print(K * (K-1)**(N-1))


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

using namespace std;
int main(void){

    long long n, y;
    cin >> n >> y;
    
    for(int i=0; i<=n; i++) {
//        if(10000*i>y) continue;
        for(int j=0; j<=n; j++) {
//            if(10000*i+j*5000>y || i+j>n) continue;
//            if(i+j<=n) cout << i << " " << j << " " << n-i-j << endl;
            if(i+j<=n && i*10000+j*5000+(n-i-j)*1000 == y) {
                cout << i << " " << j << " " << n-i-j << endl;
                return 0;
            }
        }
    }

    cout << "-1 -1 -1" << endl;

    return 0;
    
}


Measured memory_bytes: 764
in_n = input().split()
a,b,c,d = int(in_n[0]),int(in_n[1]),int(in_n[2]),int(in_n[3])
num_list = []
num_list.append(a * c)
num_list.append(a * d)
num_list.append(b * c)
num_list.append(b * d)
if a <= 0 and b >= 0:
    num_list.append(0)
if c <= 0 and d >= 0:
    num_list.append(0)
print(max(num_list))

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

using namespace std;

#define int		long long

void solve()
{
	string s,t;
	cin >> s >> t;
	int ans=t.size();
	for(int i =0;i<s.size();i++){
		if(i+t.size()>s.size()) 
			break;
		int cnt=0;
		for(int j=0;j<t.size();j++){
			if(s[i+j]!=t[j])
				cnt++;
		}
		ans = min(cnt,ans);
	}
	cout << ans << endl;
}

int32_t main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	//int t;cin >> t ;while(t--)
	 	solve();
}

Measured memory_bytes: 3552
while True:
    try:
        n = int(raw_input())
    except EOFError:
        break

    ans = 0

    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if i+j+k+l == n:
                        ans += 1

    print ans

Measured memory_bytes: 6248
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 2147483647
#define LINF 9223372036854775807
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
//typedef long long int ll;
signed main(){
    
    int n;
    cin>>n;
    int a[1111],b[1111];
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
        if(i==0)continue;
        if(a[i-1]<a[i] && b[i-1]<b[i])continue;
        int num=a[i-1]/a[i];
        int num2=b[i-1]/b[i];
        if(a[i-1]%a[i]!=0)num++;
        if(b[i-1]%b[i]!=0)num2++;
        int num3=max(num,num2);
        a[i]*=num3;
        b[i]*=num3;
    }
    cout<<a[n-1]+b[n-1]<<endl;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
#define endl "\n"
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin>>t;
    while(t){
        if(t%10==7){
            cout<< "Yes"<<endl;
            return 0;
        }
        t=t/10;


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


Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <sstream>
#include <algorithm>

using namespace std;

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		(1000000)
#define Rep(i,n) for(int i = 0; i < (n); i++ )

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define	show(x)	 copy( (x).begin(), (x).end(), ostream_iterator<int>(cout, ",") );	// container<int>を全て表示

using namespace std;

typedef long long ll;

//constant
//--------------------------------------------
const double EPS = 1e-10;
//const double PI  = acos(-1.0);

ll kaijo( ll N )
{
	// 階乗
	if( N == 0 ) return 1;
	return N * kaijo(N - 1);
}

map<ll, ll> prime_factor(ll N)
{
	// 素因数分解
	map<ll, ll> ret;
	for( ll i = 2; i * i <= N; i++ ){
		while( N % i == 0 ){
			ret[i]++;
			N /= i;
		}
	}
	if(N != 1) ret[N] = 1;
	return ret;
}

ll gcd( ll a, ll b )
{
	// a >= b
	if( b > a ) swap(a, b);
	if( b == 0 ) return a;
	return gcd( a % b, b );
}

ll lcm( ll a, ll b )
{
	return a * b / gcd(a, b);
}

ll max( ll a, ll b )
{
	if( a > b ) return a;
	return b;
}
ll min( ll a, ll b )
{
	if( a > b ) return b;
	return a;
}

class UnionFind
{
public:
	vector<int> parent;
	vector<int> rank;

	UnionFind(int n)
	{
		Rep(i, n){
			parent.push_back(i);
			rank.push_back(1);
		}
	}
	int root(int x)
	{
		if( parent[x] != x ) parent[x] = root(parent[x]);
		return parent[x];
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if( rx == ry ) return;
		if( rank[rx] > rank[ry] ){
			parent[ry] = rx;
			rank[rx] += rank[ry];
		}
		if( rank[rx] <= rank[ry] ){
			parent[rx] = ry;
			rank[ry] += rank[rx];
		}
	}
};

int main()
{
	ll x1 = 0;
	ll y1 = 0;
	ll x2 = 0;
	ll y2 = 0;
	ll x3 = 0;
	ll y3 = 0;
	ll x4 = 0;
	ll y4 = 0;

	cin >> x1 >> y1 >> x2 >> y2;

	x3 = x2 + y1 - y2;
	y3 = y2 + x2 - x1;
	x4 = x1 + y1 - y2;
	y4 = y1 + x2 - x1;

	cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;

	return 0;
}


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

using namespace std;

int main() {
  int n,x[200],y[200],h[200];
  cin >> n;
  for(int i = 0; i < n; i++)
    cin >> x[i] >> y[i] >> h[i];

  int H;
  for(int cx = 0; cx <= 100; cx++) {
    for(int cy = 0; cy <= 100; cy++) {
      for(int i = 0; i < n; i++) {
        if(h[i] != 0) {
          H = h[i] + abs(x[i]-cx) + abs(y[i]-cy);
          break;
        }
      }
      for(int i = 0; i < n; i++) {
        if(h[i] != max(H-abs(x[i]-cx)-abs(y[i]-cy), 0))
            goto Loop;
      }
      cout << cx << " " << cy << " " << H << endl;
      goto Exit;
      Loop: ;
    }
  }

  Exit: return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define ll long long
#define REP(i, n) for (ll (i) = 0; (i) < (n); (i)++)
#define REPI(i, a, b) for (ll (i) = (a); (i) < (b); (i)++)
#define int long long
using namespace std;
using P = pair<int, int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;

const int INF = 1e7;
int N, K;
VVI edge;
VI VP;
priority_queue<P, vector<P>, greater<P>> pq;

void solve() {
  while (!pq.empty()) {
    P p = pq.top(); pq.pop();
    assert(p.first >= 0);
    for (int v: edge[p.second]) {
      if (VP[v] == -INF) {
        VP[v] = p.first + 1;
        pq.push(P{VP[v], v});
      } else if (VP[v] != p.first + 1 && VP[v] != p.first -1) {
        cout << "No" << endl;
        return;
      }
    }
  }
  cout << "Yes" << endl;
  REP (i, N) {
    cout << VP[i] << endl;
  }
}

signed main() {
  cin >> N;
  edge = VVI(N);
  REP (i, N-1) {
    int a, b;
    cin >> a >> b; a--; b--;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  cin >> K;
  VP = VI(N, -INF);
  REP (i, K) {
    int v, p;
    cin >> v >> p; v--;
    VP[v] = p;
    pq.push({p, v});
  }
  solve();
}


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

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

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

   int ans = 0;
   f(i,1,n+1){
      ans += (n + 1 - i) * i;
   }

   f(i,0,n-1){
      int u,v;
      cin >> u >> v;
      if(u > v)   swap(u,v);
      ans -= u * (n + 1 - v);
   }

   cout << ans << "\n";
}


Measured memory_bytes: 3540
import numpy as np
N, K = map(int, input().split())
As = np.sort(list(map(int, input().split())))
Fs = np.sort(list(map(int, input().split())))[::-1]
l  = As*Fs
left = 0
right = max(l)
while right-left>=1:
    mid = left + (right - left)/2
    if np.maximum(As-mid//Fs , 0).sum()<=K:
        right = mid
    else:
        left = mid
print(int(right))

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

using namespace std;

int main()
{
    int n,r,p;
    cin>>n>>r;
    if(n>=10)
    {
        p=r;
    }
    else
    {
        p=r+(100*(10-n));
    }
    cout<<p<<"\n";
    return 0;

}


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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#pragma GCC optimize ("-O3")

using namespace std;

// #define DEBUG_IS_VALID

#ifdef DEBUG_IS_VALID
#define DEB 1 
#else
#define DEB 0
#endif
#define DUMPOUT cout
#define dump(...) if(DEB) DUMPOUT<<"  "<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl<<"    "; if(DEB) dump_func(__VA_ARGS__)
template<typename T1,typename T2>ostream& operator << (ostream& os, pair<T1,T2> p){cout << "(" << p.first << ", " << p.second << ")"; return os;}
template<typename T>ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; }
template<typename T>ostream& operator << (ostream& os, set<T>& st){for(auto itr = st.begin(); itr != st.end(); itr++) cout << *itr << (next(itr)!=st.end() ? ", " : ""); cout << "}"; return os;}
template<typename T1,typename T2>ostream& operator << (ostream& os, map<T1,T2> mp){cout << "{"; for(auto itr = mp.begin(); itr != mp.end(); itr++) cout << "(" << (itr->first) << ", " << (itr->second) << ")" << (next(itr)!=mp.end() ? "," : ""); cout << "}"; return os; }

void dump_func(){DUMPOUT << endl;}
template <class Head, class... Tail>void dump_func(Head&& head, Tail&&... tail){ DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...);}
template<class T> inline bool chmax(T& a,T const& b){if(a>=b) return false; a=b; return true;}
template<class T> inline bool chmin(T& a,T const& b){if(a<=b) return false; a=b; return true;}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

const int mod=1e9+7,INF=1<<29;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<59; 

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N,M;
  cin >> N >> M ;
  string s,t; cin >> s >> t ;
  if(s[0]!=t[0]){
    cout << "-1" << endl;
    return 0;
  }
  ll g = __gcd(N,M);
  ll l = N*M/g;
  if(g==1){
    cout << l << endl;
  }else{
    bool ok = true;
    ll nn = N/g;
    ll mm = M/g;
    rep(i,g){
      ok &= (s[i*nn]==t[i*mm]);
      dump(i*nn,i*mm);
    }
    if(ok) cout << l << endl;
    else cout << "-1" << endl;
  }
  return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<queue>

using namespace std;

int main()
{
        int h,w;
        cin>>h>>w;
        string s[h];
        for(int i=0;i<h;i++) cin>>s[i];

        int check[h][w];
        int cnt=0;
        for(int i=0;i<h;i++){
                for(int j=0;j<w;j++){
                        check[i][j]=0;
                        if(s[i][j]=='#') cnt++;
                }
        }

        queue<int> height;
        queue<int> wide;

        int dh[4]={0,1,0,-1};
        int dw[4]={1,0,-1,0};

        height.push(0); wide.push(0);
        check[0][0]=1;
        while(!height.empty()){
                int nh=height.front(),nw=wide.front();
                height.pop(); wide.pop();

                for(int i=0;i<4;i++){
                        int nnh=nh+dh[i],nnw=nw+dw[i];
                        if(0<=nnh&&nnh<h&&0<=nnw&&nnw<w&&check[nnh][nnw]==0&&s[nnh][nnw]!='#'){
                                height.push(nnh); wide.push(nnw);
                                check[nnh][nnw]=check[nh][nw]+1;
                        }
                }
        }
        if(check[h-1][w-1]!=0) cout<<h*w-check[h-1][w-1]-cnt<<endl;
        else cout<<-1<<endl;
        return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
  val N = readLine()!!.toInt()
  val K = readLine()!!.toInt()

  var x = 1
  for(i in 1..N) {
    if(2*x >= x+K){
      x += K
    } else {
      x *= 2
    }
  }
  println(x)
}

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

int main()
{
    int N, W;
    cin >> N >> W;
    int value[110];
    int weight[110];
    int dp[110][10010];
    for (int i = 0; i < N; i++)
    {
        cin >> value[i] >> weight[i];
    }
    for (int i = 0; i < N; i++)
    {
        for (int w = 0; w <= W; w++)
        {
            dp[i + 1][w] = (w >= weight[i] ? max(dp[i][w - weight[i]] + value[i], dp[i][w]) : dp[i][w]);
        }
    }

    cout << dp[N][W] << endl;

    return 0;
}



Measured memory_bytes: 7020
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b ;
  1<= a,b <= 10000;
  cin >> a >> b;
 
  if (a * b % 2 == 0) {
    cout << "Even" << endl;
  }
   else{
    cout << "Odd" << endl;
  }
}

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

#define rep(i, n) REP(i, 0, n)
#define REP(i, k, n) for(int i = (int)k; i < (int)n; i++)
#define rrep(i, n) RREP(i, 0, n)
#define RREP(i, k, n) for(int i = (int)n-1; i > (int)k-1; i--)
#define mmax(start, end) *max_element(start, end)
#define mmin(start, end) *min_element(start, end)
#define ALL(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " " << x << endl;
#define pb push_back

typedef long long ll;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x,y,s;
    while(cin >> x >> y >> s,x){

        int ma = 0;
        for(int t=1;t<s;t++){
            for(int tc =1;tc<s;tc++){
                if(t*(100+x)/100+tc*(100+x)/100 == s){
                    ma = max(ma,t*(100+y)/100+tc*(100+y)/100);
                }
            }
        }
        cout << ma << endl;

    }
    return 0;
}


Measured memory_bytes: 3132
S = input()
Q = int(input())
flip = False
head = ''
tail = ''
for _ in range(Q):
    q = input()
    if q == '1':
        flip = not flip
        head, tail = tail, head
    else:
        _, f, c = q.split()
        if f == '1':
            head += c
        else:
            tail += c
if flip:
    S = S[::-1]
print(head[::-1] + S + tail)


Measured memory_bytes: 4340
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <sstream>
#include <cassert>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <chrono>
#include <ctime>

using namespace std;

#define en '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) int((x).size())

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9 + 7;
const ll INFLL = 1e18;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
const int MAX_SIZE = 5e5;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

bool IS_ONE_TEST = 1;
ld START_TIME, TIME;

int h, w, k;
ll ans = 0;

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

void rec(vector<vector<int>> a, int i, int j) {
    if (i == h && j == w) {
        int cnt = 0;
        for (auto& ln: a) {
            for (auto& el: ln) {
                cnt += el;
            }
        }
        ans += (cnt == k);
        return;
    }
    if (j == w) {
        for (int t = 0; t < 2; ++t) {
            if (t) {
                for (int jj = 0; jj < w; ++jj) {
                    a[i][jj] = 0;
                }
            }
            rec(a, i + 1, j);
        }
    }
    else {
        for (int t = 0; t < 2; ++t) {
            if (t) {
                for (int ii = 0; ii < h; ++ii) {
                    a[ii][j] = 0;
                }
            }
            rec(a, i, j + 1);
        }
    }
}

void solve() {
    cin >> h >> w >> k;
    vector<vector<int>> a(h, vector<int>(w));
    for (int i = 0; i < h; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < w; ++j) {
            a[i][j] = (s[j] == '#');
        }
    }
    rec(a, 0, 0);
    cout << ans << en;
}

int main() {
    START_TIME = clock();
    fast_in_out();
    int TESTS = 1;
    if (!IS_ONE_TEST) cin >> TESTS;
    while (TESTS--) { solve(); }
#ifdef __APPLE__
    TIME = (clock() - START_TIME) / CLOCKS_PER_SEC;
    cerr << en << TIME * 1000 << " ms." << en;
#endif
    return 0;
}

/*
     ▄▀▀▀▄
▄███▀░◐░░░▌
    ▌░░░░░▐
    ▐░░░░░▐
    ▌░░░░░▐▄▄
    ▌░░░░▄▀▒▒▀▀▀▀▄
   ▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
   ▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
    ▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄
      ▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄
           ▌▌░▌▌
           ▌▌░▌▌
         ▄▄▌▌▄▌▌        */


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

using namespace std;

#define MAX_N 16
#define MAX_M 16

int M, N;
double P[MAX_M][MAX_N];
double dp[MAX_N][1<<MAX_M];

double solve(int n, int m)
{   
    double &res = dp[n][m];
    
    if (res != -1) {
        return res;
    }
    res = 0;

    for (int i = 0; i < M; i++) {
        if (!(m >> i & 1)) continue;
        double p = 1.0, q = 0.0;
        for (int j = n; j < N; j++) { 
            q += p * (1 - P[i][j]) * solve(j, m & ~(1<<i));
            p *= P[i][j];
        }
        q += p;
        res = max(res, q);
    }    
    return res;
}

int main()
{
    cin >> M >> N;
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < N; j++) {
            cin >> P[i][j];
        }
    }
    fill(dp[0], dp[MAX_N], -1);
    printf("%.10f\n", solve(0, (1<<M)-1));
    return 0;
}

Measured memory_bytes: 11388
#include <bits/stdc++.h>
    #define LOCAL
    using namespace std;
    template <typename A, typename B>
    ostream& operator <<(ostream& out, const pair<A, B>& a) {
    out << "(" << a.first << "," << a.second << ")";
    return out;
    }
    template <typename T, size_t N>
    ostream& operator <<(ostream& out, const array<T, N>& a) {
    out << "["; bool first = true;
    for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
    return out;
    }
    template <typename T>
    ostream& operator <<(ostream& out, const vector<T>& a) {
    out << "["; bool first = true;
    for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
    return out;
    }
    template <typename T, class Cmp>
    ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
    out << "{"; bool first = true;
    for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
    return out;
    }
    template <typename U, typename T, class Cmp>
    ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
    out << "{"; bool first = true;
    for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
    return out;
    }
    #ifdef LOCAL
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    #else
    #define trace(...) 42
    #endif
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
    cerr << name << ": " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " |";
    __f(comma + 1, args...);
    }
    #define rep(i,n) for(int i=0; i<(n); i++)
    using ll = long long;
    #define int long long
    using P = pair<int,int>;
    //#########################################
    int used[11000000],dob[1100000];
    signed main(){
        int n;cin >> n;
        int a[n];
        map<int,int> mp;
        rep(i,n){
            cin >> a[i];
            mp[a[i]]++;
        }
        
        sort(a,a+n);
        int ans = 0;
        rep(i,n){
            int tmp = a[i];
            if(mp[tmp] > 1){
                used[tmp] = 1;
                continue;
            }
            bool ok = true;
            for(int j = 1;j *j <= tmp;j++){
                if(tmp % j == 0){
                    //trace(tmp,j,tmp/j);
                    if(used[j]){
                        ok = false;
                        break;
                    }
                    
                    if(j*j != tmp){
                        if(used[tmp/j]){
                            ok = false;
                            break;
                        }
                    }
                    

                }
            }
            used[tmp] = 1;
            ans += ok;
        }
        cout << ans << endl;

        
        return 0;
    }

Measured memory_bytes: 24260
from fractions import gcd
a,b,c,d = map(int, input().split())
e = (c*d)//gcd(c,d)
A = (a-1)//c + (a-1)//d - (a-1)//e
B = b//c + b//d - b//e
print((b-a+1)-(B-A))

Measured memory_bytes: 5048
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		int leng = (k - a[n-1]) + (a[0] - 0);
		int maxLeng = leng;
		for (int i = 0; i < n - 1; i++) {
			int tmpLeng = a[i + 1] - a[i];
			leng += tmpLeng;
			if (tmpLeng > maxLeng) {
				maxLeng = tmpLeng;
			}
		}
		System.out.println(leng - maxLeng);
		sc.close();
	}
}

Measured memory_bytes: 60516
#include <iostream>
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define debug int debug = 0;
#define RREP(i,a) for(int i=a-1;i>=0;i--)
#define rrep(i,a,b) for(int i=a-1;i>=b;i--)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 1000000007; //10^9+7

int main() {
    int n;
    ll a[10002];
    cin >> n;
    ll A;
    int ans = 0;
    REP(i, n){
        int cnt = 0;
        cin >> A;
        while(A % 2 == 0){
            cnt += 1;
            A /= 2;
        }
        a[i] = cnt;
    }
    REP(i, n){
        ans += a[i];
    }
    print(ans);
}

Measured memory_bytes: 384
#include <stdio.h>
 
int main(void) {
    int i,j;
    int a[10];
    int temp;
    for(i=0;i<10;i++)scanf("%d",&a[i]);
    for(i=9;i>=0;i--) {
        for(j=0;j<i;j++) {
            if(a[j]<a[j+1]) {
                temp=a[j];
                a[j]=a[j+1];
                a[j+1]=temp;
            }
        }
    }
    for(i=0;i<3;i++)printf("%d\n",a[i]);
    return 0;
}

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

using namespace std;

typedef pair<int,int> pint;
vector<int> edge[10001];
vector<pint> edge2[10001];
int mp[5001],tc[10001];
int inf=1000000000;
int main(){
    int n,k;
    cin>>n>>k;
    pint tw[5001];
    for(int i=0;i<n;++i){
        cin>>tw[i].first>>tw[i].second;
    }
    for(int i=0;i<k;++i){
        int src,dst;
        cin>>src>>dst;
        edge[src-1].push_back(dst-1);
        edge[dst-1].push_back(src-1);
    }
    for(int i=0;i<n;++i){
        int cost=tw[i].first,dist=tw[i].second;
        memset(mp,-1,sizeof(mp));
        mp[i]=0;
        queue<int> q;
        q.push(i);
        while(!q.empty()){
            int t=q.front();q.pop();   
            for(int j=0;j<edge[t].size();++j){
                int cur=edge[t][j];
                if(mp[cur]==-1){
                    mp[cur]=mp[t]+1;
                    if(mp[cur]>dist) break;
                    edge2[i].push_back(make_pair(cost,cur));
                    q.push(cur);
                }
            }
        }
    }
    for(int i=0;i<n;++i) tc[i]=inf;
    tc[0]=0;
    priority_queue<pint> pq;
    pq.push(make_pair(0,0));
    while(!pq.empty()){
        pint pi=pq.top();pq.pop();
        int t=pi.second;
        for(vector<pint>::iterator it=edge2[t].begin();it!=edge2[t].end();++it){
            if(tc[it->second]>tc[t]+it->first){
                tc[it->second]=tc[t]+it->first;
                pq.push(make_pair(tc[it->second],it->second));
            }
        }
    }
    cout<<tc[n-1]<<endl;
    return 0;
}

Measured memory_bytes: 127576
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define acc(v) accumulate(v.begin(), v.end(), 0)

using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;

int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> p(n);
	rep(i,n){
		cin >> p[i];
	}
	ll sum = 0;
	pair<ll, int> P = make_pair(0,-1);
	rep(i, n)
	{
		if(i+k-1 >= n)
			break;
		if (i == 0)
		{
			rep(j,k){
				sum += p[j];
			}
		}else{
			sum -= p[i - 1];
			sum += p[i + k-1];
		}
		if(sum > P.first){
			P = make_pair(sum, i);
		}
	}
	double ans = 0;
	rep(i,k){
		ans += 1.0 * (p[P.second + i] + 1) / 2;
	}
	printf("%.6f\n", ans);
	return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;

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

#define int  long long int
#define pb push_back
#define fe first
#define lb lower_bound 
#define ub upper_bound
#define pii pair<pair<int,int>,pair<int,int> >
#define se second
#define endl "\n"
#define pi pair<int, int>
#define vi vector<int> 
#define vvi vector<vi>
#define bs   binary_search
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)	
#define all(c) (c).begin(),(c).end()
#define sz(x)       (int)x.size() 
#define PI 3.14159265358979323846

const int N =1e5+5;

int mod= 1e9+7;
int dx[4]={0,0,+1,-1};
int dy[4]={+1,-1,0,0};

void solve(){
  string s,p;
  cin>>s>>p;

   int cnt=0;
    
  rep(i,0,sz(s)){
	  if(s[i]==p[i])
		   cnt++;
  }
  cout<<cnt<<endl;


}

int32_t main() {
	cool;
	int t=1;
	//cin>>t;
	while(t--)
		solve();


	return 0;	   
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n;cin >> n;
  string S="No";
  for (int i=1;i<10;i++) {
    for (int j=1;j<10;j++) {if (i*j==n) S="Yes";}
  }
  cout << S << endl;
}


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

int main()
{
    int n;
    cin >> n;
    int p;
    int cnt = 0;
    int mini = 200010;
    for(int i = 0; i< n; i++){
        cin >> p;
        mini = min(mini, p);

        if(p == mini) cnt++;
    }

    cout << cnt << endl;
}

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

a = [0] * n
b = [0] * n

for i in range(n):
    a[i], b[i] = map(int, input().split())

magic = [float("inf")] * (h + 1)
magic[0] = 0

for i in range(n):
    for j in range(0, h + 1):
        if j + a[i] <= h:
            magic[j + a[i]] = min(magic[j + a[i]], magic[j] + b[i])
        else:
            magic[h] = min(magic[h], magic[j] + b[i])

print(magic[h])

Measured memory_bytes: 50012
import sys
from collections import deque
inputs = sys.stdin.readlines()

n = int(inputs[0])
edges = [tuple(map(int, x.split())) for x in inputs[1:]]
to_edges = [e[1] for e in edges] 

tree = [[] for _ in range(n + 1)]
for x, y in edges:
    tree[x].append(y)

queue = deque([1])
colors = [0] * (n + 1)
while queue:
    x = queue.popleft()
    c = 0
    for y in tree[x]:
        c += 1 + (c + 1 == colors[x])
        colors[y] = c
        queue.append(y)

print(max(colors))
for e in to_edges:
    print(colors[e])

Measured memory_bytes: 36048
#include<iostream>
#include<vector>
#include<queue>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstdlib>

using namespace std;

struct edge{
  int src, dst, w;
  edge(int src, int dst, int w):src(src),dst(dst),w(w){}
  bool operator<(const edge &t)const{
    if( w != t.w ) return w > t.w;
    if( src != t.src ) return src < t.src;
    return dst < t.dst;
  }
};
typedef vector<edge> edges;
typedef vector<edges> graph;

const int N = 10010;
const int INF = 800000010;

double mst_prim(const graph &g, int r, bool ran[N]){
  const int n = g.size();
  double ret = 0;
  bool vis[n];
  
  fill(vis,vis+n,false);
  priority_queue<edge> Q;
  Q.push( edge(-1,r,INF-0) );
  ran[r] = true;
  while(!Q.empty()){
    edge e = Q.top(); Q.pop();
    if( vis[e.dst] ) continue;
    //cout << e.w << ' ' << -e.w + 10000 << ' ' << ret << endl;
    ret += sqrt(-e.w+INF);
    vis[e.dst] = true;
    ran[e.dst] = true;
    for(int i = 0; i < (int)g[e.dst].size(); ++i){
      if( !vis[g[e.dst][i].dst] ) Q.push( g[e.dst][i] );
    }
  }
  return ret;
}

#define SQ(a) ((a)*(a))

int main()
{
  int n,m;
  while(EOF!=scanf("%d%d",&n,&m)){
    int x[n],y[n];
    bool ran[N];
    double total = 0;
    graph g(n);

    for(int i = 0; i < n; ++i){
      scanf("%d%d", &x[i], &y[i]);
    }
    fill(ran,ran+n,false);
    
    for(int i = 0; i < m; ++i){
      int p,q;
      scanf("%d%d", &p, &q);
      --p;
      --q;
      int w = SQ(abs(x[p]-x[q])) + SQ(abs(y[p]-y[q]));
      total += sqrt(w);
      g[p].push_back( edge(p,q,INF-w) );
      g[q].push_back( edge(q,p,INF-w) );
    }

    double rem = 0;
    for(int i = 0; i < n; ++i){
      if(!ran[i]){
	double tmp = mst_prim(g,i,ran);
	//cout << tmp << endl;
	rem += tmp;
      }
    }
    printf("%.12lf\n", total-rem);
    
  }
  return 0;
}

Measured memory_bytes: 2464
#if 1

#include <bits/stdc++.h>
using namespace std;
int a[200005],n;

int main()
{
    scanf("%d",&n);
    for(int i = 1;i <= n;i++)
    {
        scanf("%d",&a[i]);
    }
    long long cnt,ans = 0;
    for(int i = 1;i < n;i++)
    {
        int l = 1,r = n;
        cnt = 0;
        while(l < n-i)
        {
            if(l == r||l-i == r) break;
            cnt += a[l];
            cnt += a[r];
            ans = max(ans,cnt);
            l += i;
            r -= i;
        }
    }
    printf("%lld",ans);
}

#endif // 1++

Measured memory_bytes: 640
import java.util.*;


public class Main {
	int MOD = 1000000007;
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			String s = sc.next();
			char [] data = s.toCharArray();
			int n = data.length;
			
			long sum = (long)n * (n - 1) / 2 + 1;
			ArrayList<ArrayList<Integer>> list = new ArrayList<>();
			for(int i = 0; i < 26;i++){
				list.add(new ArrayList<>());
			}
			for(int i = 0; i < n; i++){
				list.get(data[i] - 'a').add(i);
			}
			
			long count = 0;
			for(int i = 0; i < 26; i++){
				int size = list.get(i).size();
				if(size < 2)continue;
				long calc = (long)size * (size - 1) / 2;
				
				count += calc;
			}
			System.out.println(sum - count);
		}
	}



	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

}


Measured memory_bytes: 32988
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int []a = new int[n];

		for(int i=0;i<n;i++) {
			a[i] = scan.nextInt();
		}

		Arrays.parallelSort(a);

		System.out.println(a[n/2]-a[n/2-1]);
	}

}


Measured memory_bytes: 60048
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define PI 3.14159265358979323846
#define INF 2000000007
#define LINF 100000000000000007
#define MOD 1000000007
#define MOD2 998244353
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 0
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long ll;
typedef pair<int,int> P;
struct edge{int to,cost;};
int ceil2(int a,int b){if(a%b){return a/b+1;}else{return a/b;}}
using namespace std;
int n,m,k;
int ans;
int extgcd(int a,int b,int &x,int &y){
	int g=a;
	x=1,y=0;
	if(b!=0){
		g=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}
	return g;
}
 
// 逆元
int mod_inverse(int a,int m){
	int x, y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}
 
// 階乗
std::vector<int>fact;
void mod_fact(int n, int m){//N,MOD
	fact.resize(n+1);
	fact[0]=1;
	for(int i=1;i<=n;i++){
		fact[i]=fact[i-1]*i%m;
	}
}
 
// nCk mod p
int mod_nCr(int n, int k, int m){
	if(n<k)return 0;
	return fact[n]*mod_inverse(fact[k]*fact[n-k]%m,m)%m;
}
long long modpow(long long a, long long n, long long mod) {
    long long res=1;
    while (n>0) {
        if (n&1)res=res*a%mod;
        a=a*a%mod;
        n>>=1;
    }
    return res;
}
signed main(){
	
	cin>>n>>m>>k;
	mod_fact(222222,MOD2);
	//i組隣り合うとき並べ方
	//m*n-1Ci*(m-1)^(n-1-i)
	rep(i,k+1){
		int sans=m;
		int comb=mod_nCr(n-1,i,MOD2);
		int nuri=modpow(m-1,n-1-i,MOD2);
		sans*=comb;sans%=MOD2;
		sans*=nuri;nuri%=MOD2;
		ans+=sans;ans%=MOD2;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 5092
#include <iostream>
#define M 104976

using namespace std;

int main() {

	int a=2, n, s, l[10001];
	bool x[M];

	for(int i=2; i<=M; i++) {
		x[i]=false;
	}
	for(int i=2; i<324; i++) {
		if(x[i])
			continue;
		for(int j=i*2; j<M; j+=i) {
			if(!x[j])
				x[j]=true;
		}
	}

	l[1]=2;
	for(int i=3; i<M; i+=2) {
		if(!x[i]) {
			l[a]=i;
			a++;
		}
	}

	while(cin >> n) {
		if(n==0)
			break;
		s=0;
		for(int i=1; i<n+1; i++) {
			s+=l[i];
		}
		cout << s << endl;
	}
	

	return 0;

}

Measured memory_bytes: 0
S=input()
aa=int(S[0])
a=int(S[1])
bb=int(S[2])
b=int(S[3])
a=a+aa*10
b=b+bb*10
if 0<a<13 and 0<b<13:
  print("AMBIGUOUS")
elif a==0 or a>12:
  if b==0 or b>12:
    print("NA")
  else:
    print("YYMM")
elif b==0 or b>12:
  if a==0 or a>12:
    print("NA")
  else:
    print("MMYY")


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

int main(){
	int i,n,j,k,cur=0,total=0;
	char a[20001];
	int area[10000];
	stack<int> s;
	stack<pair<int,int> > scur;
	scanf("%s",a);
	int cua=0;
	int flag=1;
	int l=strlen(a);
	for(i=0;i<l;i++){
		if(a[i]=='\\'){
			s.push(i);
		}
		if(a[i]=='/' && s.size()){
			j=s.top();
			n = i-s.top();
			total+=n;
			s.pop();
			while(scur.size() && scur.top().first > j){
				n+=scur.top().second;
				scur.pop();
			}
			scur.push(make_pair(j,n));
		}
	}
	j=scur.size();
	printf("%d\n%d",total,j);
	for(i=0;i<j;i++){
		area[i]=scur.top().second;
		scur.pop();
	} 
	for(i--;i>=0;i--){
		printf(" %d",area[i]);
	}
	printf("\n");
}


Measured memory_bytes: 3340
#include<iostream>
#include<cstdio>
using namespace std;
int a[100010];
int b[100010];

int main(void)
{
    int m,n,p,ac=0,wa=0;
    string s;
    cin >> n >> m;
    for(int i=1;i<=m;i++)
    {
        cin >> p >> s;
        if(s=="WA" && a[p]==0) b[p]++;
        else if(s=="AC" && a[p]==0)
            ac++,a[p]=1;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i]==1)
            wa+=b[i];
    }
    cout << ac << ' ' << wa;
    return 0;
}


Measured memory_bytes: 1024
/*		     ___
			(._.)
			<|>         HELLO IT'S ME! KINGSLEY ZHONG!
			_/\_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          ___   ____
        /' --;^/ ,-_\     \ | /
       / / --o\ o-\ \\   --(_)--
      /-/-/|o|-|\-\\|\\   / | \
       '`  ` |-|   `` '
             |-|
             |-|O                    2020 @ CodeForces, CodeChef, CCC & More!
             |-(\,__
          ...|-|\--,\_....
      ,;;;;;;;;;;;;;;;;;;;;;;;;,.
~~,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,  ______   ---------   _____     ------
 */


//Optimisation
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")\
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


//Imports
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <map>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <queue>
#include <vector>

using namespace std;

//Macros
#define el '\n'
#define elc << el;
#define debug(x) cout << ">>" << x << el;
#define rep(i, c) for(int i = 0; i <(c); ++i)
#define fora(i, s, c) for(int i = (s); i < (c); ++i)
#define forr(i, s, c) for(int i = (s); i > (c); --i)
#define pb push_back
#define eb emplace_back
#define ff first;
#define ss second;
#define mp make_pair;
#define all(p) p.begin(),p.end()
#define max(x,y) (x>y)?x:y
#define min(x,y) (x<y)?x:y
#define mid(s,e) (s+(e-s)/2)
#define absv(a) (a<0)?(-1*a):a
#define negv(a) (a>0)?(-1*a):a
#define arrset(a,b,v) rep(i, b) a[i]=v //Sets array to a value, where a is the array, b is the count, and v is the value

//Typedefs
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;

//Random Stuff
#define Pi 3.141592653589793
#define space << ' ' <<
const ll mod = 1000000007;

//Functions
inline int twop(int n) { return 1 << n; }
template<class T> T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);}
template<class T> T lcm(T a, T b ){return (a*b)/gcd(a,b);}

//Testcase start
#define tcs() int testcases; cin >> testcases; while(testcases--)

int main() {
	//Fast io for cin / cout
	ios_base::sync_with_stdio(false);
	cin.tie(0); //Comment out if there is large exchange of cin / cout
	cout.tie(0);

	//USE FOR TESTCASE PROBLEMS
	long double sum;
	cin >> sum;

	long double s1 = sum/3;
	long double op = (s1*s1*s1);
	cout << fixed << showpoint;
	cout << setprecision(10);
	cout << op elc;

	return 0;
}


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

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int K;
  cin >> K;
  char c = S[K-1];
  string ans;
  
  for(int i = 0;i<N;i++){
    if(S[i] != c) ans.push_back('*');
    else ans.push_back(S[i]);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
///     へ　　　　　／|
///　　/＼7　　　 ∠＿/
///　 /　│　　 ／　／
///　│　Z ＿,＜　／　　 /`ヽ
///　│　　　　　ヽ　　 /　　〉
///　 Y　　　　　`　 /　　/
///　?●　?　●　　??〈　　/
///　()　 へ　　　　|　＼〈
///　　>? ?_　 ィ　 │ ／／
///　 / へ　　 /　?＜| ＼＼
///　 ヽ_?　　(_／　 │／／
///　　7　　　　　　　|／
///　　＞―r￣￣`?―＿
#include<bits/stdc++.h>
using namespace std;

char s[202020];
int sums = 0, ans = 0;

int main() {
	gets(s);
	int len = strlen(s);
	for(int i = 0; i < len; i++) {
		if(s[i] == 'S') {
			sums++;
		}
		if(sums && s[i] == 'T') {
			sums--;
			ans += 2;
		}
	}
	printf("%d\n", len - ans);
	return 0;
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

#define PB push_back
#define MP make_pair
#define F first
#define S second

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

#define MAX(a,b,c) (max(max(a,b),c))
#define MIN(a,b,c) (min(min(a,b),c))

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<int>::iterator vit;

const int N=1e9+7;

int32_t main(){
    IOS;
    int n;
    set<int> s;
    REP(i,1,10){
        REP(j,1,10) s.insert(i*j);
    }
    cin>>n;
    if(s.count(n)) cout<<"Yes";
    else cout<<"No";
    return 0;
}


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

using namespace std;

using lint = long long;

#define MOD_NUMBER 1000000007

template <class T> void vector_print(vector<T> vec) {
  for (unsigned int i = 0; i < vec.size(); i++) {
    cout << vec.at(i);
    if (i < vec.size()-1) {
      cout << " ";
    } else if (i == vec.size()-1) {
      cout << endl;
    }
  }
}

int main() {
  string S;
  cin >> S;
  if (S == "ABC") {
    cout << "ARC" << endl;
  } else if (S == "ARC") {
    cout << "ABC" << endl;
  }
  return 0;
}


Measured memory_bytes: 3620
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using static System.Console;
using static System.Math;

namespace ConstructLibrary
{
    class AOJ0583
    {
        static void Main(string[] args)
        {
            var N = int.Parse(ReadLine());
            var A = ReadLine().Split()
                .Select(n => long.Parse(n)).ToArray();

            long gcd = A[0];
            var nt = new NumberTheory();
            for (int i = 2; i <= N; i++)
            {
                gcd = nt.GCD(gcd, A[i - 1]);
            }

            var result = nt.Divisor(gcd).OrderBy(n => n).ToList();
            foreach (long div in result)
            {
                WriteLine(div.ToString());
            }
            ReadKey();
        }
    }

    class NumberTheory
    {
        internal long GCD(long A, long B)
        {
            long R = A;

            while (R > 0)
            {
                R = A % B;
                A = B;
                B = R;
            }
            return A;
        }

        internal IEnumerable<long> Divisor(long N)
        {
            for (int i = 1; i * i <= N; i++)
            {
                if (N % i == 0)
                {
                    yield return i;
                    if (i * i != N) yield return N / i;
                }
            }
            yield break;
        }
    }
}



Measured memory_bytes: 16292
//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

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

#define error(x) cout << #x << " = " << x << endl

using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;

const int N = 1e5 + 20;
int n, sz[N];
vector <int> g[N];

void dfs (int v, int par = -1)
{
	sz[v] = 1;

	int cnt = 0;

	for (int u : g[v])
	{
		if (u == par) continue;

		dfs(u, v);

		cnt += (sz[u] & 1);

		sz[v] += sz[u];
	}

	if (cnt >= 2)
	{
		cout << "First\n";
		exit(0);
	}
}

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

	cin >> n;
	for (int i = 0, u, v; i < n - 1; i++)
	{
		cin >> u >> v;
		u--, v--;

		g[u].pb(v);
		g[v].pb(u);
	}

	if (n & 1) return cout << "First\n", 0;

	dfs(0);

	cout << "Second\n";
}


Measured memory_bytes: 6144
n, a, b = map(int, input().split())

mmod = 10**9 + 7


def comb_mod(n, r, mod=mmod):
    nume = 1
    deno = 1

    r = min(r, n - r)

    for i in range(1, r + 1):
        nume = (nume * (n + 1 - i)) % mod
        deno = (deno * i) % mod

    return (nume * pow(deno, mod - 2, mod)) % mod


result_a = comb_mod(n, a)
result_b = comb_mod(n, b)
total = (pow(2, n, mmod) - result_a - result_b - 1) % mmod

print(total)


Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>

using namespace std;

#define MAX 51
typedef pair<double,double> P;
 
int main(){
    int n,t = 1;
 
    while(cin >> n,n){
	vector<P> v;
	double ans = 0, x ,y;
	for(int i = 0 ; i < n ; i++){
	    cin >> x >> y;
	    v.push_back(P(x,y));
	}  
	for(int i = 1; i < n+1 ; i++){
	    ans += (v[i%n].first-v[i-1].first)*(v[i%n].second+v[i-1].second);
	}
	ans /= 2.0;
	printf("%d %.1f\n" ,t++ ,abs(ans));
    }
    return 0;
}

Measured memory_bytes: 3204
N = int(input())
T = list(map(int, input().split()))
A = list(map(int, input().split()))

tmax = T[-1]
amax = A[0]
tf = T.index(tmax)
af = N - (list(reversed(A))).index(amax) - 1

if tf > af or tmax != amax:
	print(0)

else:
	ans = 1
	for i in range(1, tf + 1):
		if T[i] == T[i - 1]:
			ans = (ans * T[i - 1]) % 1000000007

	for i in range(af - tf - 1):
		ans = (ans * tmax) % 1000000007
	for i in range(af + 1, N):
		if A[i] == A[i - 1]:
			ans = (ans * A[i - 1]) % 1000000007

	print(ans)

Measured memory_bytes: 18756
s=input();q=int(input());query=[input() for i in range(q)]

flag = 1
front = ""
back = ""

for i in range(q):
    t = query[i]
    if t[0] == "1":
        flag *= -1
    else:
        dest = (1 if t[2] == "1" else -1) 
        tmp = t[4]
        if flag*dest == 1:
            front += tmp
        else:
            back += tmp
            
if flag == 1:
    s = front[::-1] + s + back
    print(s)
else:
    s = back[::-1] + s[::-1] + front
    print(s)

Measured memory_bytes: 16888
s=list(input())
S=[]
n=0
while n+1<len(s):
    if s[n:n+2]==["B","C"]:
        S.append("D")
        n+=1
    else:
        S.append(s[n])
    n+=1
a=0
ans=0
for i in range(len(S)):
    if S[i]=="D":
        ans+=a
    elif S[i]=="A":
        a+=1
    else:
        a=0
print(ans)

Measured memory_bytes: 6436
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)

int main() {
	ll H, W, A, B;
	cin >> H >> W >> A >> B;


	rep(i, 0, H) {
		if (i < B) {
			cout << string(A, '1') << string(W - A, '0') << endl;
		}
		else {
			cout << string(A, '0') << string(W - A, '1') << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h> 
using namespace std; 
#define MAXC 3000

char cads[MAXC+1], cadt[MAXC+1];
int dp[MAXC+1][MAXC+1];
int s,t;
char lcs[MAXC+1];

int main() { 
	int i,j, posicion;
	scanf("%s",cads);
	scanf("%s",cadt);
	s=strlen(cads); t = strlen(cadt);
	for (i=0; i<=s; i++) {
		dp[i][0]=0;
	}
	for (j=1; j<=t; j++) {
		dp[0][j]=0;
	}

	for (i=1;i<=s; i++) {
		for (j=1; j<=t; j++) {
			if (cads[i-1]==cadt[j-1]) {
				dp[i][j]=dp[i-1][j-1]+1;
			}
			else {
				dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
			}
		}
	}
	/*for (i=0; i<=s; i++) {
		for (j=0; j<=t; j++) {
			printf("%5d", dp[i][j]);
		}
		printf("\n");
	}
	printf("%d\n",dp[s][t]);*/
	posicion=dp[s][t];
	lcs[posicion]=0;
	for (i=s, j=t; i>0 && j>0; ) {
		if (cads[i-1]==cadt[j-1]) {
			posicion--; i--; j--;
			lcs[posicion]=cads[i];
		}
		else if (dp[i-1][j]>dp[i][j-1]) {
			i--;
		}
		else {
			j--;
		}
	}
	printf("%s\n", lcs);
	return 0; 
} 


Measured memory_bytes: 38772