akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		System.out.println((((long) n - m) * 100L + m * 1900L) << m);
	}
}


Measured memory_bytes: 23124
#include<stdio.h>

int main()
{
	int N;
	for(;scanf("%d",&N),N;)
	{
		int m=500000,M=-1,i,t,j,S;
		for(i=0;i<N;i++)
		{
			for(j=t=0;j<5;j++,t+=S)scanf("%d",&S);
			m=m>t?t:m;
			M=M<t?t:M;
		}
		printf("%d %d\n",M,m);
	}
	return 0;
}

Measured memory_bytes: 596
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main{
	Scanner s=new Scanner(System.in);

	void solve(){
		String t=s.next();
		System.out.println(t.indexOf('A')>=0&&t.indexOf('B')>=0?"Yes":"No");
	}

	public static void main(String[] A){
		new Main().solve();
	}

	int gInt(){
		return Integer.parseInt(s.next());
	}
	long gLong(){
		return Long.parseLong(s.next());
	}
	double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,this::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,this::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,this::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(this::gInt).limit(n);
	}
	LongStream LONGS(int n){
		return LongStream.generate(this::gLong).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}

class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}

class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}
	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}
}


Measured memory_bytes: 23636
import sys
from collections import deque

read = sys.stdin.buffer.read


def main():
    MOD = 1000000007
    N, *AB = map(int, read().split())
    G = [[] for _ in range(N)]
    for a, b in zip(AB[::2], AB[1::2]):
        G[a - 1].append(b - 1)
        G[b - 1].append(a - 1)

    stack = deque([0])
    order = []
    prev = [0] * N
    prev[0] = -1
    while stack:
        v = stack.pop()
        order.append(v)
        for nv in G[v]:
            if nv != prev[v]:
                stack.append(nv)
                prev[nv] = v

    pow2 = [0] * (N + 1)
    pow2[0] = 1
    for i in range(N):
        pow2[i + 1] = pow2[i] * 2 % MOD

    nodes = [1] * N
    numer = 0

    for v in reversed(order):
        if prev[v] != -1:
            nodes[prev[v]] += nodes[v]
        numer = (numer + pow2[N - 1] - 1 - (pow2[N - nodes[v]] - 1)) % MOD
        for nv in G[v]:
            if nv != prev[v]:
                numer = (numer - (pow2[nodes[nv]] - 1)) % MOD

    denom = pow2[N]
    ans = (numer * pow(denom, MOD - 2, MOD)) % MOD
    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 120724
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll ;
typedef double db;
const double pi = 3.141592654;
#define pb         push_back
#define forab(i,a,b)       for(int i=(a);i<=(b);i++)
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)
#define pcase(z,x)     printf("Case %ld: %lld\n",z,x)
#define nw	 "\n"
#define mod 1000000007


int main(void)
{
	CIN;
	ll tc,l,k=0,sum=0,x=0,y,z=0,m=1,n=0,ans=0,cnt=0;
	string s;
	cin>>s;
	l=s.size();
	for(ll i=0;i<l;i++){
		if(s[i]!='1')break;
		cnt++;
	}
	cin>>k;
	if(cnt>=k) return cout<<1,0;
	cout<<s[cnt];
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rep2(r, aa, bb) for (ll r = (aa)-1; r >= (bb); r--)
#define be(x) (x.begin(), x.end())
#define pb(t) push_back(t)
#define ll long long
#define mp(a, b) make_pair(a, b)
ll MOD=1000*1000*1000+7, n, m;
vector<ll>fib(100005, 1);
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	char a, b;
	cin>>a>>b;
	string A="", B="";
	rep(i,0,(int)(a-'0'))B+=b;
	rep(i,0,(int)(b-'0'))A+=a;
	cout<<min(A, B);
}



Measured memory_bytes: 1024
class UnionFind
    def initialize(size)
        @parent = Array.new(size, -1)
    end

    def root(x)
        if @parent[x] < 0
            x
        else
            @parent[x] = root(@parent[x])
            @parent[x]
        end
    end

    def same_parent?(x, y)
        root(x) == root(y)
    end

    def merge(x, y)
        x_root = root(x)
        y_root = root(y)

        return false if x_root == y_root

        # merge technique
        if @parent[x_root] > @parent[y_root]
            x_root, y_root = y_root, x_root
        end

        @parent[x_root] += @parent[y_root]
        @parent[y_root] = x_root

        return true
    end

    def size(x)
        return -@parent[root(x)]
    end
end


def solve()
    n, m = gets.strip.split.map(&:to_i)
    abs = m.times.map { gets.strip.split.map(&:to_i) }.reverse

    ans = []
    uf = UnionFind.new(n)

    # 不便さ
    cur = (n * (n - 1)) / 2

    # 逆順にみていく(辺がない状態から辺を足していく)
    abs.each do |ab|
        ans.push(cur)

        a = ab.first - 1
        b = ab.last - 1

        # 同じ連結成分なら不便さは変わらない
        next if uf.same_parent?(a, b)

        # aとbをつなげると、
        # それぞれが属する連結成分の大きさをかけた数だけ行き来できるルートが増えるので
        # そのぶん不便さが減る
        size_a = uf.size(a)
        size_b = uf.size(b)
        cur -= size_a * size_b

        uf.merge(a, b)  # aとbをつなげる
    end

    ans.reverse.each { |a| puts a }
