akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>

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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

using namespace std;

#ifdef INPUT
#include <sstream>
stringstream input(R"(
10
1 2 4 8 16 32 64 128 256 512
)");
#define cin input
#endif

ll inv_mod( ll a, ll m )
{
  ll b, x, u, q, abs_m, tmp; 

  abs_m = ( m < 0 ) ? -m : m;
  b = m; x = 1; u = 0; 
  while ( b > 0 ) {
    q = a / b; 
    tmp = u; u = x - q * u; x = tmp;
    tmp = b; b = a - q * b; a = tmp;
  }

  return ( x < 0 ) ? abs_m + x : x;
}

int main()
{
	int k, m;
	cin >> k >> m;

    int n = k * m;

	const ll mod = 998244353ull;

    vector<ll> frac(n + 1);
    frac[0] = 1;
    REP (i, n)
        frac[i + 1] = frac[i] * (i + 1) % mod;

    vector<ll> fraci(n + 1);
    fraci[n] = inv_mod(frac[n], mod);
    for (auto i = n; i > 0; --i)
        fraci[i - 1] = fraci[i] * i % mod;

	for (int i = 2; i <= k * 2; ++i)
	{
        ll r = 0;
        int x = i;
        if (x > k)
            x = k * 2 - i + 2;
        for (int j = 0; j <= (x) / 2; ++j)
        {
            if (m < j * 2)
                break;
            r += (2 * mod + (frac[m + k - 1 - j * 2] * fraci[m - j * 2] % mod * fraci[k - 1] % mod *
                (frac[(x) / 2] * fraci[(x) / 2 - j] % mod * fraci[j] % mod) % mod) *
                (j % 2 ? -1 : 1)) % mod;
        }
        r %= mod;
    	cout << r << endl;
	}

	return 0;
}


