akhauriyash/Code-Regression huggingface dataset:
//By Vlgd
#include<bits/stdc++.h>
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
using namespace std;
class Point{
	public:
	double x,y;
	Point(double x=0,double y=0):x(x),y(y){}
	Point operator + (Point p){return Point(x+p.x,y+p.y);}
	Point operator - (Point p){return Point(x-p.x,y-p.y);}
	Point operator * (double a){return Point(a*x,a*y);}
	Point operator / (double a){return Point(x/a,y/a);}
	double abs() {return sqrt(norm());}
	double norm() {return x*x+y*y;}
	bool operator < (const Point &p) const{
		return x!=p.x?x<p.x:y<p.y;
	}
	bool operator == (const Point &p) const{
		return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
	}
};
typedef Point Vector;
typedef vector<Point> Polygon;
double dot(Vector a,Vector b){
	return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
	return a.x*b.y-a.y*b.x;
}
int contain(Polygon g,Point p){
	int n=g.size();
	bool x=false;
	for(int i=0;i<n;i++){
		Vector a=p-g[i],b=p-g[(i+1)%n];
		if(fabs(cross(a,b))<EPS && dot(a,b)<EPS) return 1;
		if(a.y>b.y) swap(a,b);
		if(a.y<EPS && b.y>EPS && cross(a,b)>EPS) x=!x;
	}
	return x?2:0;
}
main(){
	int x,y,n,q;
	Polygon p;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d%d%",&x,&y);
		Point o(x,y);
		p.push_back(o);
	}
	scanf("%d",&q);
	for(int i=0;i<q;i++){
		scanf("%d%d",&x,&y);
		Point q(x,y);
		printf("%d\n",contain(p,q));
	}
}


Measured memory_bytes: 3220
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(){
	char c;
	cin>>c;
	if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')cout<<"vowel"<<endl;
	else cout<<"consonant"<<endl;
}


Measured memory_bytes: 256
N, M = map(int,input().split())
H_list = list(map(int,input().split()))
A_list = [0]*M
B_list = [0]*M
for i in range(M):
  A_list[i],B_list[i] = map(int,input().split())

count_list = ['+']*N
for j in range(M):
  if H_list[B_list[j]-1]-H_list[A_list[j]-1] >= 0:
    count_list[A_list[j]-1] = '-'
  if H_list[A_list[j]-1]-H_list[B_list[j]-1] < 0 and count_list[A_list[j]-1] != '-':
    count_list[A_list[j]-1] = '+'

for k in range(M):
  if H_list[A_list[k]-1]-H_list[B_list[k]-1] >= 0:
    count_list[B_list[k]-1] = '-'
  if H_list[A_list[k]-1]-H_list[B_list[k]-1] < 0 and count_list[B_list[k]-1] != '-':
    count_list[B_list[k]-1] = '+'
 
print(count_list.count('+'))

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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    ll n = in();
    ll tk = 1, ao = 1;
    rep(i, n)
    {
        ll t = in(), a = in();
        ll val = max(dup(tk, t), dup(ao, a));
        tk = t * val;
        ao = a * val;
    }
    cout << tk + ao << endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    vector<int> p(n);

    for(int i=0;i<n;i++) cin>>p[i];
    sort(p.begin(),p.end());    
    reverse(p.begin(),p.end()); 
    
    int ali=0,bob=0;
    for(int i=1;i<=n;i++){
        if(i%2==0) bob+=p[i-1];
        else ali+=p[i-1]; 
    }

    printf("%d\n",ali-bob);

    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
int s;
  int ans;
cin >> s;
bool car = true;
int count  = 0;
int a[10000];
a[0] = s;
int i = 0;
while(car){
if(a[i]%2 == 0){
a[i+1] = a[i]/2;
}
else{
a[i+1] = 3*a[i]+1;
}
i++;

for(int j = 0;j < i;j++){
  if(a[i] == a[j]){
    ans = i+1;
    car = false;
  }
}
}

cout << ans <<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include <fstream>
#include <cassert>
using namespace std;

//common

typedef int  i32;
typedef long long i64,ll;
typedef long double ld;

#define BR "\n"
#define ALL(c) (c).begin(),(c).end()
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,r) for(int i=(int)l;i<(int)(r);++i)
#define EACH(it,o) for(auto it = (o).begin(); it != (o).end(); ++it)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))

//config
//#define NDEBUG
//#define INF 1<<30
//#define EPS 1e-8
//const ll MOD =100000007;

//debug
#ifdef NDEBUG
#define DUMP(x)
#define DUMPLN(x)
#define DEBUG(x)
#define DEBUGLN(x)
#define LINE()
#define LINELN()
#define CHECK(exp,act)
#define STOP(e)
#else
#define DUMP(x)  cerr << #x << " = " << (x)
#define DUMPLN(x)  DUMP(x) <<endl
#define DEBUG(x) DUMP(x) << LINE() << " " << __FILE__
#define DEBUGLN(x) DEBUG(x)<<endl
#define LINE()    cerr<< " (L" << __LINE__ << ")"
#define LINELN()    LINE()<<endl
#define CHECK(exp,act)  if(exp!=act){DUMPLN(exp);DEBUGLN(act);}
#define STOP(e)  CHECK(e,true);if(!(e)) exit(1);
#endif