end


solve()


Measured memory_bytes: 13944
#include<atcoder/all>
using namespace atcoder;

#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

using MLL = modint998244353;
struct RQV { LL c0, c1, x; };
RQV RQ_e() { return { 0,0,0 }; }
RQV RQ_op(RQV a, RQV b) { return { a.c0 + b.c0, a.c1 + b.c1, a.x + b.x + a.c1 * b.c0 }; }
struct RQRV { bool r; };
RQV RQ_map(RQRV f, RQV a) {
    if (!f.r) return a;
    return { a.c1, a.c0, a.c0 * a.c1 - a.x };
}
RQRV RQ_con(RQRV a, RQRV b) { return { a.r != b.r }; }
RQRV RQ_id() { return { false }; }

int main() {
    int N, Q; scanf("%d%d", &N, &Q);
    vector<RQV> A(N);
    rep(i, N) {
        char c; scanf(" %c", &c);
        if (c == '0') A[i] = { 1,0,0 }; else A[i] = { 0,1,0 };
    }
    lazy_segtree<RQV, RQ_op, RQ_e, RQRV, RQ_map, RQ_con, RQ_id> G(A);

    rep(q, Q) {
        int c; scanf("%d", &c);
        if (c == 1) {
            int l, r; scanf("%d%d", &l, &r); l--;
            G.apply(l, r, { true });
        }
        if (c == 2) {
            int l, r; scanf("%d%d", &l, &r); l--;
            printf("%lld\n", G.prod(l, r).x);
        }
    }

    return 0;
}

Measured memory_bytes: 20488
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}

int d[10][10];