Measured memory_bytes: 62720
#include<bits/stdc++.h>
using namespace std;
#define MAX 2005
bitset<MAX*MAX> dp[2];
int a[MAX];
int main()
{
	int n,sum=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	dp[0].set(0);
	for(int i=1;i<=n;i++)
	{
		dp[i&1]=dp[(i-1)&1]|dp[(i-1)&1]<<a[i-1];
	}
	for(int i=(sum+1)/2;i<=sum;i++)
	{
		if(dp[1][i] || dp[0][i])
		{
			cout<<i<<endl;
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 2688
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>

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

int n,m;
vector<int> parent;

int uf_find(int a)
{
    if(parent[a]==a) return a;
    return parent[a]=uf_find(parent[a]);
}

void uf_union(int a, int b)
{
    int ap=uf_find(a);
    int bp=uf_find(b);
    if(ap==bp) return;
    parent[ap]=bp;
}

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

    cin>>n>>m;
    parent.resize(m+1);
    for(int i=0; i<=m; i++) parent[i]=i;
    vector<pii> v(n);
    for(int i=0; i<n; i++) cin>>v[i].first>>v[i].second;
    sort(v.begin(),v.end(),[&](const pii& p1, const pii& p2)->bool{
        return (p1.second==p2.second)?p1.first<p2.first:p1.second>p2.second;
    });
    int answer=0;
    for(int i=0; i<n; i++){
        if(v[i].first>m) continue;
        int pos=uf_find(v[i].first-1);
        if(pos<m){
            answer+=v[i].second;
            uf_union(pos,pos+1);
        }
    }
    cout<<answer;

    return 0;
}


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

using namespace std;

typedef long long ll;

int main() {
  ll n;
  scanf("%lld",&n);
  ll t1=(n-1)/1000000000+1,t2=t1*1000000000-n;
  printf("%d %d %d %d %d %d\n",0,0,1000000000,t2,1,t1);
  return 0;
}

Measured memory_bytes: 256
# Author: cr4zjh0bp
# Created: Sun Mar 22 22:02:37 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x, t = na()

print(max(0, x - t))

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

template<typename T>
struct rerooting{
    using F=function<T(T,int)>;//集合，頂点番号
    using M=function<T(T,T)>;

    int V;
    vector<vector<int>> G;
    vector<vector<T>> dp;
    vector<T> ans;
    // dp_v = g(merge(f(dp_c1,c1),...,f(dp_ck,ck)),v)
    F f,g;  // TxN->T
    M merge;// TxT->T，子を集約する関数，モノイド
    T gen;
    //gen: mergeの元
    rerooting(int V,F f,M merge,T gen,F g=[](T a,int b){return a;})
        :V(V),f(f),merge(merge),gen(gen),g(g),G(V),dp(V),ans(V,gen){}
    
    //bidirectional
    void add_edge(int a,int b){
        G[a].push_back(b);
        G[b].push_back(a);
    }
    T dfs1(int pre,int now){
        T ret=gen;
        for(int i=0;i<G[now].size();i++)if(G[now][i]!=pre){
            dp[now][i]=dfs1(now,G[now][i]);
            ret=merge(ret,f(dp[now][i],G[now][i]));
        }
        return g(ret,now);
    }
    void dfs2(int pre,int now,T frompar){
        for(int i=0;i<G[now].size();i++){
            if(G[now][i]==pre){
                dp[now][i]=frompar;
                break;
            }
        }
        vector<T> lsum(G[now].size()+1),rsum(G[now].size()+1);//親も混ぜて累積
        lsum[0]=gen;rsum[G[now].size()]=gen;
        for(int i=0;i<G[now].size();i++) lsum[i+1]=merge(lsum[i],f(dp[now][i],G[now][i]));
        for(int i=G[now].size();i>0;i--) rsum[i-1]=merge(rsum[i],f(dp[now][i-1],G[now][i-1]));
        for(int i=0;i<G[now].size();i++)if(G[now][i]!=pre){
            T fromme=merge(lsum[i],rsum[i+1]);
            dfs2(now,G[now][i],g(fromme,now));
        }
    }
    void build(int root=0){
        for(int i=0;i<V;i++) dp[i].resize(G[i].size());
        dfs1(-1,root);
        dfs2(-1,root,gen);
        for(int i=0;i<V;i++){
            for(int j=0;j<G[i].size();j++) ans[i]=merge(ans[i],f(dp[i][j],G[i][j]));
            ans[i]=g(ans[i],i);
        }
    }
};

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    int n;ll m;cin>>n>>m;
    auto f=[&](ll dpch,int hoge){return (dpch+1)%m;};
    auto merge=[&](ll lhs,ll rhs){return lhs*rhs%m;};
    rerooting<ll> g(n,f,merge,1);
    rep(i,n-1){
        int u,v;cin>>u>>v;u--,v--;
        g.add_edge(u,v);
    }
    g.build();
    rep(i,n)cout<<g.ans[i]<<endl;
    return 0;
}


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

int main(void){
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if(s1[s1.size()-1]==s2[0] && s2[s2.size()-1]==s3[0]) cout << "YES" << endl;
  else cout << "NO" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <string>
#include <sstream>
#define r(i,n) for(int i=0;i<n;i++)
#define R(i,c,n) for(int i=c;i<n;i++)
#define DEBUG(x) cerr << #x << ": " << x << endl;
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v)  sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

int atoi(char c) {
  return c-48;
}

int main(){
  ios::sync_with_stdio(false);
	cin.tie(0);
  string S;
  cin >> S;
  int tmp;
  char tmpc;
  int goal = 753;
  int min = 999;
  int index = 0;
  for(int i=0;i<S.length()-2;i++){
    if (abs(goal - atoi(S[i])*100-atoi(S[i+1])*10-atoi(S[i+2]))<min) {
      min = abs(goal - atoi(S[i])*100-atoi(S[i+1])*10-atoi(S[i+2]));
      index = i;
    }
  }
  cout << abs(goal - atoi(S[index])*100-atoi(S[index+1])*10-atoi(S[index+2])) << endl;
  return 0;
}

Measured memory_bytes: 256
s = []
a = []

data = gets

data.size.times do |i|
  c = data[i]

  if s.any? && c == '/'
    x = s.pop
    y = i - x
    y += a.pop[1] while a.any? && x < a.last[0]
    a << [x, y]
  end

  s << i if c == '\\'
end

A = a.map { |e| e[1] }

unless A.any?
  print "0\n0\n"
  exit
end

printf "%d\n%d %s\n", A.reduce(:+), A.size, A.join(' ')

Measured memory_bytes: 9104
question="B"
input=raw_input
if question=="A":
	t=input()
	t=t.replace("9","n")
	t=t.replace("1","o")
	t=t.replace("n","1")
	t=t.replace("o","9")
	print(t)
if question=="B":
	s=int(input())
	t=[111,222,333,444,555,666,777,888,999]
	t=filter(lambda x:x>=s,t)[0]
	print(t)
if question=="C":
	pass
if question=="D":
	pass
if question=="E":
	pass

Measured memory_bytes: 2568
using System;


public class C{
	
	public static void Main(){
	
		string[] args = Console.ReadLine().Split(' ');
		long n = Int64.Parse( args[0] );
		long k = Int64.Parse( args[1] );
		
		long num = n / k;
		long result = num * num * num;
		if( k % 2L == 0L ){
			num = 0L;
			for( long i = 1L; i <= n; i++ ){
				if( i % k == k/2L ) num++;
			}
			result += num * num * num;
		}
		Console.WriteLine(result);

	}

}

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

int main() {
    string S;
    cin >> S;
    vector<int> numbers(4);
    for (int i = 0; i < 4; i++) {
        numbers[i] = S[i] -'0';
    }

    for (int i = 0; i < (1 << 3); i++) {
        int LHS = numbers[0];
        for (int j = 0; j < 3; j++) {
            if (i & (1 << j)) LHS += numbers[j+1];
            else LHS -= numbers[j+1];
        }

        if (LHS == 7) {
            cout << numbers[0];
            for (int k = 0; k < 3; k++) {
                if (i & (1 << k)) cout << '+';
                else cout << '-';
                cout << numbers[k+1];
            }
            cout << "=7" << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define pb push_back
#define fix  cout<<std::fixed;
#define mk make_pair
#define N 100005
#define mod 1000000007
#define time  cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
#define IOS        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
  string s,t;cin>>s>>t;
  ll flag=0;
  if(s.length() +1 == t.length())

  {
    for(int i=0;i<s.length();i++)
      if(s[i]!=t[i])flag=1;

    if(flag)cout<<"No";
    else cout<<"Yes";
  }
  else cout<<"Yes";
}

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

using namespace std;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n; cin >> n;
	int x, y; cin >> x >> y;
	int mx1 = x + y, mn1 = x + y;
	int mx2 = x - y, mn2 = x - y;
	while (--n) {
		cin >> x >> y;
		mx1 = max(mx1, x + y);
		mn1 = min(mn1, x + y);
		mx2 = max(mx2, x - y);
		mn2 = min(mn2, x - y);
	}
	cout << max(mx1 - mn1, mx2 - mn2) << '\n';
	return 0;
}


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

using namespace std;
#define int int64_t
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define gsort(x) sort((x).begin(), (x).end(), greater<int>())
#define rv(s) reverse((s).begin(), (s).end())
#define pii pair<int, int>
#define re(s) reverse((s).begin(), (s).end())
#define setout(n, x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10);
const long long mod = 1e9 + 7;

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

   int r, d, x;
   cin >> r >> d >> x;

   reps(i, 10)
   {
      cout << x * r - d << '\n';
      x = (x * r - d);
   }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void)
{
    int N, D;
    cin >> N >> D;
    vector<vector<int>> X(N, vector<int>(D, 0));
    for (auto &i: X) for (auto &j: i) cin >> j;
    int temp, s;
    int ans = 0;
    int i, j, k;
    for (i = 0; i < N; i++)
    {
        for (j = i + 1; j < N; j++)
        {
            temp = 0;
            for (k = 0; k < D; k++) temp += pow(X[i][k] - X[j][k], 2);
            s = sqrt(temp);
            cerr << temp << " " << s << endl;
            ans += int(s * s == temp);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define int long long
#define FILE_IO freopen("input.txt","r",stdin)/#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for (auto &it : t) cout << it << " ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
  int n;
  cout << fixed;
  cout << setprecision(10);
  cin >> n;
  long double ret = 0.0;
  
  for (int i = 0; i < n; i++){
	    long double x;
	    cin >> x;
	    ret += (1.0 / (x * 1.000)); 
	 }
  long double cnt = 1.0 / ret;
  cout << cnt << endl;
  	
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}



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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

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

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n, p;
    cin >> n >> p;
    string s;
    cin >> s;
    ll ans = 0;
    if (p == 2 || p == 5) {
        repr(i, n) {
            if ((s[i] - '0') % p == 0) ans += i + 1;
        }
        cout << ans << endl;
        return 0;
    }
    vi sum(n+1);
    int ten = 1;
    repr(i, n) {
        sum[i] = (sum[i+1] + (s[i] - '0') * ten) % p;
        ten = ten * 10 % p;
    }
    vi r(p);
    repr(i, n+1) {
        ans += r[sum[i]];
        r[sum[i]]++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1412
using System;
using System.Linq;

class E
{
	static void Main()
	{
		var n = Console.ReadLine().Select(x => x - '0').Prepend(0).ToArray();
		var r = 0;
		for (int i = n.Length - 1; i >= 0; i--)
			if (n[i] < 5 || n[i] == 5 && n[i - 1] < 5)
			{
				r += n[i];
			}
			else
			{
				r += 10 - n[i];
				n[i - 1]++;
			}
		Console.WriteLine(r);
	}
}


Measured memory_bytes: 38828
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    Map<String, Integer> mm = new HashMap<>();
    for (int i = 0; i < N; i++) {
      char[] a = sc.next().toCharArray();
      Arrays.sort(a);
      String s = Arrays.toString(a);
      mm.put(s, mm.getOrDefault(s, 0) + 1);
    }
    
    long ans = 0;
    for (int v : mm.values()) {
      if (v >= 2) {
        ans += sum(v-1);
      }
    }
    
    System.out.println(ans);
  }

  private static HashMap<Integer, Long> cache = new HashMap<>();
  private static long sum(int v) {
    if (v == 1) {
      return 1;
    }
    Long cached = cache.get(v);
    if (cached != null) {
      return cached;
    }
    long value = v + sum(v-1);
    cache.put(v, value);
    return value;
  }
}


Measured memory_bytes: 74820
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int i = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define MP make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int MOD = 1e9 + 7;

int main() {
    string a, b, c;
    cin >> a >> b >> c;
    cout << (char)(a[0] - 0x20) << (char)(b[0] - 0x20) << (char)(c[0] - 0x20)
         << endl;
    return 0;
}

Measured memory_bytes: 256
D,G = map(int,input().split())
PC = []

L = []

t = 10 ** 9
m = 0

for i in range(1,D + 1):
  p,c = map(int,input().split())
  s = 0
  pc = []
  for j in range(p):
    s += i * 100
    if j == p - 1:
      s += c
      L.append([j + 1,s])
    if s >= G and j + 1 < t:
      t = j + 1
    pc.append([j + 1,s])
  PC.append(pc)

def recur(problems):
  #探索の終了
  if len(problems) == D:
    ans = 10 ** 9
    score = 0
    times = 0
    #全部使用した問題セットの合計点と回答数を記録
    for j in range(D):
      if problems[j] == 1:
        score += L[j][1]
        times += L[j][0]
    #全問全回答の例を除く
    if score >= G:
      ans = min(ans,times)
      return ans
    #残りの数以上となる回答数のうち最小のものが見つかれば更新し
    #全回答の回答数に足す
    else:
      remain = G - score
      if remain <= max([L[i][1] for i in range(D) if problems[i] == 0]):
        for k in range(D):
          if problems[k] == 0:
            for l in range(len(PC[k])):
              if remain <= PC[k][l][1] and ans >= PC[k][l][0]:
                ans = PC[k][l][0]
        ans += times
        return ans
      else:
        return 10 ** 9
  
  else:
    #問題セットを全部使う
    ret1 = recur(problems + [1])
    #使わない
    ret2 = recur(problems + [0])
    
    return min(ret1,ret2)

print(recur([]))



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

#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
typedef long long ll;


int main(){
  ll n; cin >> n;
  vector<ll> a(n), b(n), c(n);
  rep(i, n) cin >> a[i];
  rep(i, n) cin >> b[i];
  rep(i, n) cin >> c[i];

  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());

  ll res = 0;
  ll key, numA, numC;
  ll idxA, idxC;
  for (ll i=0; i<n; ++i){
    key = b[i];
    numA = 0;
    numC = 0;
    // key未満の数を求める
    auto iterA = lower_bound(a.begin(), a.end(), key);
    idxA = distance(a.begin(), iterA);
    numA = (iterA == a.end())? n: idxA;

    // keyより大きい数を求める
    auto iterC = upper_bound(c.begin(), c.end(), key);
    idxC = distance(c.begin(), iterC);
    numC = (iterC == c.end())? 0: n - idxC;

    res += numA*numC;
  }
  cout << res << endl;
}


Measured memory_bytes: 2560
#include<iostream>
#include<vector>
#include<limits.h>
using namespace std;
int main(){
    int n,x;
    cin>>n>>x;
    vector<int>m(n);
    int min=INT_MAX;
    for(int i=0;i<n;i++)
    {
        cin>>m[i];
        if(min>m[i]){
            min=m[i];
        }
    }
    int result=0;
    for(int i=0;i<n;i++)
    {
        result+=m[i];
    }
    x-=result;
    int total=x/min;
    total+=n;
    cout<<total;
}

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;
template <class T> using vec = vector<T>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  long long x;
  scanf("%lld", &x);

  ll count = (x / (6 + 5)) * 2;
  ll m = x % (6 + 5);
  if (m > 0) count++;
  if (m > 6) count++;
  put(count);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) {
  T c = min(a, b), d = max(a, b);
  return c * (d / gcd(c, d));
}

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

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<math.h>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<stack>