template<class T> inline string toString(const vector<T>& x) {
	stringstream ss;
	REP(i,x.size()){
		if(i!=0)ss<<" ";
		ss<< x[i];
	}
	return ss.str();
}

template<class T> inline string toString(const vector<vector<T> >& map) {
	stringstream ss;
	REP(i,map.size()){
		if(i!=0)ss<<BR;
		ss<< toString(map[i]);
	}
	return ss.str();
}
template<class K,class V>  string toString(map<K,V>& x) {
	string res;stringstream ss;
	for(auto& p:x)ss<< p.first<<":" << p.second<<" ";
	return ss.str();
}

string BITtoString(int bit){
    stringstream ss;
    while(bit!=0){ss<<(bit%2);bit/=2;}
    string res=ss.str();reverse(ALL(res));
    return res;
}

template<typename T> inline T pmod(T v,T MOD){
	return (v%MOD+MOD)%MOD;
}
#define nextInt(n) scanf("%d",&n)
#define defInt(n) int n;nextInt(n)
#define nextLong(n) scanf("%lld",&n)
#define defLong(n) ll n;nextLong(n)
#define nextDouble(n) scanf("%lf",&n)

ll mod=10007;
	
class Main{
public:

	void run(){
	//	ifstream cin("in");
	//	ofstream cout( "out" );
		int N;cin >> N;
		string s;cin >> s;
		map<char,int> ni;
		ni['J']=0;ni['O']=1;ni['I']=2;
		
		vector<vector<ll>> dp(N+1,vector<ll>(8));
		dp[0][1]=1;
		for(int i=1;i<=N;i++){
			int v=ni[s[i-1]];
			REP(bit,1<<3)REP(pbit,1<<3){
				if(((bit >> v) & 1) ==0)continue;
				if((bit & pbit)==0)continue;
				dp[i][bit] =pmod(dp[i][bit]+dp[i-1][pbit],mod);
			}
		}

		ll res=0;REP(bit,1<<3)res=pmod(res+dp[N][bit],mod);
		cout << res <<endl;
	}
};
int main(){
	//cout <<fixed<<setprecision(3);	
	//ios::sync_with_stdio(false);
	Main().run();
	return 0;
}

Measured memory_bytes: 1324
#include <bits/stdc++.h>
#ifdef DEBUG
#include "_debug.cpp"
#include "callable.hpp/callable.hpp"
#endif
#define endl '\n'
using namespace std;
using ll = long long;
#define N 100
#define INF 100'000
int a[N+1][N+1];
struct edge {
    int u, v, w;
};
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m;
    cin >> n >> m;
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= n; j++) {
            a[i][j] = i == j ? 0 : INF;
        }
    }
    vector<edge> edges;
    for(int i = 0; i < m; i++) {
        int u, v, w;
        cin >> u >> v >> w;
        a[u][v] = w;
        a[v][u] = w;
        edges.push_back({u, v, w});
    }
    for(int k = 1; k <= n; k++) {
        for(int i = 1; i <= n; i++) {
            for(int j = 1; j <= n; j++) {
                a[i][j] = min(a[i][j], a[i][k] + a[k][j]);
            }
        }
    }
    int ans = m;
    for(edge& e : edges) {
        bool in_shortest_path = false;
        for(int s = 1; s <= n; s++) {
            for(int t = 1; t <= n; t++) {
                in_shortest_path |= a[s][e.u] + e.w + a[e.v][t] == a[s][t]
                                 or a[s][e.v] + e.w + a[e.u][t] == a[s][t];
            }
        }
        ans -= in_shortest_path;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <cstdio>
#include <vector>
using namespace std;
double bmi(double w, double h) {
  return w / (h * h);
}
int main() {
  vector<int> s;
  int id;
  float w, h;
  while(~scanf("%d,%f,%f", &id, &w, &h)) {
	if(bmi(w, h) >= 25) {
	  s.push_back(id);
	}
  }
  for(int i = 0; i < (int)s.size(); ++i) {
	printf("%d\n", s[i]);
  }
  return 0;
}

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

int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;//aピザx枚、bピザy枚以上ほしい
  int kaikei = 2000000000;
  if (a + b <= 2 * c) kaikei = a * x + b * y;
  else {
    int minXorY = min(x, y);
    int maxXorY = max(x, y);
    int AorB = x > y? a: b;
    kaikei = min(2 * maxXorY * c, 2 * minXorY * c + (maxXorY - minXorY) * AorB);
  }
  cout << kaikei;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
using namespace std;
int main()
{
  int N,x,count=0;
  vector<int> A(111111);
  cin>>N;
  rep(i,N){cin>>x;A.at(x-1)=i+1;}
  rep(i,N){cout<<A.at(i)<<endl;}
}

Measured memory_bytes: 1280
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <deque>
#include <queue>
#include <map>
using namespace std;

#define ii pair <int, int>
#define lli long long
#define pb push_back
#define X first
#define Y second

const int Mod = 1E9 + 7;
const int Inf = 1E9 + 7;
const int N = 2E5 + 10;

void Input()
{

}

void Solve()
{
    lli a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b < 0 && d < 0) cout << a * c;
    else if (b < 0 && d >= 0) {
        if (c >= 0) cout << c * b;
        else cout << c * a;
    }
    else if (b >= 0 && d < 0) {
        if (a >= 0) cout << a * d;
        else cout << a * c;
    }
    else if (b >= 0 && d >= 0) {
        cout << max(b * d, a * c);
    }
}