void warshall_floyd(int n) {
  for (int k = 0; k < n; k++){       // 経由する頂点
    for (int i = 0; i < n; i++) {    // 始点
      for (int j = 0; j < n; j++) {  // 終点
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }
}

int main(){
  int h,w;
  cin >> h >> w;
  rep(i,10)rep(j,10){
    int c; cin >> c;
    d[i][j] = c;
  }
  
  warshall_floyd(10);
  
  int ans = 0;
  rep(i,h)rep(j,w){
    int a; cin >> a;
    if(a != -1) ans += d[a][1];
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		boolean bool = false;
		for(int i=1;i<=b;i++){
			if(a*i%b==c){
				bool = true;
				break;
			}
		}
		if(bool){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

}

Measured memory_bytes: 21844
#include<iostream>
#include<vector>
using namespace std;
int main(void){
	int n;
	cin>>n;
	int ans=1;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int t=0;
	bool f=false;
	while(1){
		for(int i=0;i<n;i++){
			if(a[i]%2==1){
				f=true;
				break;
			}
			a[i]/=2;
		}
		if(f)break;
		t++;
	}
	cout<<t<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1e9+7;

#define vec     vector<int>
#define vecll   vector<ll>
#define vec2    vector<vector<int>>
#define vec2ll  vector<vector<ll>>
#define vpair   vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define vecst   vector<string>
#define vecb    vector<bool>

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define mpair(v1, v2)    make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << var << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << var;
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt((ok ? "Yes" : "No"));}
//----------------------------------------------------------------

int main(void) {
  int n;
  cin >> n;
  arrst(s,n);
  sortall(s);
  uniqueall(s);
  prt(s.size());
}


Measured memory_bytes: 9600
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};
int main() {
  ll A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  X *= 2, Y *= 2;
  ll ans = 1LL << 60;
  for(int c = 0; c <= max(X, Y); c+=2) {
    ll need = c * C + A * (max(0LL, X - c + 1) / 2) + B * (max(0LL, Y - c + 1) / 2);
    ans = min(ans, need);
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  string A, B;
  cin >> A >> B;

  if (A.size() > B.size()) {
    cout << "GREATER" << endl;
    return 0;
  }
  else if (A.size() < B.size()) {
    cout << "LESS" << endl;
    return 0;
  }

  cout << ((A > B) ? "GREATER" : (A < B) ? "LESS" : "EQUAL") << endl;
}

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

int main(void) {
	int N;
	string S;
	cin >> N >> S;
	int ans = 0;
	for (int i = 0; i < N-2; i++) {
		if ((S[i]=='A') && (S[i+1]=='B') && (S[i+2]=='C')) {
			ans++;
		}
	}
	cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define mod 1000000007

int main(){
	int n,m,i;
	int a[100000];
	long long dp[100101]={1};
	int ss[1000101]={0};
	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d",&a[i]);
		ss[a[i]]=1;
	}
	for(i=0;i<=n;i++){
		if(ss[i]!=1){
			dp[i+1]+=dp[i];
			dp[i+1]%=mod;
			dp[i+2]+=dp[i];
			dp[i+2]%=mod;
		}
	}
	printf("%lld\n",dp[n]);
	return 0;
}

Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
	
	#define 	ll 						long long int
	#define 	REP(i,a,b)				for(i=a;i<=b;i++)
	#define 	REPr(i,b,a)				for(i=b;i>=a;i--)
	#define 	pb 						push_back
    #define 	mp 						make_pair
    #define 	f  						first
   	#define 	s  						second
   	#define 	umap(type1,type2)		unordered_map<type1,type2>

int mod = pow(10,9)+7;

void solve(){
	ll d,t,s;	cin>>d>>t>>s;
	if(t*s>=d){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}

void pb_18(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif

	/***************************

		FuCk RATINGS I am in love with EXPERIENCE.

	***************************/

	int t;	t=1;
	while(t--)	solve();
}

int main(){
	pb_18();
}

Measured memory_bytes: 3624
n = int(input())
a = []
for i in range(2):
    a.append([int(x) for x in input().split()])
mx = -1

for i in range(n):
    buf = sum(a[0][0:i+1]) + sum(a[1][i:n])
    if buf > mx:
        mx = buf

print(mx)


Measured memory_bytes: 3060
#include<stdio.h>

void di2bi(unsigned long x, int* b){
	int i;
	
	for(i=32-1; i>=0; i--){
		b[i] = (x>>i)&1;
	}
}



int main(){
	int i;
	unsigned long a, b;
	int bi_a[32], bi_b[32];
	int calc[32];
	
	scanf("%ld %ld", &a, &b);
	
	di2bi(a, bi_a);
	di2bi(b, bi_b);
	
	/*AND*/
	for(i=32-1; i>=0; i--)	calc[i] = bi_a[i]&bi_b[i];
	
	for(i=32-1; i>=0; i--)	printf("%d", calc[i]);
	printf("\n");
	
	/*OR*/
	for(i=32-1; i>=0; i--)	calc[i] = bi_a[i]|bi_b[i];
	
	for(i=32-1; i>=0; i--)	printf("%d", calc[i]);
	printf("\n");
	
	/*XOR*/
	for(i=32-1; i>=0; i--)	calc[i] = bi_a[i]^bi_b[i];
	
	for(i=32-1; i>=0; i--)	printf("%d", calc[i]);
	printf("\n");
	
	return 0;
}


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

long long int lucasArray[87];
long long int lucas(int n);
int main(){
  for(int i=0; i<87; i++) lucasArray[i]=-1;
  int n; cin >> n;
  cout << lucas(n) << endl;
  return 0;
}

long long int lucas(int n){
  if(n==0) return 2;
  else if(n==1) return 1;
  else if(lucasArray[n]>=0) return lucasArray[n];
  else return lucasArray[n]=lucas(n-1)+lucas(n-2);
}


Measured memory_bytes: 256
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define i_inf int(1e9)
#define i_half_inf int(1e5)
#define ll_inf ll(1e9)*ll(1e9)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main() {
    int d;
    cin >> d;
    if (d == 25) {
        cout << "Christmas" << endl;
    } else if (d == 24) {
        cout << "Christmas Eve" << endl;

    } else if (d == 23) {
        cout << "Christmas Eve Eve" << endl;

    } else if (d == 22) {
        cout << "Christmas Eve Eve Eve" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for (int i=a; i<b; ++i)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s,t;
    cin >> s >> t;
    int ans=0;
    for (int i=0;i<s.length();++i)
    {
        if (s[i]==t[i]) ans++;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

a,b,x = inpl()

if a*a*b//2 > x:
    y = 2*x/(a*b)
    print(math.degrees(math.atan2(b,y)))
else:
    dx = a*a*b - x
    y = 2*dx/(a*a)
    print(math.degrees(math.atan2(y,a)))


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

const int N = (int) 2e6 + 5 ;
const int inf = (int) 2e9 ;

set< string > st ;
string str ;

int main(){
//    freopen("in.txt" , "r" , stdin ) ;
    cin >> str ;
    int k ; scanf("%d" , &k ) ;
    int len = (int) str.size() ;
    for( int i = 0 ; i < len ; i++ ) {
        string tmp = "" ;
        int cnt = 0 ;
        for( int j = i ; j < len ; j++ ) {
            tmp += str[j] ;
            st.insert(tmp) ;
//            cout << tmp << endl ;
            if( st.size() > k ) {
                set< string > ::iterator it = prev(st.end()) ;
                st.erase(it) ;
            }
            cnt += 1 ;
            if( cnt > 5 ) break ;
        }
    }
    string ans = "" ;
    for( auto x : st ) ans = x ;
    cout << ans << endl ;
    return 0 ;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
   // static int[] GcdAns = new int[10000000001];
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        int[] A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int[] LowerGcd = new int[N + 1];
        LowerGcd[0] = 0;
        int[] UpperGcd = new int[N + 1];
        UpperGcd[N] = 0;
        for(int i = 0; i < N; i++)
        {
            LowerGcd[i + 1] = Gcd(LowerGcd[i], A[i]);
        }
        for(int i = N - 1; i >= 0; i--)
        {
            UpperGcd[i] = Gcd(UpperGcd[i + 1], A[i]);
        }
        int max = 1;
        for(int i = 0; i < N; i++)
        {
            int value = Gcd(LowerGcd[i], UpperGcd[i + 1]);
            if (value > max) max = value;
        }
        Console.WriteLine(max);
    }
    static int Gcd(int n, int m)
    {
        Func<int, int, int> gcd = null;
        gcd = (x, y) => y == 0 ? x : gcd(y, x % y);
        return n > m ? gcd(n, m) : gcd(m, n);
    }
}


Measured memory_bytes: 31708
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func init() {
	const maxWord = (1 << 30)
	buf := []byte{}
	sc.Buffer(buf, maxWord)
	sc.Split(bufio.ScanWords)
}

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

func solve(a, b, c int) int {
	if a%2 == 0 || b%2 == 0 || c%2 == 0 {
		return 0
	}
	nums := []int{a, b, c}
	sort.Ints(nums)
	return nums[0] * nums[1]
}

func main() {
	a, _ := strconv.Atoi(input())
	b, _ := strconv.Atoi(input())
	c, _ := strconv.Atoi(input())
	fmt.Println(solve(a, b, c))
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,q;
  cin>>n>>q;
  vvll ta(n+1,vll(0));
  rep(i,n-1){
    ll a,c;
  cin>>a>>c;
  ta[a].pb(c);
  ta[c].pb(a);
  }
  vll cu(n+1);
  rep(i,q){
    ll a,b;
    cin>>a>>b;
    cu[a]+=b;
  }
  queue<ll> p;
  p.pu(1);
  vb ch(n+1,false);
  while(p.size()){
    ll o=p.front();
    p.pop();
    ch[o]=true;
    for(ll a:ta[o]){
      if(ch[a]) continue;
      cu[a]+=cu[o];
      p.pu(a);
    }
  }
  rep(i,n){
    COUT(cu[i+1]);
  }
}

Measured memory_bytes: 17904
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;


main(){
    int n;cin>>n;
    int a[n];
    map<ll,int> ht;
    for(int i=0;i<n;i++){
        cin>>a[i];
        ht[i+a[i]]++;
    }
    ll count=0;
    for(int i=0;i<n;i++){
        if(ht.find(i-a[i])!= ht.end()){
            count+= ht[i-a[i]];
        } 
    }
    cout<<count;
}

Measured memory_bytes: 16696
a, b = map(int, input().split())
s = input()

f = True
if s[a]!='-':
    f = False
if not s[:a].isnumeric() and s[a+1:].isnumeric():
    f = False
if '-' in s[:a]+s[a+1:]:
    f = False
if f:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9080
#include <bits/stdc++.h>
using namespace std;
int ans=0;
int n;
vector <vector<int>> x;
vector <vector<int>> y;
vector <bool> isHornestV;
bool isConflict(int x1, int x2){
    int x1SaidToX2 = -1;
    int x2SaidToX1 = -1;
    int x1SaidHimself = -1;
    int x2SaidHimself = -1;
    vector <int> x1Claim(n,-1);
    vector <int> x2Claim(n,-1);
    for(int i = 0; i < x[x1].size(); i++){
        if(x[x1][i]==x1){
            x1SaidHimself=y[x1][i];
        }
        if(x[x1][i]==x2){
            x1SaidToX2 = y[x1][i];
        }
        x1Claim[x[x1][i]]=y[x1][i];
    }
    //x2 claim  
    for(int i = 0; i < x[x2].size(); i++){
        if(x[x2][i]==x2){
            x2SaidHimself=y[x2][i];
        }
        if(x[x2][i]==x1){
            x2SaidToX1 = y[x2][i];
        }
        x2Claim[x[x2][i]]=y[x2][i];
    }
    if(isHornestV[x1]&&isHornestV[x2]){
        if(x1SaidHimself==0){
            return true;
        }
        if(x1SaidHimself==0){
            return true;
        }
        if(x1SaidToX2==0)return true;
        if(x2SaidToX1==0)return true;
        for(int i = 0; i < n; i++){
            if(x1Claim[i]==-1)continue;
            if(x2Claim[i]==-1)continue;
            if(x1Claim[i]!=x2Claim[i])return true;
        }
    }else if(isHornestV[x1]){
        if(x1SaidHimself==0){
            return true;
        }
        if(x1SaidToX2==1){
            return true;
        }
    }else if(isHornestV[x2]){
        if(x1SaidHimself==0){
            return true;
        }
        if(x2SaidToX1==1){
            return true;
        }
    }else{
        return false;
    }
    return false;
}
int checkHornestNum(){
    #if 0
    for(int i = 0; i < n; i++){
        if(isHornestV[i]){
            cout<<"h";
        }else{
            cout <<"-";
        }
    }
    cout << endl;
    #endif
    for(int i = 0; i < n; i++){
        for(int j = (i+1); j < n; j++){
            if(isConflict(i,j)){
                //cout << "conflict" << endl;
                return 0;
            }
        }
    }
    int ret = 0;
    for(int i = 0; i < n; i++){
        if(isHornestV[i]){
            ret++;
        }
    }
    return ret;
}
void dfs(bool isHornest){
    isHornestV.push_back(isHornest);
    if(isHornestV.size()==n){
        ans = max(ans,checkHornestNum());
        return;
    }
    dfs(true);
    isHornestV.pop_back();
    dfs(false);
    isHornestV.pop_back();
}
int main(){
    cin >> n;
    vector <int> a(n);
    x =vector <vector<int>> (n);
    y =vector <vector<int>> (n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        x[i]=vector<int>(a[i]);
        y[i]=vector<int>(a[i]);
        for(int j = 0; j < a[i]; j++){
            cin >> x[i][j] >>  y[i][j];
            x[i][j]--;
        }

    }
    dfs(true);
    isHornestV.pop_back();
    dfs(false);
    isHornestV.pop_back();
    cout << ans << endl;
    #if 0
    cout << endl;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < a[i]; j++){
            cout << x[i][j] << " " << y[i][j] << endl;
        }
    }

    #endif
    return 0;
}

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

/* typedef */
/* long系 */
typedef long long ll;   // long long
typedef long double ld; // long double
/* vector系 */
typedef vector<int> vi;                    // intのvector
typedef vector<double> vd;                 // doubleのvector
typedef vector<ll> vll;                    // llのvector
typedef vector<ld> vld;                    // ldのvector
typedef vector<vector<int>> vvi;           // intの2次元vector
typedef vector<vector<double>> vvd;        // doubleの2次元vector
typedef vector<vector<ll>> vvll;           // llの2次元vector
typedef vector<vector<ld>> vvld;           // ldの2次元vector
typedef vector<pair<int, int>> vi_i;       // i_iのvector
typedef vector<pair<double, double>> vd_d; // d_dのvector
typedef vector<pair<ll, ll>> vl_l;         // l_lのvector
typedef vector<pair<ld, ld>> vld_ld;       // ld_ldのvector
typedef vector<string> vs;                 // stringのvector
/* pair系 */
typedef pair<int, int> i_i;       // int同士のpair
typedef pair<double, double> d_d; // double同士のpair
typedef pair<ll, ll> l_l;         // ll同士のpair
typedef pair<ld, ld> ld_ld;       // ld同士のpair

/* define */
#define all(v) v.begin(), v.end() // コンテナ全体
#define PI (acos(-1))             // 円周率pi

/* stringstream */
stringstream ss;
stringstream init_ss; // save default formatting

/* main */
void Main(void)
{
    int n, m, l;
    cin >> n >> m >> l;
    ll a[100][100], b[100][100], c[100][100];
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            cin >> a[i][j];
        }
    }
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < l; j++)
        {
            cin >> b[i][j];
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < l; j++)
        {
            ll sum = 0;
            for (int k = 0; k < m; k++)
            {
                sum += a[i][k] * b[k][j];
            }
            c[i][j] = sum;
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < l; j++)
        {
            cout << c[i][j];
            if (j != l - 1)
            {
                cout << " ";
            }
        }
        cout << endl;
    }
}