#define ll long long
#define vl vector<ll>
#define vvl vector< vector<ll> >
#define vb vector<bool>
#define vbb vector< vector<bool> >
#define vs vector<string>

#define all(a) (a).begin(),(a).end()
using namespace std;

bool check(vs &ngo, string s){
	for (string t : ngo) if (t == s) return 0;
	return 1;
}

int main(){
	ll n; cin >> n;
	vs ngo(n); cin >> ngo[0];
	for (ll i = 1; i < n; ++i){
		string s; cin >> s;
		if (!check(ngo, s) || ngo[i - 1][ngo[i - 1].size() - 1] != s[0]){
			cout << "No" << endl;
			return 0;
		}ngo[i] = s;
	}
	cout << "Yes" << endl;
	return 0;
}

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


int main(){
  ll l, r;
  int ans;
  cin >> l >> r;
  ll la = l/2019, lb = l%2019, ra = r/2019, rb = r%2019;
  if(ra - la >0){
    ans = 0;
  }
  else{
    ans = 2018;
    for(int i = lb; i<rb; i++){
      for(int j = i+1; j<rb+1; j++){
        ll ans_temp = (i*j)%2019;
        if (ans_temp<ans) ans = ans_temp;
      }
    }
  }
  cout << ans;

  }


Measured memory_bytes: 3640
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <vector>
#include <cstring>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <ctime>
#include <climits>
#include <cassert>
#define fr first
#define sc second
#define MP make_pair
#define ad push_back
#define PB push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define lli long long int
#define y1 arayikhalatyan
#define j1 jiglypuff
#define ld long double
#define itn int
#define pir pair<int, int> 
#define all(x) (x).begin(), (x).end()
using namespace std;