#define task "test"
int main()
{
    if (fopen(task ".inp", "r")) {
        freopen(task ".inp", "r", stdin);
        freopen(task ".out", "w", stdout);
    }
    int testcase = 1;
    /// cin >> testcase;
    while (testcase--) {
        Input();
        Solve();
    }
}




Measured memory_bytes: 3636
m,d=map(int,input().split())
if d<22:
    print(0)
    exit()
if m<4:
    print(0)
    exit()

ans=0
for i in range(1,m+1):
    for j in range(1,d+1):
        a=j//10
        b=j%10
        if a<2 or b<2:
            continue
        if a*b==i:
            ans+=1
print(ans)


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

#define rep(x, y) for (int i = (x); i < (y); i++)

typedef long long ll;

using namespace std;

bool is_yymm(string s) {
    int yy = stoi(s.substr(0, 2));
    int mm = stoi(s.substr(2, 2));

    return (0 <= yy && (1 <= mm && mm <= 12));
}

bool is_mmyy(string s)  {
    int mm = stoi(s.substr(0, 2));
    int yy = stoi(s.substr(2, 2));

    return (0 <= yy && (1 <= mm && mm <= 12));
}

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

    if (is_yymm(s) && is_mmyy(s)) {
        cout << "AMBIGUOUS" << endl;
    } else if (is_yymm(s)) {
        cout << "YYMM" << endl;
    } else if (is_mmyy(s)) {
        cout << "MMYY" << endl;
    } else {
        cout << "NA" << endl;
    }
}

int main() {
    solve();

    return 0;
}

Measured memory_bytes: 256
N = int(input())
l = [list(map(int,input().split(" "))) for _ in range(N)]
ll = [tuple(i) for i in l]
same = 1
n = N**2 - N
ans_l = [()]*n
cnt = 0
for i in l:
    x = i[0]
    y = i[1]
    for j in l:
        if i==j:
            continue
        k = (j[0]-x,j[1]-y)
        ans_l[cnt] = k[:]
        cnt+=1
ans = 0
ans_l.sort()
for i in ans_l:
    k = i[0]
    same = 0
    for j in ans_l:
        if j[0] > k:
            break
        if i==j:
            same+=1
    ans = max(ans,same)
print(N-ans)

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


int main()
{
	string S,T;
	cin >> S >> T;

	int ans = T.size();
    for (int start = 0; start <= S.size() - T.size(); start++)
    {
        int diff = 0;
        for (int i = 0; i < T.size(); i++)
        {
            if (T[i] != S[start + i]) {
                diff++;
            }
        }
        ans = min(ans, diff);
    }

    cout << ans << endl;
}


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

long long int calc(long long int p)
{
    return p*(p-1)/2;
}