int main(int argc, char const *argv[])
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();

    return 0;
}



Measured memory_bytes: 3460
from sys import stdin, setrecursionlimit
#input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

N = int(input())
S = [input() for _ in range(N)]
#N, M = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]
#ABC = [list(map(int, input().split())) for _ in range(N)]

cnt = [0] * 4
for s in S:
    if s == "AC":
        cnt[0] += 1
    elif s == "WA":
        cnt[1] += 1
    elif s == "TLE":
        cnt[2] += 1
    elif s == "RE":
        cnt[3] += 1

print("AC x", cnt[0])
print("WA x", cnt[1])
print("TLE x", cnt[2])
print("RE x", cnt[3])

Measured memory_bytes: 78700
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod  = 1e9 + 7;
const ll N = 1e6 + 5;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int x;
    cin>>x;
    cout<<1-x<<'\n';
    return 0;
}

Measured memory_bytes: 3648
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


# globals
H, W = 0, 0
S = []


def set_inputs():
    global H, W, S
    H, W = get_li()
    for _ in range(H):
        row = get_lc()
        S.append(row)
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    for i in range(H):
        for j in range(W):
            if S[i][j] == ".":
                continue
            if i > 0 and S[i-1][j] == "#":
                continue
            if i < W - 1 and S[i+1][j] == "#":
                continue
            if j > 0 and S[i][j-1] == "#":
                continue
            if j < H - 1 and S[i][j+1] == "#":
                continue
            print("No")
            return
    print("Yes")
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return zip(*(
        [t(x) for t, x in zip(types, input().split())]
        for _ in range(n)
    ))