lli gcd(lli a, lli b) { return (b == 0LL ? a : gcd(b, a % b)); }
ld dist(ld x1, ld y1, ld x2, ld y2)
{
	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
lli S(lli a)
{
	return (a * (a + 1LL)) / 2;
}
char vow[] = { 'a', 'e', 'i', 'o', 'u' };
int dx[] = { 1, -1, 0, 0, -1, -1, 1, 1 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1 };


const int N = 1e5 + 30;
const lli mod = 998244353;
const ld pi = acos(-1);
const int T = 238;
const ld e = 1e-6;

lli bp(lli a, lli b = mod - 2LL)
{
	lli ret = 1;
	while (b)
	{
		if (b & 1) ret *= a, ret %= mod;
		a *= a;
		a %= mod;
		b >>= 1;
	}
	return ret;
}
ostream& operator<<(ostream& c, pir a)
{
	c << a.fr << " " << a.sc;
	return c;
}




lli x, a, pat;
int main()
{
	fastio;
	cin >> x;
	a = 100;
	while (a < x)
	{
		pat++;
		a += a / 100;
	}
	cout << pat << endl;
	return 0;
}


/*


  __
*(><)*
  \/ /
  ||/
--||
  ||
  /\
 /  \
/    \
*/



Measured memory_bytes: 3696
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

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

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }



long long N, Z, W;
vector<long long> a;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    while (cin >> N >> Z >> W) {
        a.resize(N);
        for (int i = 0; i < N; ++i) cin >> a[i];
        if (N == 1) cout << abs(a[N-1] - W) << endl;
        else cout << max( abs(a[N-1] - W), abs(a[N-1] - a[N-2]) ) << endl;
    }

}


















Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#define int long long
using namespace std;

int a, b, c, d;
int imos[200];

signed main() {
	cin >> a >> b >> c >> d;
	imos[a]++;
	imos[b]--;
	imos[c]++;
	imos[d]--;
	
	for (int i = 1; i < 200; i++) imos[i] += imos[i - 1];
	
	int ans = 0;
	for (int i = 0; i < 200; i++) {
		ans += (imos[i] == 2);
	}
	cout << ans << endl;
	return 0;
}

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

int main()
{
    int a, b;
    cin >> a >> b;

    int counter = 1;
    int port = a;

    bool frag = true;
    if (b == 1)
    {
        frag = false;
        counter = 0;
    }
    while (frag)
    {
        if (b <= port)
        {
            break;
        }
        port += a - 1;
        counter += 1;
    }
    cout << counter << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;

long gcd(ll x, ll y)
{
    if(x < y)   swap(x, y);
    if(y == 0)  return x;
 
    return gcd(x % y, y);
}


int main()
{
    ll a, b;
    cin >> a >> b;
    ll c = gcd(a, b);
    cout << (a*b) / c << endl;
}

Measured memory_bytes: 256
function Main(input) {
    input = input.split("\n");
  	var a = input[0].split("");
  	var answer="";
    if(a[2]==a[3]&&a[4]==a[5]){
		answer+="Yes";
    }else{
		answer+="No";
    }
  	console.log(answer);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

void move(int x1, int y1, int x2, int y2){
	for (int i = 0; i < std::abs(x2 - x1); ++ i){
		if (x1 < x2){
			putchar('R');
		}
		else{
			putchar('L');
		}
	}
	for (int i = 0; i < std::abs(y2 - y1); ++ i){
		if (y1 < y2){
			putchar('U');
		}
		else{
			putchar('D');
		}
	}
}

int main(){
	int sx, sy, tx, ty;
	scanf("%d%d%d%d", &sx, &sy, &tx, &ty);
	move(sx, sy, tx, ty);
	move(tx, ty, sx, sy);
	int beginx, beginy, endx, endy;
	if (tx > sx){
		beginx = sx - 1;
		endx = tx + 1;
	}
	else{
		beginx = sx + 1;
		endx = tx - 1;
	}
	if (ty > sy){
		beginy = sy - 1;
		endy = ty + 1;
	}
	else{
		beginx = sy + 1;
		endx = ty - 1;
	}
	move(sx, sy, sx, beginy);
	move(sx, beginy, endx, ty);
	move(endx, ty, tx, ty);
	move(tx, ty, tx, endy);
	move(tx, endy, beginx, sy);
	move(beginx, sy, sx, sy);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using P = pair<int,int>;
using PP = pair<int,pair<int,int>>;
using T = tuple<string,int,int>;
const ll INF = 1LL<<60;
const int ny[4] = {-1,1,0,0}, nx[4] = {0,0,-1,1};
int sy,sx,gy,gx;


int main(){
  int h,w; cin >> h >> w;
  char g[h][w];
  rep(i,h)rep(j,w){
    cin >> g[i][j];
  }
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      cout << g[i][j];
    }
    cout << endl;
    for(int j = 0; j < w; j++){
      cout << g[i][j];
    }
    cout << 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);
        while(true){
            int H = sc.nextInt();
            int W = sc.nextInt();
            if(H==0 && W==0) break;
            for(int i=0; i<W; i++){
                System.out.print("#");
            }
            System.out.println("");
            for(int i=0; i<H-2; i++){
                System.out.print("#");
                for(int j=0; j<W-2; j++){
                    System.out.print(".");
                }
                System.out.println("#");
            }
            for(int i=0; i<W; i++){
                System.out.print("#");
            }
            System.out.println("");
            System.out.println("");
        }
    }
}