int main ()
{
  ll n,i,ans=0,a[30]={0};
  string s;
  cin>>s;
  n=s.size();
  for(i=0;i<n;i++)
  {
    a[s[i]-97]++;
  }
  ans=1+calc(n);
  for(i=0;i<27;i++)
  {
      ans-=calc(a[i]);
  }
  cout<<ans;
   return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<string>> A(h + 2, vector<string>(w + 2, "."));
    rrep(i, h) {
        string s;
        cin >> s;
        rrep(j, w) A[i][j] = s[j - 1];
    }
    bool ans = true, check;
    rrep(i, h) {
        rrep(j, w) {
            if(A[i][j] == "#") {
                check = true;
                if(A[i - 1][j] == "#" || A[i + 1][j] == "#" || A[i][j - 1] == "#" || A[i][j + 1] == "#") {
                    check = false;
                }
            }
            if(check) {
                ans = false;
                break;
            }
        }
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 384
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

    public class Program
    {
        public static void Main(string[] args)
        {
            new C().test();
        }
    }

	public class C
	{
		public void test()
		{
			// 整数の入力
			var input = CommonRead.ReadInt();
			var value = 0;

			for (var i = 1; i <= input; i++)
			{
				for (var j = 1; j <= input;j++)
				{
					var tmp = gcd(i, j);
					for (var k = 1; k <= input; k++)
					{
						value += gcd(tmp, k);
					}
				}
			}

			//出力
			Console.WriteLine(value);
		}

		public int gcd(int x, int y)
		{
			// 同じ値の場合はその数字が最大公約数
			if (x == y) return x;

			var value = 0;
			// 大きい数字を判定
			if (x > y)
			{
				value = x % y;
				// 割り切れる場合はそこで終了
				if (value == 0)
				{
					return y;
				} else
				{
					//割り切れない場合は繰り返す
					return gcd(value , y);
				}
			} else
			// 大きい数字を判定
			{
				value = y % x;
				// 割り切れる場合はそこで終了
				if (value == 0)
				{
					return x;
				}
				else
				{
					//割り切れない場合は繰り返す
					return gcd(value, x);
				}
			}

		}
	}

static class CommonRead
{
    public static string ReadStr()
    {
        return Console.ReadLine();
    }
    public static string[] ReadStrA()
    {
        return ReadStr().Split(' ');
    }
    public static List<string> ReadStrL()
    {
        return ReadStrA().ToList();
    }
    public static int ReadInt()
    {
        return Convert.ToInt32(ReadStr());
    }
    public static int[] ReadIntA()
    {
        return ReadStrA().Select(s => Convert.ToInt32(s)).ToArray();
    }
    public static List<int> ReadIntL()
    {
        return ReadStrA().Select(s => Convert.ToInt32(s)).ToList();
    }
    public static long ReadLong()
    {
        return Convert.ToInt64(ReadStr());
    }
    public static long[] ReadLongA()
    {
        return ReadStrA().Select(s => Convert.ToInt64(s)).ToArray();
    }
    public static List<long> ReadLongL()
    {
        return ReadStrA().Select(s => Convert.ToInt64(s)).ToList();
    }

    public static decimal ReadDecimal()
    {
        return Convert.ToDecimal(ReadStr());
    }
    public static decimal[] ReadDecimalA()
    {
        return ReadStrA().Select(s => Convert.ToDecimal(s)).ToArray();
    }
    public static List<decimal> ReadDecimalL()
    {
        return ReadStrA().Select(s => Convert.ToDecimal(s)).ToList();
    }

    public static double ReadDouble()
    {
        return Convert.ToDouble(ReadStr());
    }
    public static double[] ReadDoubleA()
    {
        return ReadStrA().Select(s => Convert.ToDouble(s)).ToArray();
    }
    public static List<double> ReadDoubleL()
    {
        return ReadStrA().Select(s => Convert.ToDouble(s)).ToList();
    }

}

Measured memory_bytes: 17744
#define __USE_MINGW_ANSI_STDIO 0
        #include <iostream>
        #include <stdio.h>
        #include <stdlib.h>
        #include <vector>
        #include <algorithm>
        #include <queue>
        #include <map>
        #include <set>
        #include <stack>
        #include <string.h>
        #include <math.h>
         
        using namespace std;
         
        #define PI 3.141592653589793
        #define epsilon 0.000000001
        #define INF 1000000000000
        #define MOD 1000000007
         
        int main(){
            //freopen("dec.in", "r", stdin); freopen("dec.out", "w", stdout);
        	int N, ret = 0; cin >> N;
          	for(int i = 0; i < N; i++){
              	int a, b; cin >> a >> b;
              	ret += b-a+1;
            }
          	cout << ret << '\n';
            return 0;
        }

Measured memory_bytes: 256
#include<stdio.h>
#define N 100

void dfs(void);
void visit(int);
void push(int);
void pop(void);
int next(int);

int n, color[N], d[N], f[N], time, temp[N], G[N][N];
int S[N*N], top=-1;

int main()
{
  int u, k, i, j, v;

  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      G[i][j] = 0;
    }
  }

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%d%d", &u, &k);
    for(j = 0; j < k; j++){
      scanf("%d", &v);
      G[u-1][v-1] = 1;
    }
  }
  
  dfs();

  for(i = 0; i < n; i++) if(color[i] == 1) visit(i);

  for(i = 0; i < n; i++) printf("%d %d %d\n", i+1, d[i], f[i]);

  return 0;
}

//????????????
void dfs(void)
{
  int i;

  for(i = 0; i < n; i++) color[i] = 1; //1 = white
  time = 0;
}

void visit(int r)
{
  int u, v;

  push(r); // Stack S
  color[r] = 2; //2 = GRAY
  d[r] = ++time;

  while(top != -1){
    u = S[top];
    v = next(u);

    if(v != -1){
      if(color[v] == 1){
        color[v] = 2;
	d[v] = ++time;
	push(v);
      }
    }
    else{
      pop();
      color[u] = 3; //3 = BLACK
      f[u] = ++time;
    }
  }
}

void push(int x)
{
    top++;
    S[top] = x;
}

void pop(void)
{
  top--;
}

int next(int u)
{
  int i;

  for(i = temp[u]; i < n; i++){
    temp[u] = i + 1;
    if(G[u][i]) return i;
  }
  return -1;
}