if __name__ == '__main__':
    main()


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

using namespace std;
using ull = unsigned long long;
using ll = long long;

int main()
{
	constexpr int in_a_row = 3;
	int current_row = 0;
	{
		bool exists = false;
		int n;
		cin >> n;

		for (int i = 0; i < n; i++)
		{
			int d1, d2;
			cin >> d1 >> d2;
			if (d1 == d2)
			{
				current_row++;
				if (current_row == in_a_row)
				{
					exists = true;
					break;
				}
			}
			else
			{
				current_row = 0;
			}
		}
		cout << (exists ? "Yes" : "No") << endl;
	}
}

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = 0;
  for (int i = 0; i < n/2; ++i){
    if(s[i]!=s[n-1-i]) ans++;
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;

void solve();

int main() {

    solve();

    return 0;
}

void solve() {

    int s[13], h[13], c[13], d[13];
    int n;
    cin >> n;

    for (int i = 0; i < 13; i++) {
        s[i] = -1;
        h[i] = -1;
        c[i] = -1;
        d[i] = -1;
    }


    while(n-- > 0) {
        int number;
        char letter;

        cin >> letter >> number;

        /*
        switch (letter) {
            case 'S':
                s[number - 1] = number;
            case 'H':
                cout << "This is: " << number;
                h[number - 1] = number;
            case 'C':
                c[number - 1] = number;
            case 'D':
                d[number - 1] = number;          
        }
        */

        if (letter == 'S')
            s[number - 1] = number;
        else if (letter == 'H')
            h[number - 1] = number;
        else if (letter == 'C')
            c[number - 1] = number;
        else
            d[number - 1] = number;
    }

    for (int i = 0; i < 13; i++) {
        if (s[i] == -1)
            cout << "S " << i+1 << endl; 
    }

    for (int i = 0; i < 13; i++) {
        if (h[i] == -1)
            cout << "H " << i+1 << endl; 
    }

    for (int i = 0; i < 13; i++) {
        if (c[i] == -1)
            cout << "C " << i+1 << endl; 
    }

    for (int i = 0; i < 13; i++) {
        if (d[i] == -1)
            cout << "D " << i+1 << endl; 
    }
}


Measured memory_bytes: 3084
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    
    int[] p = new int[a];
    int[] q = new int[b];
    int[] r = new int[c];
    
    for(int i=0;i<a;i++){
      p[i] = sc.nextInt();
    }    
    for(int i=0;i<b;i++){
      q[i] = sc.nextInt();
    }
    for(int i=0;i<c;i++){
      r[i] = sc.nextInt();
    }
    
    Arrays.sort(p);
    Arrays.sort(q);
    Arrays.sort(r);
   
    int[] z = new int[x+y+c];
    for(int i=0;i<x;i++){
      z[i] = p[a-x+i];
    }   
    for(int i=0;i<y;i++){
      z[i+x] = q[b-y+i];
    }
    for(int i=0;i<c;i++){
      z[x+y+i] = r[i];
    }  
    Arrays.sort(z);

    long ans = 0;
    for(int i=c;i<x+y+c;i++){
      ans += z[i];
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 94572
<?php
  fscanf(STDIN, "%d", $a);

  $num = range(1, $a);
  $cnt = 0;
  for($i=0;$i<$a;$i++) {
    if ($num[$i] % 2 !== 0) {
      $cnt++;
    }
  }

 echo $cnt / $a;
?>

Measured memory_bytes: 4604
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <cstdlib>

using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pi;

const ll MOD = 1e9+7;

static long gcd(long a, long b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}
/*
long long int facctorialMethod(int k){//階乗
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}*/

long long int tousasum(long long int n){//等差数列
    return n*(n+1)/2;
}

unsigned GetDigit(unsigned num){//桁数
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

bool IsPrime(int num)//素数判定
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

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

ll calcNumOfCombination(ll n, ll r){
    ll num = 1;
    for(ll i = 1; i <= r; i++){
        num = num * (n - i + 1) / i;
    }
    return num;
}

int bubblesort(vector<int> array,int size){//バブルソート　転倒数
    int kaisu = 0;
    for(int i = 0; i < size; i++){
        for(int j = i + 1; j < size; j++){
            if(array[i] > array[j]){
                int number = array[i];
                array[i] = array[j];
                array[j] = number;
                kaisu++;
            }
        }
    }
    return kaisu;
}

ll facctorialMethod(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum = (sum * i)%MOD;
    }
    return sum;
}

int main() {
   int N;
   cin >> N;
   cout << (N-1)-(N/2) << endl;



}






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

int main()
{
    int s;
    cin  >> s;
    int a= s%10;
    int b=s%100;
    int c =(b-a)/10;
    int d =s%1000;
    int e=(d-b)/100;
    int f= (s-d)/1000;
  if ( a!=c && c!=e && e!=f){
    cout << "Good";
  }
  else{
    cout << "Bad";
  }
    return 0;
}



Measured memory_bytes: 256
from sys import exit


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    n = ii()
    if n<13:
        print(n)
        exit()


    for i in range(1,50000):
        if (i*108)//100 == n:
            print(i)
            exit()
    print(":(")


        


main()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
void input()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
}
using namespace std;
typedef long long ll ;
const long long N = 1e5,OO=0x3f3f3f3f;
ll n,weight,w[105],v[105];
ll dp[105][1000000];
ll solve(int i,int val)
{
    if(i==n){
        if(val==0)
        return 0;
        return 1e18;
    }
    ll &ret=dp[i][val];
    if(~ret)
        return ret;

    ret=solve(i+1,val);
    ret=min(ret,w[i]+solve(i+1,val-v[i]));
    return ret;

}
int main()
{
    cin>>n>>weight;
    for(int i=0; i<n; i++)
        cin>>w[i]>>v[i];
    memset(dp,-1,sizeof dp);
    for(int i=1e5;i>=0; i--)
    {
        ll ans=solve(0,i);

        if(ans<=weight)
        {
            cout<<i<<"\n";break;

        }
    }

}


Measured memory_bytes: 823836
#include <bits/stdc++.h>
//#pragma GCC optimize(2)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define rep(i,a,b) for(int i = (a);i <= (b);i++)
#define per(i,a,b) for(int i = (a);i >= (b);i--)
#define pii pair<int,int>
#define pll pair<long long, long long>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
const double eps = 1e-8;
const double pi = acos(-1.0);	
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a * b / gcd(a,b);}
ll qw(ll x,ll y){ll res = 1;while(y){if(y & 1) res *= x;x = x * x;y >>= 1;}return res;}
ll poww(ll x,ll y,ll p){ll ans = 1;while(y){if(y & 1) ans = ans * x % p;x = x * x % p;y >>= 1;}return ans % p;}
bool isp(ll x){if(x < 2) return 0; for(ll i = 2;i * i <= x;i++){if(x % i == 0) return 0;}return 1;}
int x,n,k;
set<int> s;
void solve(){
	for(int i = 0;i <= 100;i++){
		int l = x - i,r = x + i;
		if(!s.count(l)){
			cout << l << endl;
			return;
		}
		if(!s.count(r)){
			cout << r << endl;
			return;
		}
	}
	return;
} 
int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> x >> n;
	rep(i,0,n-1){
		cin >> k;
		s.insert(k);
	}		
	solve();
	return 0;
}
//do smt instead of nothing! never give up!