Measured memory_bytes: 35860
N=int(input())
pn=list(map(int,input().split()))
check=[0]*N
for i in range(0,N):
  if pn[i]!=(i+1):
    check[i]=1 #ok
i=0
count=0
while i<N-1:
  if check[i]==0:#if ng
    pn[i],pn[i+1]=pn[i+1],pn[i]
    count+=1
    check[i],check[i+1]=1,1
  i+=1
  pass
if check[i]==0:count+=1
print(count)



Measured memory_bytes: 14008
#include<bits/stdc++.h>
using namespace std;
main(){
  int n,a,r=30,t;
  cin>>n;
  while(n--){
    t=0;
    cin>>a;
    while(a%2==0)a/=2,t++;
    r=min(r,t);
  }
  cout<<r;
}

Measured memory_bytes: 256
N, Y = map(int, input().split())

c =False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            a = [str(i), str(j), str(N-i-j)]
            print(" ".join(a))
            c = True
            break
    if c:
        break
if not c:
    print("-1 -1 -1")


Measured memory_bytes: 9184
#include <stdio.h>

int main()
{
	int i;
	int a[5];
	/*0,W 1,H 2,x 3,y 4,r*/
	for (i = 0; i < 5; i++)
		scanf("%d", &a[i]);

	if ((a[4] <= a[2]) && (a[4] <= a[3]) && (a[2] + a[4] <= a[0]) && (a[3] + a[4] <= a[1]))
		puts("Yes");
	else
		puts("No");

	return 0;
}


Measured memory_bytes: 2068
#include<bits/stdc++.h>
#define fios ios_base::sync_with_stdio(false); cin.tie(0);
#define sf(x) scanf("%d",&x)
#define sfl(x) scanf("%lld",&x)
#define pf(x) printf("%d\n",x)
#define pfl(x) printf("%lld\n",x)
#define ll long long
#define nl "\n"
using namespace std;