Measured memory_bytes: 644
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSharp_AtCoder
{


    class Program
    {

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();

            // 一番右からi番目までで何個あるのか
            int[] west = new int[N];
            int[] east = new int[N];

            for(int i = 0; i < N; i++)
            {
                if(i > 0)
                {
                    west[i] = west[i - 1];
                    east[i] = east[i - 1];
                }

                if (S[i] == 'W') west[i]++;
                else east[i]++;

            }

            int ans = 1000000000;
            for(int i = 0; i < N; i++)
            {
                int sum = west[i] + (east[N - 1] - east[i]);
                if (S[i] == 'W') sum--;
                ans = Math.Min(ans, sum);
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 16224
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repr(i, n) for(int i=n; i>=0; i--)
#define reps(i, s, e) for(int i=s; i<e; i++)
#define inf 1e18
#define vsort(v) sort(v.begin(), v.end())
#define vsortr(v) sort(v.begin(), v.end(), greater<lli>())
#define sz(x) x.size()
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
using namespace std;
using ll = long long;
template<typename T> T gcd(T a, T b){ if(b==0) return a; return gcd(b, a%b); }
template<typename T> T lcm(T a, T b){ return a*b/gcd(a, b); }
template<typename T> T vdebug(vector<T> v){ for(auto vv : v){ cout << vv << " "; } cout << endl; }
template<typename T> T adebug(T arr[], int n){ rep(i, n){ cout << arr[i] << " "; } cout << endl; }
void ans(bool b){ if(b) cout << "Yes" << endl; else cout << "No" << endl; }
void ans2(bool b){ if(b) cout << "YES" << endl; else cout << "NO" << endl; }
int keta(ll num){ int k=0; while(num>0){ num/=10; k++; } return k; }
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
    
    
bool comp(pair<int,int> p1, pair<int,int> p2){
    if(p1.second == p2.second){
        return p1.first < p2.first;
    }else{
        return p1.second > p2.second;
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
 
    int n, a, b, c, d;
    vector<pair<int, int>> red, blue;
    cin >> n;
    rep(i, n){
        cin >> a >> b;
        red.push_back(make_pair(a, b));
    }
    rep(i, n){
        cin >> c >> d;
        blue.push_back(make_pair(c, d));
    }
 
    sort(red.begin(), red.end(), comp);
    sort(blue.begin(), blue.end());

    // cout << endl;
    // for(auto r : red){
    //     cout << r.first << " " << r.second << endl;
    // }
 
    int res = 0;
    int used[1000];
    rep(i, n){
        used[i] = 0;
    }
    for(auto const& b : blue){
        rep(i, n){
            if(used[i]) continue;
            if(red[i].first >= b.first) continue;
            if(red[i].second < b.second){
                res++;
                used[i] = 1;
                break;
            }
        }
    }
 
    cout << res << endl;
 
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,e) for(int i=0;i<e;i++)
#define all(a) (a).begin(),(a).end()
using LL=long long;

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> x(m);
  rep(i,m) cin >> x[i];
  sort(all(x));
  vector<int> d(m-1);
  rep(i, m-1) d[i]=x[i+1]-x[i];
  sort(all(d));
  LL ans=0;
  rep(i,m-n) ans+=d[i];
  cout<<ans<<endl;
  
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <algorithm>
int main() {
	int a[4];
	scanf("%d%d%d%d", &a[0], &a[1], &a[2], &a[3]);
	std::sort(a, a + 4);
	if (a[0] == 1 && a[1] == 4 && a[2] == 7 && a[3] == 9)printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, s, n) for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...) \
    type __VA_ARGS__;  \
    read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U>
inline bool chmax(T &a, const U &b) {
    return b > a && (a = b, true);
}
template <class T, class U>
inline bool chmin(T &a, const U &b) {
    return b < a && (a = b, true);
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

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

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(
        sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream &operator>>(istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

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

inline void print() { cout << "\n"; }

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

template <class T>
inline ostream &operator<<(ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x) : x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

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

    var(i64, N, a, b);
    const auto d = b - a;

    if (d & 1) {
        i64 ans = LINF;
        {
            const i64 t = a - 1;
            chmin(ans, t + (b - t) / 2);
        }
        {
            const i64 t = N - b;
            chmin(ans, t + (N - (a + t) + 1) / 2);
        }
        print(ans);
    } else {
        print(d / 2);
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int num;
	int i = 1;
	
	while(1){
		scanf("%d", &num);
		if(num == 0){
			break;
		}
		printf("Case %d: %d\n", i, num);
		i++;
	}
	
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string parse(string str){
	string ret;
	int i=0,j,cnt,acc=0;
	for(;i<str.size();i++){
		if(str[i]=='['){
			cnt=1;
			for(j=i+1;cnt;j++){
				if(str[j]=='[')cnt++;
				if(str[j]==']')cnt--;
			}
			string x=parse(str.substr(i+1,(j-1)-(i+1)));
			reverse(x.begin(),x.end());
			ret+=x;
			i=j-1;
		}else if(str[i]=='+'){
			acc++;
		}else if(str[i]=='-'){
			acc--;
		}else{
			ret+=str[i]=='?'?'A':( ((str[i]-'A'+acc)%26+26)%26+'A' );
			acc=0;
		}
	}
	return ret;
}

int main(){
	string line;
	for(;getline(cin,line),line!=".";){
		line=parse(line);
		cout<<line<<endl;
	}
}

Measured memory_bytes: 1192
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<Integer>();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        long a1 = (long)a*c;
        long a2 = (long)a*d;
        long a3 = (long)b*c;
        long a4 = (long)b*d;
        //System.out.println(a1+" "+a2+" "+a3+" "+a4+" ");
        System.out.println(Math.max(a1,Math.max(a2,Math.max(a3,a4))));
    }
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)    FOR (i,0,n)
#define ALL(f,x,...) ([&](decltype((x)) ALL) {                          \
            return (f)(begin(ALL), end(ALL), ## __VA_ARGS__); })(x)

using namespace std;

vector<int> vi;
vector<int> vj;

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

    vi.resize(N);

    REP(i, N) cin >> vi[i];

    vj = vi;
    ALL(sort, vi);

    REP(i, N)
    {
        // 0-indexed
        if (vj[i] <= vi[N / 2 - 1]) cout << vi[N / 2] << endl;
        else cout << vi[N / 2 - 1] << endl;
    }

    return 0;
}


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

using namespace std;
#define ff(i, a, b) for(int i = (a), _b = (b); i <= _b; ++i)
#define rep(i, a, b) for(int i = (a), _b = (b); i < _b; ++i)
#define fd(i, a, b) for(int i = (a), _b = (b); i >= _b; --i)
#define SZ(x) ((int)(x).size())
#define db(x) cout << #x << " == " << x << endl
#define _ << ", " << 
#define X first
#define Y second
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define endl '\n'
#define pc putchar
#define gc getchar 
#define bit(i) (1<<(i))

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;

const int maxn=(int)2e5+5,INF=1e9;
int n;
string s;

void enter(){
	cin>>s;
	n=SZ(s);
	s=' '+s+' ';
}

map<int,int> lst;

int adj[maxn][28],d[maxn];

void process(){
	int sum=0;

	ff(i,0,n+1) d[i]=INF;

	lst[0]=n+1;

	fd(i,n,1){	
		sum^=bit(s[i]-'a');
		adj[i][0]=lst[sum];
		ff(j,1,26) {
			adj[i][j]=lst[sum^bit(j-1)]; 
		}
		// ff(j,0,26) if (adj[i][j]) db(i _ j _ adj[i][j]);
		lst[sum]=i;
	}
	
	d[1]=0;

	ff(i,1,n) if (d[i]!=INF){
		ff(j,0,26) if (adj[i][j]){
			d[adj[i][j]]=min(d[adj[i][j]],d[i]+((adj[i][j]-i)%2==1));
		}
	}
	// ff(i,1,n+1) cout<<d[i]<<' ';cout<<endl;
	if (d[n+1]==0) d[n+1]=1;
	cout<<d[n+1]<<endl;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	// freopen("test.inp","r",stdin);
	// freopen("test.out","w",stdout);

	enter();
	process();	

	return 0;
}

Measured memory_bytes: 226768
a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k==x:
                ans+=1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

int query(int x) {
	cout << x << endl;
	string s;
	cin >> s;
	if (s == "Vacant") {
		exit(0);
	}
	return s == "Male";
}

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

	int n;
	cin >> n;
	int t = query(0);
	int l = 0;
	int r = n - 1;
	while (r - l > 1) {
		int m = (r + l) >> 1;
		if (query(m) ^ (m & 1) ^ t) {
			r = m;
		} else {
			l = m;
		}
	}
	query(l);
	query(r);
	assert(false);
}


Measured memory_bytes: 3820
#include <bits/stdc++.h>
#define endl '\n'
#define uset unordered_set
#define umap unordered_map
#define all(var) var.begin(), var.end()
#define input freopen("input", "r", stdin)
#define output freopen("output", "w", stdout)
#define Fast ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL)
typedef long long ll;
using namespace std;

int dr[] = {0, 0, -1, +1, -1, -1, +1, +1};
int dc[] = {-1, +1, 0, 0, -1, +1, -1, +1};

int main(){
    string n; cin >> n;
    int sum = 0;
    for(char ch: n)
        sum += ch-'0';
    cout << (sum % 9 ? "No" : "Yes") << endl;
}



Measured memory_bytes: 3716
#include<iostream>
#include<algorithm>
using namespace std;
long long a[2];
long long b[2];
long long c[4];
int main(){
	int i,j,q=1;
	long long maxn;
	cin>>a[1]>>a[2]>>b[1]>>b[2];
	maxn=a[1]*b[1];
	for(i=1;i<=2;i++){
	for(j=1;j<=2;j++){
		if((a[i]*b[j])>maxn){
			maxn=a[i]*b[j];
		}
	c[q]=maxn;
	q++;	
	}
	}
	sort(c+1,c+4);
	cout<<c[4];
	return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll n;
  cin >> n;
  vec a(n);
  for(ll i=0;i<n;i++) cin >> a[i];
  ll cnt=0;
  for(ll i=1;i<n;i++) {
    if(a[i]==a[i-1]) {
      cnt++;
      i++;
    }
  }
  cout << cnt << endl;
}

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

int main (){
	int a [5];
	int n = 5;
	vector<int> next(n);

	for(int i =0; i<5;i++){
		cin >> a[i];
		if(a[i]%10 == 0){
			next[i] = a[i];
		}else {
			next[i] = a[i] + (10 - a[i] % 10);
		}
	}
	int best =2000;
	for(int i = 0; i < n; i++){
		int sum =0;
		for(int j = 0;j < n; j++){
			if(i == j){
				sum += a[j];
			}
			else {
				sum += next[j];
			}
		}
		if(best > sum){
			best = sum;
		}
	}

	cout << best << endl;
	return 0;
}


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

int main() {
  int a, b, x;
  cin >> a >> b;
  x = (a * b) % 2;
  
  if (x == 0){
    cout << "Even" << endl;
  }
  else {
    cout << "Odd" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
h,w=map(int,input().split())
a=[input() for _ in range(h)]

dp = [[0]*w for _ in range(h)]
dp[0][0]=1
for i in range(w):
    if a[0][i] == "#":
        break
    dp[0][i] = 1
for j in range(h):
    if a[j][0] == "#":
        break
    dp[j][0] = 1

for i in range(1,h):
    for j in range(1,w):
        if a[i][j] == "#":
            continue
        dp[i][j] = dp[i-1][j] + dp[i][j-1]
print(dp[h-1][w-1]%(10**9+7))

Measured memory_bytes: 157528
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;


public  class Main  {


	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		int max = A>B ? A:B;
		ArrayList <Integer>Ablock = new ArrayList();
		
			int i = 0;
			int e = 0;
			int counter=0;
			for(i =1; i<=A;i++ ) {
				if(A%i ==0) {
					if(B%i ==0) {
						Ablock.add(i);
						
						}
						
					}
					
				}
			
			Ablock.sort(Comparator.reverseOrder());
			e = Ablock.get(K-1);
			
			
			System.out.println(e);
		
		
		
	}}

Measured memory_bytes: 23124
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        final int N = sc.nextInt();
        out.println(N * 800 - N / 15 * 200);
        
        out.flush();
    }
}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

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

using namespace std;

using ll = long long;
constexpr int mo = 1e9+7;
constexpr int inf = 1<<30;
constexpr ll infl = 1ll<<60;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    map<ll,int> m;
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        int cur;cin>>cur;
        if(m.count(cur) == 0)m[cur]++;
        else {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 12800
#include <iostream>

using namespace std;

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

    int p = 1;
    for (int i = 0; i < m; i++) {
        p *= 2;
    }

    cout << 100 * (n - m) * p + 1900 * m * p << endl;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
constexpr double EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max()/2;
constexpr int MOD = 1e9+7;

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

    int a,b,c,d;cin>>a>>b>>c>>d;
    vector<int> cnt(200,0);
    for(int i=a;i<=b;i++) cnt[i]++;
    for(int i=c;i<=d;i++) cnt[i]++;
    int st=100,gt=0;
    for(int i=0;i<=100;i++){
        if(cnt[i]==2){
            st=min(st,i);
            gt=i;
        }
    }
    cout<<max(0,gt-st)<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n)repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
typedef pair<int,int> P;
typedef pair<int, P> PP;
#define all(v) v.begin(),v.end()
#define fi first
#define se second
const int inf = 1e9;
int mod = 1e9+7;

int dp[2000][2000], C[2000][2000];
void init(){
	C[0][0] = 1;
	rrep(i,1000)rrep(j,1000){
		C[i][0] = 1;
		C[i][j] = (C[i-1][j-1]+C[i-1][j])%mod;
	}
}

int fac[2000], inv[2000];
int Pow(int x, int k){
	int res = 1;
	while(k > 0){
		if(k&1)res = (x*res)%mod;
		x = (x*x)%mod;
		k >>= 1;
	}
	return res;
}
void Factrial(int n){
	fac[0] = inv[0] = 1;
	rrep(i,n){
		fac[i] = (fac[i-1]*i)%mod;
		inv[i] = Pow(fac[i], mod-2);
	}
}

signed main(){
	int n, a, b, c, d;
	scanf("%lld%lld%lld%lld%lld", &n, &a, &b, &c, &d);
	init();
	Factrial(1002);
	
	/*dp[a-1][0] = 1;
	repi(i,a,b+1)rep(j,n+1){
		dp[i][j] = dp[i-1][j];
		int s = 1;
		if(i*c > j)continue;
		repi(k,c,d+1){
			if(j-i*k < 0)break;
			s = (s*C[n-(j-i*k)][i])%mod;
			int tmp = (s*inv[k])%mod;
			dp[i][j] += (dp[i-1][j-i*k]*tmp)%mod;
			dp[i][j] %= mod;
		}
	}*/
	dp[a-1][0]=fac[n];
	repi(i,a,b+1){
		rep(j,n+1){
			dp[i][j]=dp[i-1][j];
			if(i*c<=j){
				int m=min(d-c+1,1+(j-i*c)/i);
				rep(k,m){
					int res=dp[i-1][j-i*(c+k)]*Pow(inv[i],c+k)%mod;
					dp[i][j]+=res*inv[c+k]%mod;
				}
				dp[i][j]%=mod;
			}
		}
	}
	printf("%lld\n",dp[b][n]);
	return 0;
}


Measured memory_bytes: 32512
<?php
  	$ans = "None";
    $s = fgets(STDIN);
    $alphabet = ["a",
                 "b",
                 "c",
                 "d",
                 "e",
                 "f",
                 "g",
                 "h",
                 "i",
                 "j",
                 "k",
                 "l",
                 "m",
                 "n",
                 "o",
                 "p",
                 "q",
                 "r",
                 "s",
                 "t",
                 "u",
                 "v",
                 "w",
                 "x",
                 "y",
                 "z"];
    foreach($alphabet as $char){
        if (!preg_match("/".$char."/", $s)) {
            $ans = $char;
            break;
        }
    }
 	echo $ans;
?>

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

int main() {
    int c11,c12,c13,c21,c22,c23,c31,c32,c33;
    cin >> c11 >> c12 >> c13 >> c21 >> c22 >> c23 >> c31 >> c32 >> c33;

    int a1,a2,a3,b1,b2,b3;
    for (a1 = 0; a1 <= 100; ++a1) {
        b1 = c11 - a1;
        b2 = c12 - a1;
        b3 = c13 - a1;
        a2 = c21 - b1;
        a3 = c31 - b1;
        if(a2 + b2 == c22 && a2 + b3 == c23 && a3 + b2 == c32 && a3 + b3 == c33) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 256
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  myout(lcm(one[0], one[1]));
}
function lcm(m, n) {return m * n / gcd(m, n);}
function gcd(m, n) {return n != 0 ? gcd(n, m % n) : m;}

Measured memory_bytes: 30100
#include <iostream>
#include <vector>
using namespace std;
#define REP(i, a, b) for (auto i = (a); i < (b); ++i)

vector<vector<int>> adj;
vector<long long> diff;
vector<int> invt, length;
int t = 0;

void dfs(int u, int p) {
	invt[u] = t++;
	for (int v : adj[u])
		if (v != p) {
			dfs(v, u);
			length[u] += length[v];
		}
}

signed main() {
	int n, q; cin >> n >> q;
	adj.resize(n);
	invt.resize(n);
	diff.resize(n + 1);
	length.resize(n, 1);
	REP(i, 1, n) {
		int a, b; cin >> a >> b; --a, --b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(0, -1);
	while(q--) {
		int p, x; cin >> p >> x; --p;
		diff[invt[p]] += x;
		diff[invt[p] + length[p]] -= x;
	}
	REP(i, 1, n) diff[i] += diff[i - 1];
	REP(i, 0, n) cout << diff[invt[i]] << ' ';
}

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

using namespace std;

int main()
{
  long long a, b, c, k;
  cin >> a >> b >> c >> k;
  if (k % 2 == 0)
    cout << a - b << endl;
  else
    cout << b - a << endl;

  return 0;
}


Measured memory_bytes: 256
import sys
NK = input().split()
N,K = int(NK[0]),int(NK[1])
H = list(map(int,input().split()))
if K != 0 and len(H) < K:
    print(0)
    exit()
H.sort()
for i in range(K):
    H.pop(-1)
print(sum(H))

def input():
    return sys.stdin.readline()[:-1]


Measured memory_bytes: 88404
function main(input) {
    const lineArray = input.split('\n');
    let index2 = 0;
    lineArray.forEach((one,index) => {
      if(index){
      	const numberArray = one.split(' ');
      	const x = numberArray[0];
      	const y = numberArray[1];
      	const dist = Math.sqrt(((0-x)**2) + ((0-y)**2));
        if(dist <= lineArray[0].split(' ')[1]){
          index2++
        }
      }
    })
  console.log(index2);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int n;
int _index[26];
int s[50][26];
string ss;

int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> ss;
        for(int j = 0; j < ss.length(); j++){
            s[i][(int)ss[j] - 97]++;
        }
    }
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 26; j++){
            if(i == 0){
               _index[j] = s[0][j];
            }else{
                if(_index[j] > s[i][j]){
                    _index[j] = s[i][j];
                }
            }
        }
    }
    for(int k = 0; k < 26; k++){
        for(int i = 0; i < _index[k]; i++){
            cout << (char)(k + 97);
        }
    }
    cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void debug() {cout<<endl;}
template<typename T,typename... Args>
void debug(T x,Args... args) {cout<<x<<" ";debug(args...);}
#define forn(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
#define F first
#define S second
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;

const int N = 3e3;
double prob[N];
double dp[N][N];
int n;

double f(int i, int j) {
    if (i == n) return j > n/2;
    double &r = dp[i][j];
    if (r != -1.0) return r;
    double a = prob[i] * f(i+1, j+1);
    double b = (1.0-prob[i]) * f(i+1, j);
    return r = a+b;
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cout << fixed << setprecision(10);
    
    cin >> n;
    forn(i, 0, n) {
        cin >> prob[i];
        
        forn(j, 0, n) dp[i][j] = -1.0;
    }
    
    double ans = f(0, 0);
    cout << ans << endl;
}


Measured memory_bytes: 74364
S = int(input())
from math import sqrt,ceil

sq = ceil(sqrt(S))

left = S%sq
height = int(S // sq)

Ans = [left,0,0,height,sq,height+1]
if S == 10**18:
    Ans = [0 ,0, 0,1000000000,1000000000,1000000000]
print(*Ans,sep = " ")


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    ll n, m;
    cin>>n>>m;
    vvl as(n, vl(m));
    cin>>as;
    rep(i, n) rep(j, m) as[i][j]--;

    ll ans = n;
    vector<bool> selected(m);
    rep(i, m - 1) {
        vl cnt(m);
        rep(j, n) {
            rep(k, m) {
                if (!selected[as[j][k]]) {
                    cnt[as[j][k]]++;
                    break;
                }
            }
        }
        ll mc = 0;
        ll mi = 0;
        rep(j, m) {
            if (chmax(mc, cnt[j])) mi = j;
        }
        chmin(ans, mc);
        selected[mi] = true;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024