Measured memory_bytes: 3656
use std::io;
use std::cmp;


/// https://beta.atcoder.jp/contests/arc097/tasks/arc097_b
fn main() {
    let (n, m) = {
        let i = read::<usize>();
        (i[0], i[1])
    };

    let p = read::<usize>();
    let mut uf = UnionFind::new(n + 1);
    for _ in 0..m {
        let i = read::<usize>();
        uf.unite(i[0], i[1]);
    }

    let mut ans = 0;
    for i in 0..p.len() {
        if uf.same(p[i], i + 1) {
            ans += 1;
        }
    }
    println!("{}", ans);
}


#[derive(Debug)]
struct UnionFind {
    par: Vec<usize>,
    rank: Vec<usize>,
}

impl UnionFind {
    fn new(n: usize) -> UnionFind {
        UnionFind {
            par: (0..n).collect(),
            rank: vec![0; n],
        }
    }

    fn find(&mut self, x: usize) -> usize {
        if self.par[x] == x { x }
        else {
            let y = self.par[x];
            self.par[x] = self.find(y);
            self.par[x]
        }
    }

    fn same(&mut self, x: usize, y: usize) -> bool {
        self.find(x) == self.find(y)
    }

    fn unite(&mut self, x: usize, y: usize) {
        let x = self.find(x);
        let y = self.find(y);
        if x == y { return; }

        match self.rank[x].cmp(&self.rank[y]) {
            cmp::Ordering::Equal => {
                self.par[y] = x;
                self.rank[x] += 1;
            },
            cmp::Ordering::Less => {
                self.par[x] = y;
            },
            cmp::Ordering::Greater => {
                self.par[y] = x;
            }
        }
    }
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

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



Measured memory_bytes: 8444
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int gcd(int x,int y)
{
	if (y==0) return x;
	return gcd(y,x%y);
}
int main()
{
	int n,x,a,ans;
	cin>>n>>x>>a;
	ans=abs(a-x);
	for (int i=2;i<=n;++i) 
		scanf("%d",&a),
		ans=gcd(abs(a-x),ans);
	printf("%d",ans);
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));

		for (String str; (str = br.readLine()) != null; ) {
			char[] roman = str.toCharArray();
			System.out.println(calc(roman));
		}
	}

	public static int calc(char[] roman) {
		int len = roman.length;
		int[] arab = new int[len];
		for (int i = 0; i < len; i++) {
			switch (roman[i]) {
			case 'I':
				arab[i] = 1;
				break;
			case 'V':
				arab[i] = 5;
				break;
			case 'X':
				arab[i] = 10;
				break;
			case 'L':
				arab[i] = 50;
				break;
			case 'C':
				arab[i] = 100;
				break;
			case 'D':
				arab[i] = 500;
				break;
			case 'M':
				arab[i] = 1000;
				break;
			}
		}

		int ret = 0; // return
		for (int i=0; i <= len-2; i++) {
			if (arab[i] < arab[i+1]) {
				ret -= arab[i];
			} else {
				ret += arab[i];
			}
		}
		ret += arab[len-1];
		return ret;
	}
}