int main()
{
    int len;

    cin>>len;

    string s1,s2,s3;

    cin>>s1>>s2;

    for(int i=0; i<len; i++)
    {
        s3.push_back(s1[i]);
        s3.push_back(s2[i]);
    }
    cout<<s3<<nl;

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

int main(void)
{
    string a, s, c;
    cin >> a >> s >> c;

    cout << "A" << s[0] << "C" << endl;

    return (0);
}

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

using namespace std;



int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, c, ans = 0;
  cin >> a >> b >> c;
  if (a==b && b==c && a%2==0 && b%2==0 && c%2==0) {
    cout << -1 << endl;
    return 0;
  }
  while(a%2==0 && b%2==0 && c%2==0) {
    int a1, b1, c1;
    a1 = b/2 + c/2;
    b1 = a/2 + c/2;
    c1 = a/2 + b/2;
    a = a1;
    b = b1;
    c = c1;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = [0] + list(map(int,input().split()))+[0]
alla = 0
ans = 0

for i in range(1,n+2):
	alla += abs(a[i-1]-a[i])

for i in range(1,n+1):
	ans = alla - (abs(a[i-1]-a[i]) + abs(a[i]-a[i+1]))
	ans = ans + abs(a[i-1]-a[i+1])
	print(ans)


Measured memory_bytes: 14048
#include<bits/stdc++.h>
        #include<sys/time.h>
        using namespace std;
         
        string ans="00100110010110111111110";
        const int timelim=2;
         
        int gettime(){
          timeval tv;
          gettimeofday(&tv, NULL);
          int x = tv.tv_sec % timelim * 1000 + tv.tv_usec / 1000;
          return x;
        }
         
        int T=40;
         
        int main(){
          //puts("Yes"); while (gettime()>10); return 0;
          int x=gettime()/T;
          if (x>=23){
            x=0;
          }
          puts(ans[x]=='1'? "Yes": "No");
          int aim=((x+1)*T-445+timelim*1000)%(timelim*1000);
          while (1){
            int t=gettime();
            if (t<=aim&&t>=aim-1) return 0;
          }
        }

Measured memory_bytes: 384
C = []
for i in range(3):
    C.append(list(map(int, input().split())))
b = [C[0][0],C[0][1],C[0][2]]
a = [0,C[1][0]-b[0],C[2][0]-b[0]]
if C ==[[a[0]+b[0],a[0]+b[1],a[0]+b[2]],\
        [a[1]+b[0],a[1]+b[1],a[1]+b[2]],\
        [a[2]+b[0],a[2]+b[1],a[2]+b[2]]]:
    print('Yes')
else:
    print("No")


Measured memory_bytes: 3316
#include<stdio.h>
#include<string.h>

int main(){
    int i,/* a[10],*/ ans = 0, max = 0;
    char s[10] = {0};
    scanf("%s",s);
    for(i = 0; i < 10; i++){
        if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T' ){
            //a[i] = 1;
            ans++;
        }else{
            //a[i] = 0;
            ans = 0;
        }
        if(max < ans){
            max = ans;
        }
    }
    printf("%d",max);

    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <utility> 

#define rep(i,m,n) for(int i = m;i < n;++i)
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;



void chmax(ll &a,ll b) {
	if (a < b)a = b;
}


string K;
ll dp[10101][101][2];
int D;

int main() {
	cin >> K;
	cin >> D;
	int n = K.size();

	dp[0][0][0] = 1;

	//配るDP
	rep(dgt, 0, n)rep(d, 0, D)rep(isless, 0, 2) {
		int c = K[dgt] - '0';
		rep(nxt, 0, 10) {
			if (isless)dp[dgt+1][(d+nxt)%D][1] += dp[dgt][d][1]%MOD;
			else {
				if (nxt < c)dp[dgt + 1][(d + nxt) % D][1] += dp[dgt][d][0]%MOD;
				else if (nxt == c)dp[dgt + 1][(d + nxt) % D][0] += dp[dgt][d][0]%MOD;
			}
		}
	}

	cout << (dp[n][0][0] + dp[n][0][1] - 1)%MOD << endl;


	
	return 0;
}

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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define repU(i,s,t) for(auto (i) = (s); (i) <= (t); ++(i))
#define repD(i,t,s) for(auto (i) = (t); (i) >= (s); --(i))
#define all(v)  begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define q_ceil(n,d) ((n - 1)/(d) + 1)
#define parity(a,b) ((a)^(b) & 1LL ^ 1LL)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = -1 + (1 << 30);
const ll INF_64 = -1 + (1LL << 62);
const int MOD = 1e9 + 7;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	ll x,y; cin>>x>>y;
	if((y - x) % 3){
		if(abs(x - y) == 1) cout<<"Brown\n";
		else cout<<"Alice\n";
	}else{
		if(x == y)  cout<<"Brown\n";
		else cout<<"Alice\n";
	}
	
	return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1ll << 50;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define itn int
#define asn ans
bool dbg = false;

string S;

void solve() {
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> S;
    Yes(S[2] == S[3] && S[4] == S[5]);


    solve();
    return 0;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val (h1, w1) = readLine()!!.split(' ').map { it.toInt() }

    val grid = Array(h) { BooleanArray(w) { true } }

    (0 until h1).forEach { i ->
        (0 until w).forEach { j ->
            grid[i][j] = false
        }
    }

    (0 until w1).forEach { i ->
        (0 until h).forEach { j ->
            grid[j][i] = false
        }
    }

    println(grid.map { it.filter { b -> b }.count() }.sum())
}


Measured memory_bytes: 38300
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

import fractions

A,B = two_int()

print((A * B)//fractions.gcd(A,B))

Measured memory_bytes: 66028
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<int, pair<int, int>> PP;
typedef pair<P, int> PPi;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

double maxv[50000];

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

    int n;
    cin >> n;
    vector<int> t(n + 1), v(n + 1);
    t[0] = 0, v[0] = 0;
    for(int i = 1; i <= n; ++i){
        cin >> t[i];
        t[i] <<= 1;
        t[i] += t[i - 1];
    }
    for(int i = 1; i <= n; ++i){
        cin >> v[i];
        maxv[t[i - 1]] += v[i];
        maxv[t[i]] -= v[i];
    }
    for(int i = 0; i < t[n]; ++i)   maxv[i + 1] += maxv[i];
    for(int i = 1; i + 1 <= n; ++i) maxv[t[i]] = min(v[i], v[i + 1]);
    maxv[0] = 0;
    for(int i = 0; i < t[n]; ++i)   chmin(maxv[i + 1], maxv[i] + 0.5);
    for(int i = t[n] - 1; i >= 0; --i)  chmin(maxv[i], maxv[i + 1] + 0.5);
    double ans = 0;
    for(int i = 0; i < t[n]; ++i)   ans += (maxv[i] + maxv[i + 1]) * 0.25;
    cout << fixed << setprecision(15);
    cout << ans << endl;
}

Measured memory_bytes: 512
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');
		int n = int.Parse(input[0]);
		int k = int.Parse(input[1]);
    long[][] vertexes = new long[n][];//ここに受け取る
    long[,] sumBlacks = new long[k,k];//0
    long[,] sumWhites = new long[k,k];//1
    long answer = 0;
    for(int i = 0; i < n; i++)
    {
      vertexes[i] = new long[3];
      var nums = Console.ReadLine().Split(' ');
      vertexes[i][0] = long.Parse(nums[0])%k;
      vertexes[i][1] = long.Parse(nums[1])%k;
      if(nums[2] == "B" && (long.Parse(nums[0])/k + long.Parse(nums[1])/k)%2 == 0 ||
        nums[2] == "W" && (long.Parse(nums[0])/k + long.Parse(nums[1])/k)%2 == 1)
      {
        vertexes[i][2] = 0;
      }else vertexes[i][2] = 1;
    }

    for(int i = 0; i < n; i++)
    {
      //Console.WriteLine(vertexes[i][0]+" "+vertexes[i][1]+" "+vertexes[i][2]+"aa");
      if(vertexes[i][2] == 0)
      {
        sumBlacks[vertexes[i][0],vertexes[i][1]]++;
      }else sumWhites[vertexes[i][0],vertexes[i][1]]++;
    }
    sumBlacks = Sum2D(sumBlacks);
    sumWhites = Sum2D(sumWhites);

    for(int i = 0; i <= k; i++)//(i,j)がBの右下
    {
      for(int j = 0; j <= k; j++)
      {
        long answerMemo = sumWhites[k,k];
        answerMemo -= sumWhites[i,j];
        answerMemo += sumBlacks[i,j];
        if(i <= k && j <= k)
        {
          answerMemo -= Sum2DAnswer(sumWhites,i,k-1,j,k-1);
          answerMemo += Sum2DAnswer(sumBlacks,i,k-1,j,k-1);
        }
        answer = Math.Max(answer,answerMemo);

        answerMemo = sumBlacks[k,k];
        answerMemo -= sumBlacks[i,j];
        answerMemo += sumWhites[i,j];
        if(i <= k && j <= k)
        {
          answerMemo -= Sum2DAnswer(sumBlacks,i,k-1,j,k-1);
          answerMemo += Sum2DAnswer(sumWhites,i,k-1,j,k-1);
        }
        answer = Math.Max(answer,answerMemo);

        //Console.WriteLine(i+" "+j+" "+answerMemo);
        
      }
    }

		Console.WriteLine(answer);
	}

  static long[,] Sum2D(long[,] nums)
  {//左上からi行j列の2次元累積和をO(hw)で返す
  //例えば{(1,2),(3,4)}なら{(0,0,0),(0,1,3),(0,4,10)}を返す
    int h = nums.GetLength(0);
    int w = nums.GetLength(1);
    long[,] answers = new long[h+1,w+1];

    for(int i = 1; i <= h; i++)
    {
      for(int j = 1; j <= w; j++)
      {
        answers[i,j] = answers[i,j-1]+answers[i-1,j]-answers[i-1,j-1]+nums[i-1,j-1];
      }
    }

    return answers;
  }

  static long Sum2DAnswer(long[,] sums, int hs, int hg, int ws, int wg)
  {//引数の2次元累積和に対し、0-indexで縦hs~ws横ws~wgの長方形内の和をO(1)で返す
    return (sums[hg+1,wg+1]-sums[hs,wg+1]-sums[hg+1,ws]+sums[hs,ws]);
  }
  
}

Measured memory_bytes: 56500
N, K = list(map(int, input().split()))
R, S, P = list(map(int, input().split()))
T = list(input())

ans = 0

H = [""] * N


def win(i, t):
    if t == "r":
        return P
    elif t == "s":
        return R
    else:
        return S


for i in range(N):
    if T[i] == "r":
        H[i] = "p"
    elif T[i] == "s":
        H[i] = "r"
    else:
        H[i] = "s"

for i in range(K, N):
    if H[i] == H[i-K]:
        H[i] = ""

for i in range(N):
    if H[i] == "r":
        ans += R
    elif H[i] == "s":
        ans += S
    elif H[i] == "p":
        ans += P


print(ans)


Measured memory_bytes: 50160