Measured memory_bytes: 24276
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

int main(){
    int buff[100];
    bool flag=true;
    int counter,tmp,num=0,k;

    scanf("%d",&counter);
    for(int i=0;i<counter;i++){
        scanf("%d",&buff[i]);
    }

    while(flag){
        flag=false;
        for(int j=counter-1;j!=0;j--){
            if(buff[j]<buff[j-1]){
                tmp=buff[j];
                buff[j]=buff[j-1];
                buff[j-1]=tmp;
                flag=true;
                num++;
            }
        }
    }

    for(k=0;k<counter-1;k++){
        printf("%d ",buff[k]);
    }

    printf("%d\n",buff[k]);
    printf("%d\n",num);

    return 0;


}




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

#define rep(i,z) for(int i = 0; i<(int)(z); i++)
#define rep1(i,z) for(int i = 1; i<=(int)(z); i++)
 
using namespace std;

typedef long long ll;
const ll MOD=1e9+7;
using pear = pair<int,int>;

int main(){
 int n; cin>>n;
 rep(i,3){
    if(n%10==7){
        cout<<"Yes"<<endl;
        return 0;
    }
    n /= 10;
 }
 cout<<"No"<<endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  // ABC142D - Disjoint Set of Common Divisors
  // 最大公約数を求めて素因数分解を行い、素因数が何種類あるか求める
  ll A, B; cin >> A >> B;
  ll g = __gcd(A, B);
  
  ll ans = 1;
  if(g % 2 == 0) ans++;
  while(g % 2 == 0){ // 素数2だけで分解する
    g /= 2;
  }
  for(ll i = 3; i * i <= g; i += 2){ // long long
    if(g % i == 0) ans++;
    while(g % i == 0){
      g /= i;
    }
  }
  if(g > 2) ans++; // 割り切れなかった素数
  cout << ans << endl;
}

Measured memory_bytes: 256
A = [list(map(int, input().split())) for i in range(3)]
N =int(input())
b = [int(input()) for i in range(N)]
for i in b:
    for j in range(3):
        for k in range(3):
            if A[j][k]==i:
                A[j][k]='T'
if A[0][0]=='T' and A[1][0]=='T'and A[2][0]=='T':
    print('Yes')
    exit()
elif A[0][1]=='T' and A[1][1]=='T'and A[2][1]=='T':
    print('Yes')
    exit()
elif A[0][2] == 'T' and A[1][2] == 'T' and A[2][2] == 'T':
    print('Yes')
    exit()
elif A[0][0] == 'T' and A[0][1] == 'T' and A[0][2] == 'T':
    print('Yes')
    exit()
elif A[1][0]=='T' and A[1][1]=='T'and A[1][2]=='T':
    print('Yes')
    exit()
elif A[2][0] == 'T' and A[2][1] == 'T' and A[2][2] == 'T':
    print('Yes')
    exit()
elif A[0][0]=='T' and A[1][1]=='T'and A[2][2]=='T':
    print('Yes')
    exit()
elif A[0][2] == 'T' and A[1][1] == 'T' and A[2][0] == 'T':
    print('Yes')
    exit()
else:
    print('No')

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=1e9+7;
int main(){
    ll h,w;cin>>h>>w;
    if(h%3==0||w%3==0)cout<<0<<endl;
    else{
        ll a1=h/3,a2=a1+1;
        ll ans1=(h-a1)*(w-w/2)-min(a1*w,(h-a1)*w/2);
        ll ans2=max(a2*w,(h-a2)*(w-w/2))-(h-a2)*(w/2);
        ll b1=w/3,b2=b1+1;
        ll ans3=(w-b1)*(h-h/2)-min(b1*h,(w-b1)*h/2);
        ll ans4=max(b2*h,(w-b2)*(h-h/2))-(w-b2)*(h/2);
        //cout<<ans1<<' '<<ans2<<' '<<ans3<<' '<<ans4<<endl;
        cout<<min({ans1,ans2,ans3,ans4,h,w})<<endl;
    }
}

Measured memory_bytes: 256
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[]
for i in a:
    b.append(i//2)
import fractions
l=1
for i in b:
    d=fractions.gcd(i,l)
    l=i*l//d
    if l>m:
        print(0)
        sys.exit()
for i in b:
    if (l//i)%2==0:
        print(0)
        sys.exit()
x=m//l
if x%2==0:
    print(x//2)
else:
    print(x//2+1)









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

int main() {
  int N, H, W; cin >> N >> H >> W;
  int A, B, cnt=0;
  for (int i = 0; i < N; i++) {
    cin >> A >> B;
    if (A >= H && B >= W) cnt++;
  }
  cout << cnt << endl;
}

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


int main(){
  string s;
  cin >> s;
  rep(i,s.length()){
    if(i%2==0)cout << s[i];
  }
  
  
  
  return 0;
}

Measured memory_bytes: 3764
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;

#define PB push_back
#define ALL(v) (v).begin(), (v).end()
#define SZ size()
#define FOR(i, a, n) for(long long (i) = (a); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define SHOW(v) cout << (v) << endl
#define SHOW2(a, b) cout << (a) << " " << (b) << endl
#define SHOW3(a, b, c) cout << (a) << " " << (b) << " " << (c) << endl
#define GET(v) cin >> (v)
#define GET2(a, b) cin >> (a) >> (b)
#define GET3(a, b, c) cin >> (a) >> (b) >> (c)
#define MOD 1000000007
template<class T> void GETV(T &v) { REP(i, v.size()) { GET(v[i]); } }
template<class T> void SHOWV(T &v) { REP(i, v.size()) { SHOW(v[i]); } }

typedef long long ll;

int main()
{
    int n, k;
    GET2(n, k);
    
    vector<ll> h(n);
    GETV(h);
    
    sort(ALL(h), [](const ll &a, const ll &b){return a > b;});
    int ans = h[0] - h[k - 1];
    for(int i = 0; i <= n - k; i++) {
        if(ans > h[i] - h[i + k - 1]) {
            ans = h[i] - h[i + k - 1];
        }
    }
    
    SHOW(ans);
    
    return 0;
}




Measured memory_bytes: 1024