akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}

int main() {
    ll n; cin >> n;
    ll a[200001]; INITA(a, 0, 200000, 0);
    REP(i, n) {
        cin >> a[i];
    }
    ll cur = 0;
    ll res = 0;
    REP(i, n) {
        res += abs(cur - a[i]);
        cur = a[i];
    }
    res += abs(cur);

    cur = 0;
    ll nxt;
    REP(i, n) {
        if (i == n - 1) {
            nxt = 0;
        } else {
            nxt = a[i+1];
        }

        if ((cur <= a[i]) && (a[i] <= nxt)) {
            cout << res << endl;
        } else if ((nxt <= a[i]) && (a[i] <= cur)) {
            cout << res << endl;
        } else {
            cout << res - abs(cur - a[i]) - abs(a[i] - nxt) + abs(cur  - nxt) << endl;
        }
        cur = a[i];
    }
    return 0;
}

Measured memory_bytes: 5192
#include<bits/stdc++.h>
#define mx 100005
using namespace std;

int n, m, a[mx], b[mx];
long long ans[mx], p[mx];

int find(int x){return (p[x] < 0 ? x : p[x] = find(p[x]));}
inline long long uni(int x, int y){
  x = find(x), y = find(y);
  if(x != y){
    long long res = p[x] * p[y];
    p[x] += p[y];
    p[y] = x;
    return res;
  }else return 0;
}

int main(){
  scanf("%d%d", &n, &m);
  for(int i = 0; i < m; i++) scanf("%d%d", a+i, b+i);
  fill(p+1, p+n+1, -1);
  ans[m-1] = (long long)n*(n-1)/2;
  for(int i = m-1; i > 0; i--) ans[i-1] = ans[i] - uni(a[i], b[i]);
  for(int i = 0; i < m; i++) printf("%lld\n", ans[i]);
}

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

signed main(void)
{
	int x;
	cin >> x;
	int i = 1;
	while(x * i % 360 != 0) i++;
	cout << i << endl;
	return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <fstream>
using namespace std;


int main() {
    int n;
    cin>>n;
    n=n % 10;
    if (n==3)cout<<"bon";
    else
    if (n==0 || n==1 || n==6 || n==8  )cout<<"pon";
    else cout<<"hon";


    return 0;
}

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

namespace AtCoder
{
	public class Program
	{
		static void Main(string[] args)
		{
			int N = int.Parse(Console.ReadLine());
			int[] W = Console.ReadLine().Split().Select(p => int.Parse(p)).ToArray();

			int i = 0, j = N;
			int sum1 = 0, sum2 = 0;
			while (i != j) {
				if (sum1 < sum2) {
					sum1 += W[i];
					i++;
				} else {
					j--;
					sum2 += W[j];
				}
			}

			Console.WriteLine(Math.Abs(sum1 - sum2));
		}
	}
}


Measured memory_bytes: 13396
#include<iostream>

using namespace std;

int main() {

	int a, b, c;

	cin >> a >> b >> c;

	if ((a + b) == c) {
		cout << "Yes" << endl;
		return 0;
	}
	if ((c + b) == a) {
		cout << "Yes" << endl;
		return 0;
	}
	if ((a + c) == b) {
		cout << "Yes" << endl;
		return 0;
	}

	cout << "No" << endl;

	return 0;
}

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

int main(){
  int xmin=0, xmax, ymin=0, ymax;
  int n;
  int x, y, a;
  int ans;
  cin >> xmax >> ymax >> n;
  
  for (int i=0; i < n; i++) {
    cin >> x >> y >> a;
    if (a==1) { xmin = max(xmin, x);} 
    else if (a==2) { xmax = min(xmax, x);}
    else if (a==3) { ymin = max(ymin, y);}
    else if (a==4) { ymax = min(ymax, y);}
  }
  
  ans = max(xmax-xmin, 0) * max(ymax-ymin,0);
  
  cout << ans << endl;
}

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

using namespace std;

int main()
{
    vector <int>s;
   for (int i=0;i<10;i++)
   {
       int a;
       cin >> a;
       s.push_back(a);
   }
   sort(s.begin(),s.end(),greater <int>());
   for (int i=0;i<3;i++)
   {
       cout << s[i] << endl;
   }

    return 0;
}


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

int culc(int n){
  int x=0;
  while(n>0){
    x+=n%10;
    n/=10;
  }
  return x;
}

int main(){
  int N;
  cin>>N;
  int ans=culc(1)+culc(N-1);
  for(int i=1;i<N/2;i++)
    ans=min(ans,culc(i)+culc(N-i));
  cout<<ans<<endl;
  return 0;
}
    

Measured memory_bytes: 256
from itertools import combinations
n=int(input())
dp=[0]*5
for i in range(n):
  s=input()
  if s[0]=="M":dp[0]+=1
  if s[0]=="A":dp[1]+=1
  if s[0]=="R":dp[2]+=1
  if s[0]=="C":dp[3]+=1
  if s[0]=="H":dp[4]+=1
ans=0
for a,b,c in combinations(dp,3):
  ans+=a*b*c
print(ans)

Measured memory_bytes: 75012
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
        }

        long[] m = new long[n];
        long[] l = new long[n + 1];
        long[] r = new long[n + 1];

        // 左側から最小公約数を求めていく
        for (int i = 0; i < n; i++) {
            l[i + 1] = gcd(l[i], a[i]);
        }

        // 右側から最小公約数を求めていく
        for (int i = n - 1; i > 0; i--) {
            r[i] = gcd(r[i + 1], a[i]);
        }

        long max = 0;
        for (int i = 0; i < n; i++) {
            max = Math.max(max, gcd(l[i], r[i + 1]));
        }

        System.out.println(max);
    }

    private static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }
}

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

#define mk make_pair
#define pb push_back

typedef long long lld;
typedef pair<lld,lld> pr;
typedef priority_queue <lld> max_heap;
typedef priority_queue <lld, vector<lld>, greater<lld> > min_heap;
lld const mod = 1e9+7;

lld power(lld x, lld y)
{
    lld res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}

lld power_mod(lld base, lld y)
{
    lld t = 1;
    while (y > 0)
    {

        if (y % 2 != 0)
            t = (t * base) % mod;
        base = (base * base) % mod;
        y /= 2;
    }
    return t % mod;
}

lld nCrModp(lld n, lld r, lld p)
{
    if (r > n - r)
        r = n - r;
    lld C[r + 1]={0};
    C[0] = 1;

    for (lld i = 1; i <= n; i++)
    {
      for (lld j = min(i, r); j > 0; j--)
      {
        C[j] = (C[j] + C[j - 1]) % p;

      }
    }
    return C[r];
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  lld x,y;
  cin>>x>>y;
  lld i;
  lld f=0;
  for(i=0;i<=x;i++)
  {
    if(y == i*2 + (x-i)*4)
    {
      f=1;
      break;
    }
  }
  if(f)
  {
    cout<<"Yes\n";
  }
  else
  {
    cout<<"No\n";
  }

}


Measured memory_bytes: 3648
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    INF = 0
    dp = [[INF] * (N+1) for i in range(3)]

    for i in range(N):
        dp[0][i+1] += max(dp[1][i]+a[i], dp[2][i]+a[i])
        dp[1][i+1] += max(dp[0][i]+b[i], dp[2][i]+b[i])
        dp[2][i+1] += max(dp[1][i]+c[i], dp[0][i]+c[i])

    print(max(dp[0][N], dp[1][N], dp[2][N]))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]" 
    b = [int()] * (N)  # type: "List[int]" 
    c = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, a, b, c)

if __name__ == '__main__':
    main()


Measured memory_bytes: 26720
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
 
int a[3],k;
cin >> a[0] >> a[1] >> a[2] >> k;
sort(a, a + 3);
for (int i = 0; i < k; i++){
    a[2] = a[2] * 2;
}
 cout << a[0] + a[1] + a[2] << endl;
 
 return 0; 
}


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

int main() {
	string s;cin>>s;
	int ans=753;
	for(int i=0;i<=s.size()-3;i++){
		int num=0;
		num+=100*(s[i]-'0');
		num+=10*(s[i+1]-'0');
		num+=(s[i+2]-'0');
		int d=753-num;
		if(d<0)d*=-1;
		if(d<ans){
			ans=d;
		}
//		cout<<num<<endl;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define r(i, j) for (int i = 1; i <= j; i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T>
using vec = std::vector<T>;



int main() {
    int N, M, Q;
    cin >> N >> M >> Q;
    vec<int> A(Q),B(Q),C(Q),D(Q);
    rep(i, Q) {
        cin >> A[i] >> B[i] >> C[i] >> D[i];
        --A[i];--B[i];
    }

    ll ans = 0;
    for (int a = 1; a <= M; ++a) {
        r(b, a) r(c, b) r(d, c) r(e, d) r(f, e) r(g, f) r(h, g) r(i, h)  r(j, i){
            // vec<int> Z ={a,b,c,d,e,f,g,h,i};
            vec<int> Z ={j,i,h,g,f,e,d,c,b,a};
            ll tmpans = 0;
            rep(k,Q){
                if(Z[B[k]] - Z[A[k]] == C[k]) tmpans += D[k];
            }
            ans = max(ans,tmpans);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 3588
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s[] = new int[26];
		int t[] = new int[26];
		String S = sc.next();
		String T = sc.next();
		for (int i=0;i<S.length();i++) {
			s[S.charAt(i)-'a']++;
		}
		for (int i=0;i<T.length();i++) {
			t[T.charAt(i)-'a']++;
		}
		int i = 0;
		for (;i<26;i++) {
			if (s[i]>0) {
				break;
			}
		}
		int j =25;
		for (;j>=0;j--) {
			if (t[j]>0) {
				break;
			}
		}
		if (j>i) {
			System.out.println("Yes");
		} else if (j==i){
			if (s[i]==S.length()) {
				if (s[i]<t[j]) {
					System.out.println("Yes");
				} else if (s[i]==t[j]&&S.length()<T.length()) {
					System.out.println("Yes");
				} else {
					System.out.println("No");
				}
			} else {
				System.out.println("No");
			}
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 23124
#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;

string s;
long long ans = 0, k;

int main()
{
	cin >> s >> k;
	
	string ne = s;
	int size = s.size(), oot = 0, cnt = 0;
	char last = '+';
	
	for (int i = 0; i < size; i++)
	{
		if (ne[i] == last)
		{
			ans++;
			last = '+';
		}
		else last = ne[i];
		
		if (i == size - 1 && ne[i] == ne[0] && last != '+')
		{
			if (oot == 1)
			{
				if (ans - cnt != cnt)
				{
					ans -= cnt;
					ans *= (k - 1);
					cout << ans + cnt << '\n';
					
					return 0;
				}
				else break;
			}
			
			cnt = ans;
			ne += s;
			size += s.size();
			last = ne[i];
			oot = 1;
			
			//cout << last << '!' << '\n'; 
		}
	}
	
	//cout << "erfgregr";
	
	if (oot == 0)
		ans = ans * k;
	else
	{
		ans = ans * (k / 2);
		
		if (k % 2)
		{
			ans += cnt;
		}
	}
	
	cout << ans << '\n';
	
	return 0;
}

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

int main() {
	string s, t;
	cin >> s >> t;

	int cnt = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] != t[i]) {
			s[i] = t[i];
			cnt++;
		}
	}

	cout << cnt << endl;
	return 0;
}

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

int main() {
    string s, t;
    cin >> s >> t;
    int64_t n = s.size();

    string ss = s + s;
    vector<vector<int>> next((int) 2 * n + 1, vector<int>(26, -1));
    for (int i = 2 * n - 1; i >= 0; i--) {
        for (int j = 0; j < 26; j++) next[i][j] = next[i+1][j];
        next[i][ss[i] - 'a'] = i;
    }

    int64_t index = 0, loop = 0;
    for (auto e : t) {
        if (next[index][e - 'a'] == -1) {
            cout << -1 << endl;
            return 0;
        }

        if (next[index][e - 'a'] >= n) {
            loop++;
            index = next[index][e - 'a'] % n + 1;
        } else {
            index = next[index][e - 'a'] + 1;
        }
    }

    cout << index + loop * n << endl;
}


Measured memory_bytes: 27264
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ALL(x) (x).begin(), (x).end()
#define dump(x) cout << (x) << endl
#define LMAX 9223372036854775807LL
#define LMIN -9223372036854775807LL
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T *)array, (T *)(array + N), val);
}

const ll INF = 1e18;
const ll mod = 1e9 + 7;

int main(){
    ll h,w,d;
    cin >> h >> w >> d;
    vector<vector<P>> p(d,vector<P>(h * w / d + 1));
    vector<vector<ll>> dif(d,vector<ll>(h * w / d + 1));
    REP(i,h){
        REP(j,w){
            int a;
            cin >> a;
            int t = a % d, s = a / d;
            p[t][s] = make_pair(i,j);
        }
    }
    REP(i, d){
        dif[i][0] = 0;
        for(int j = 1;j * d + i <= h * w;j++){
            dif[i][j] = fabs(p[i][j - 1].first - p[i][j].first) + fabs(p[i][j - 1].second - p[i][j].second) + dif[i][j - 1];
        }
    }
    ll q;
    cin >> q;
    REP(i,q){
        ll l ,r;
        cin >> l >> r;
        dump(dif[l % d][r / d] - dif[l % d][l / d]);
    }
}


Measured memory_bytes: 11648
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define N 100005
#define ll long long
#define ull unsigned long long
#define loop1(i, j, k, step) for (int i = j; i < k; i += step)
#define loop(i, j, k) for (int i = j; i < k; i++)
#define rloop1(i, j, k, step) for (int i = j; i >= k; i -= step)
#define rloop(i, j, k) for (int i = j; i >= k; i--)
#define rep(i, k) for (int i = (0); i < (k); i++)
#define rrep(i, k) for (int i = k - 1; i >= 0; i--)

#define forall(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define mp make_pair
#define pb push_back
#define pop pop_back
#define F first
#define S second
#define sz(x) (int)(x).size()
#define endl "\n"
#define Max (int)INT_MAX
#define Min (int)INT_MIN
#define MEM(a, b) memset(a, (b), sizeof(a))
#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL)
#define lin puts("");
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;
void solve()
{
    long double n, x;
    scanf("%Lf", &n);
    x = n / 3;
    printf("%.12Lf\n", x * x * x);
}
int main()
{
    auto start = clock();
    fast_io;
    FILE *fp;

    //freopen("test.txt", "r", stdin);
    int t;
    t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    auto stop = clock();
    cerr << "time taken:" << double(stop - start) / double(CLOCKS_PER_SEC) << " s" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>                 // [PRIMES]               1777 ~2^10.80
using namespace std;                     //                       10333 ~2^13.33
using ll = long long;                    // seq 1 128 | factor   100333 ~2^16.61
using vl = vector<ll>;                   //   | grep -v ' .* '  1300111 ~2^20.31
using vvl = vector<vl>;                  //                    10300777 ~2^23.30
using pll = pair<ll,ll>;                 //                   100400999 ~2^26.58
using vb = vector<bool>;                 //                  1300400999 ~2^30.28
const ll oo = 0x3f3f3f3f3f3f3f3fLL;      //                 10200500333 ~2^33.25
const double eps = 1e-9;                 //                100200400777 ~2^36.54
#define sz(c) ll((c).size())             //               1200300700111 ~2^40.13
#define all(c) begin(c),end(c)           //              10200300500777 ~2^43.21
#define mp make_pair                     //             100200300400777 ~2^46.51
#define mt make_tuple                    //            1200300400600999 ~2^50.09
#define pb push_back                     //           10200300400600111 ~2^53.18
#define eb emplace_back                  //          100200300400600333 ~2^56.48
#define xx first                         //         1200300400500800999 ~2^60.06
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define FOR(i,a,b) for (int i=(a); i<(b); i++)
#define FORD(i,a,b) for (int i=int(b)-1; i>=(a); i--)

int main() {

	ll res = 0;
	ll N;
	cin >> N;
	vl a(N),b(N), c(N);
	FOR(i,0,N) cin >> a[i];
	FOR(i,0,N) cin >> b[i];
	FOR(i,0,N) cin >> c[i];
	sort(all(a));
	sort(all(b));
	sort(all(c));
	ll curA = 0;
	vl B(N);
	FOR(cb, 0, N) {
		while (curA < N && a[curA] < b[cb]) curA++;
		B[cb] = curA;
	}
	ll curB = 0;
	ll curSum = 0;
	FOR(cc, 0, N) {
		while (curB < N && b[curB] < c[cc]) {
			curSum += B[curB];
			curB++;
		}
		res += curSum;
	}
	cout << res << endl;
}

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

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

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

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

using namespace std;

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

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

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

long long n, m;

long long powmod(long long x, long long e) {
  long long c = x, p = 1;
  while(e > 0) {
    if(e%2) p = p*c%mod;
    c = c*c%mod;
    e/=2;
  }
  return p;
}

long long f(int e) {
  long long ans = 1;
  for(int i = 0; i < e; ++i) {
    ans = ans*(n+i)%mod;
    ans = ans*powmod(i+1, mod-2)%mod;
  }
  return ans;
}

int main() {
  cin >> n >> m;
  long long p = 2;
  long long ans = 1;
  for(; m > 1; p++) {
    int e = 0;
    while(m%p==0) e++, m/=p;
    ans = ans * f(e)%mod;
  }
  if(m > 1) ans = ans*f(1)%mod;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
sub f{my$p=$h[my$c=$c[$_]-1];my$r=$s=$v[++$_]=1;$v[$_--]or$a[$c]-=-$s*(-$s+($s=($r+=f())-$h[$c]+$p))for@$_;$a[$c]+=($p+$r-$h[$c])*(@a-($h[$c]=$p+$r))+1;$r}@a=(0)x<>;@c=glob<>;map{push@$_,$z[--$|]for@z=split}<>;f;print"@a"

Measured memory_bytes: 570480
import java.util.*;

public class Main{
	public static int di[] = {1,1,1,0};
	public static int dj[] = {0,-1,1,1};

	public static int dfs(ArrayList<Integer> list){
		if(list.size() == 0) return 0;
		int min = list.size();
		int ni,nj,isize,jsize,rst;

		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				isize = (list.size()-1) / 4;
				jsize = list.size()-i*4>4 ? 3 : (list.size()-1)%4;
				if(i<0 || i>isize || j<0 || j>jsize) continue; 

				for(int k=0;k<4;k++){
					ni = i + di[k];
					nj = j + dj[k];
					jsize = list.size()-ni*4>4 ? 3 : (list.size()-1)%4;

					if(ni<0 || ni>isize || nj<0 || nj>jsize) continue;
					if(list.get(ni*4+nj)==list.get(i*4+j)){
						ArrayList<Integer> tmp = new ArrayList<Integer>(list);
						tmp.remove(ni*4+nj);
						tmp.remove(i*4+j);
						rst = dfs(tmp);
						if(rst == 0) return 0;
						if(min > rst) min = rst;
					}
				}
			}
		}
		return min;
	}

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		while(n-- > 0){
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i=0;i<20;i++) list.add(sc.nextInt());
			System.out.println(dfs(list));
		}
	}
}

Measured memory_bytes: 12000
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String c1 = sc.next();
    String c2 = sc.next();
    String c3 = sc.next();
    System.out.print(c1.charAt(0));
    System.out.print(c2.charAt(1));
    System.out.println(c3.charAt(2));
  }
}


Measured memory_bytes: 24916
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

data = collections.Counter()
n = int(input())
for i in range(n):
  s = input()
  data[s] += 1
ansset = ["AC","WA","TLE","RE"]
for ai in ansset:
  print(ai,"x",data[ai])

Measured memory_bytes: 74044
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstring>
#include <map>

using namespace std;

int main(int argc, char const *argv[])
{
    string S,T;
    cin >> S >> T;
    string T2 = T.erase(T.size()-1);
    if (S==T2)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
    
    
    return 0;
}


Measured memory_bytes: 3628
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

const int N = 2e3 + 11, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 1e5 + 11;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-4;
const double PI = acos(-1.0);


template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }


typedef pair <int, int> pii;
typedef pair <ll, ll> pll;


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

#define int ll


int n, a[22];
int solve(int l, int r, int cl, int cr) {
    if (l + 1 == r) return 0;
    int ret = INF2;
    fo(i, l + 1, r - 1, 1) {
        chmin(ret, a[i] * (cl + cr) + solve(l, i, cl, cr + cl) + solve(i, r, cl + cr, cr));
    }
    return ret;
}
main() {
    file("censor");
    ios;
    cin >> n;
    fo(i, 1, n, 1) cin >> a[i];
    cout << a[1] + a[n] + solve(1, n, 1, 1);
    return 0;
}
/**

*/


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

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int N = Integer.parseInt(br.readLine());

			int x;

			for(int i = 1; i <= N; i++)
			{
				if(i%3 == 0){
					System.out.printf(" %d",i);
				}else{
					x = i;
					do{
						if(x%10 == 3){
							System.out.printf(" %d",i);
							break;
						}
						x /=10;
					}while(x != 0);
				}
			}
			System.out.printf("\n");

		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}




Measured memory_bytes: 39400
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
signed main()
{
    int n;
    cin>>n;
    int a[n],dp[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    
    dp[0]=0;
    dp[1]=abs(a[1]-a[0]);
    for(int i=2;i<n;i++)
    {
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
    }
    cout<<dp[n-1]<<endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define to edge[i].v
#define mp make_pair
#define rint register int
#define debug(x) cerr<<#x<<"="<<x<<endl
#define fgx cerr<<"-------------"<<endl
#define N 1000000
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
int a[N],b[N];
int main()
{	int n; cin>>n;
	for(rint i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	if(n&1)
	{	ll ans=0;
		b[n/2+1]=a[1];
		for(rint i=1,cur=0,l=2,r=n;i<=n/2;i++,cur^=1)
		{	if(cur) b[n/2+1+i]=a[l++],b[n/2+1-i]=a[l++];
			else b[n/2+1+i]=a[r--],b[n/2+1-i]=a[r--];
		}
		for(rint i=1;i<n;i++) ans+=abs(b[i+1]-b[i]);
		ll sum=0; b[n/2+1]=a[n];
		for(rint i=1,l=1,r=n-1,cur=1;i<=n/2;i++,cur^=1)
		{	if(cur) b[n/2+1+i]=a[l++],b[n/2+1-i]=a[l++];
			else b[n/2+1+i]=a[r--],b[n/2+1-i]=a[r--];
		}
		for(rint i=1;i<n;i++) sum+=abs(b[i+1]-b[i]);
		cout<<max(ans,sum);
	}
	else
	{	ll ans=0;
		b[n/2]=a[1]; b[n/2+1]=a[n];
		for(rint i=1,cur=1,l=2,r=n-1;i<n/2;i++,cur^=1)
		{	if(cur) b[n/2+i+1]=a[l++],b[n/2-i]=a[r--];
			else b[n/2+i+1]=a[r--],b[n/2-i]=a[l++];
		}
		for(rint i=1;i<n;i++) ans+=abs(b[i+1]-b[i]);
		cout<<ans;
	}

	return 0;
}


Measured memory_bytes: 4736
//#include <bits/stdc++.h>
#include<iostream>
#include<utility>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<cfloat>
#include<functional>
#include<string>
#include<numeric>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<chrono>
#include<cctype>
#include<iterator>
#include<bitset>
#include<locale>
#include<chrono>
#include<ctime>
#include<cstring> // for memset
#define read(FILE)  freopen(FILE, "r", stdin);
#define out(FILE) freopen(FILE, "w", stdout);
#define all(x) x.begin(),x.end()
#define clr(v,val) memset(v,val,sizeof(v))
#define rep(i,m,n) for(ll i=m ; i<n ; i++)
#define forr(i,m,n) for(ll i=m ; i<=n ; i++)
#define endl '\n'
#define pb push_back
#define pff push_front
#define re return
#define bit __builtin_popcountll
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int N = 5e4;
const ll mod = 1e9 + 7;
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int main()
{
	int n; cin >> n;
	for (ld i = 1; i <= N; i++) {
		ld ans = i * 1.08;
		if (int(ans) == n) {
			re cout << int(i), 0;
		}
	}
	

	cout << ":(";

}


Measured memory_bytes: 256
'use strict'
function Main(input){
  input=readAsNumArray(input);
  for(let i=0;i<input.length;i++){
    input[i]=parseInt(input[i]);
  }
  var N=input.shift();
  var M=input.shift();
  var x=[],y=[],z=[];
  for(let i=0;i<N;i++){
    x[i]=input[3*i];
    y[i]=input[3*i+1];
    z[i]=input[3*i+2];
  }
  var X=minus(x);
  var Y=minus(y);
  var Z=minus(z);
  var counters=[];
  counters[0]=maximize(x,y,z,N,M);
  counters[1]=maximize(X,y,z,N,M);
  counters[2]=maximize(x,Y,z,N,M);
  counters[3]=maximize(X,Y,z,N,M);
  var max=Math.max.apply(null,counters);
  console.log(max);
} 

function maximize(x,y,z,N,M){
  var t=[];
  for(let i=0;i<N;i++){
    var val=x[i]+y[i]+z[i];
    var d=0,u=t.length-1;
    var m=0;
    while(!(d>u)){
      m=Math.floor((d+u)/2);
      if(t[m]<val){
        d=m+1;
      }else{
        u=m-1;
      }
      m=Math.floor((d+u)/2);
    }
    t.splice(m+1,0,val);
  }
  
  var counter1=0;
  for(let i=0;i<M;i++){
    counter1+=t[N-1-i];
  }
  var counter2=0;
  for(let i=0;i<M;i++){
    counter2+=-t[i];
  }
  
  return Math.max(counter1,counter2);
}

function minus(x){
  var x_=[];
  for(let i=0;i<x.length;i++){
    x_[i]=-x[i];
  }
  return x_;
}


function readAsNumArray(input){

var I=[],i=0;

var checkNum=/^-*\d+/;

var checkSpace=/ +|\n+/;

while(input.length>0){

if(input.match(checkNum)!==null){

I[i]=input.match(checkNum)[0];

input=input.replace(checkNum,""); 

i++;

continue;

}

input=input.replace(checkSpace,"");

continue;

}

return input=I;
}

Main(require('fs').readFileSync('/dev/stdin','utf8'));


Measured memory_bytes: 11164
#include <stdio.h>

int main(void)
{
	int a, b, a2, b2;
	int max, min, r;
	
	while (scanf("%d %d", &a, &b) != EOF){
		a2 = a;
		b2 = b;
		r = 1;
		while (r != 0){
			r = a2 % b2;
			a2 = b2;
			max = b2;
			b2 = r;
		}
		min = (a / max) * b;
		
		printf("%d %d\n", max, min);
	}
	
	return (0);
}

Measured memory_bytes: 0
x, y = map(int, input().split())
if (x + y) % 3 != 0 or x * 2 < y or y * 2 < x:
    print(0)
else:
    n = (x + y) // 3
    r = y - n
    mod = 1000000007

    facn = 1
    facr = 1
    facnr = 1
    for i in range(1, n + 1):
        facn = (facn * i) % mod
        if i == r:
            facr = facn
        if i == n - r:
            facnr = facn
    
    b = 1
    invfacr = 1
    invfacnr = 1
    while b <= mod:
        if b & (mod - 2) != 0:
            invfacr = (invfacr * facr) % mod
            invfacnr = (invfacnr * facnr) % mod
        facr = (facr * facr) % mod
        facnr = (facnr * facnr) % mod
        b *= 2

    print((facn * invfacr * invfacnr) % mod)


Measured memory_bytes: 9084
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> intpair;
typedef std::pair<long long, long long> llpair;

#define mod 1000000007
#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i, n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)

using namespace std;

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

	int n, k;
	cin >> n >> k;
	ll* v;
	v = new ll[n];
	rep(i, n) cin >> v[i];

	int r = min(n, k);

	ll ans = 0;
	rep(i, r + 1) {
		rep(j, r-i+1) {
			vector<ll> vec;
			ll sum = 0;
			rep(x, i) vec.push_back(v[x]);
			rep(y, j) vec.push_back(v[n - 1 - y]);
			sort(vec.begin(), vec.end());
			int counter = k - i - j;
			rep(k, vec.size()) {
				if (vec[k] < 0 && counter > 0) --counter;
				else sum += vec[k];
			}

			ans = max(ans, sum);
		}
	}

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


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

const int N = 1e5 + 1;

int dp[3][N];

int main()
{
	int n;
	cin >> n;
	
	for(int i = 1; i <= n; i++)
	{
		for(int j = 0; j < 3; j++)
		{
			cin >> dp[j][i];
		}
	}
	
	for(int i = 1; i <= n; i++)
	{
		for(int j = 0; j < 3; j++)
		{
			dp[j][i] += max(dp[(j + 1) % 3][i - 1], dp[(j + 2) % 3][i - 1]);
		}
	}
	
	cout << max(dp[0][n], max(dp[1][n], dp[2][n]));
	
	return 0;
}

Measured memory_bytes: 1408
function Main(input) {
    var mozi = input[0];
    
    var result = '';
    if (mozi === 'A') {
        result = 'T';
    } else if (mozi === 'T') {
        result = 'A';
    } else if (mozi === 'C') {
        result = 'G';
    } else if (mozi === 'G') {
        result = 'C';
    }
    console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

Measured memory_bytes: 22456
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define int long long
//#define int __int128
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define y1 y122

/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")

#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")

#pragma comment(linker, "/STACK: 20000000005")
*/

using namespace std;


const int N = 105, INF = 1e12;

map < int, int > M;

priority_queue < pair < int, int > > Q;

void solve () {
    int n, a, b, c, d;
    n = 29384293847243;
    a = 454353412;
    b = 332423423;
    c = 934923490;
    d = 1;
    cin >> n >> a >> b >> c >> d;
    //cout << n << " " << a << " " << b << " " << c << " " << d << endl;
    M.clear();
    M[n] = 1;
    while (Q.size() > 0)
        Q.pop();
    Q.push ({-1, n});
    while (Q.size() > 0){
        int D = -Q.top().F;
        int X = Q.top().S;
        Q.pop();
        if (D != M[X])
            continue;
        if (X == 0){
            cout << D-1 << endl;
            return;
        }
        int k, p, x, dist;
        if (X <= INF / d){
            x = 0;
            dist = D + d * X;
            if (M[x] == 0 || M[x] > dist){
                M[x] = dist;
                Q.push ({-dist, x});
            }
        }
        k = 2, p = a;
        x = X / k;
        dist = D + p + d * (X % k);
        if (M[x] == 0 || M[x] > dist){
            M[x] = dist;
            Q.push ({-dist, x});
        }
        x++;
        dist = D + p + d * (k - X % k);
        if (M[x] == 0 || M[x] > dist){
            M[x] = dist;
            Q.push ({-dist, x});
        }


        k = 3, p = b;
        x = X / k;
        dist = D + p + d * (X % k);
        if (M[x] == 0 || M[x] > dist){
            M[x] = dist;
            Q.push ({-dist, x});
        }
        x++;
        dist = D + p + d * (k - X % k);
        if (M[x] == 0 || M[x] > dist){
            M[x] = dist;
            Q.push ({-dist, x});
        }


        k = 5, p = c;
        x = X / k;
        dist = D + p + d * (X % k);
        if (M[x] == 0 || M[x] > dist){
            M[x] = dist;
            Q.push ({-dist, x});
        }
        x++;
        dist = D + p + d * (k - X % k);
        if (M[x] == 0 || M[x] > dist){
            M[x] = dist;
            Q.push ({-dist, x});
        }
    }
}

main()
{
    ios_base::sync_with_stdio(0);
    int T=1;
    cin >> T;
    while (T--){
        solve ();
    }
}
/*
1
29384293847243 454353412 332423423 934923490 1
*/


Measured memory_bytes: 4632
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
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;}

int N,i,j;
inline void solve(){
  IN(N);
  for(i=0;i*4<=N;i++){
    for(j=0;j*7<=N;j++){
      if(i*4+j*7==N){
        OUT("Yes");
        return;
      }else if(i*4+j*7>N)break;
    }
  }
  OUT("No");
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define all(x) x.begin(),x.end()
#define ln '\n'
const double PI = acos(-1.0);
const long long MOD = 1000000007LL;
//const long long MOD = 998244353LL;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
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 N,S; 

bool f(ll b) {
    ll ret = 0;
    ll K = N;
    while (K > 0) {
        ret += K % b;
        K /= b;
    }
    if (ret==S) return true;
    return false;
}

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

    if (N==S) {
        cout << N+1 << ln;
        return 0;
    }
    vector<ll> ans;
    ll M = N-S;
    for (ll i = 1; i*i <= M; i++) {
        if (M%i==0) {
            if (f(i+1)) ans.emplace_back(i+1);
            if (f(M/i+1)) ans.emplace_back(M/i+1);
        }
    }

    sort(all(ans));
    cout << (ans.empty() ? -1 : ans[0]) << ln;
}

Measured memory_bytes: 256
#include <stdio.h>
 int main(void){    
 int N,M,i,j,A[1000],Ai,Bj,count[1000],max_count=0,max_game=-1;  
   scanf("%d%d",&N,&M);  
     for(i=0;i<N;i++){  
       scanf("%d",&Ai);    
     A[i]=Ai;      
   count[i]=0;   
  }    
 for(j=0;j<M;j++){   
      scanf("%d",&Bj);   
      for(i=0;i<N;i++){     
        if(A[i]<=Bj){count[i]++;break;}   
      }     
}    
   for(i=0;i<N;i++){        
 if(max_count<count[i]){    
         max_count=count[i];     
        max_game=i;      
   }    
 }      
 printf("%d\n",max_game+1);
return 0;
 } 

Measured memory_bytes: 604
s=input()
kk=int(input())

dic={}
for i in range(len(s)):
    dic[s[i]]=1
    
dic=sorted(dic,key=lambda x:x[0])
check=0
se=set()
for i in dic:
    for j in range(len(s)):
        if s[j]!=i:
            continue
        k=j+1
        se.add(i)
        sss=i
        while k<len(s):
            sss+=s[k]
            se.add(sss)
            k+=1
            if k-j>kk:
                break
    if len(se)>=kk:
        break
se=sorted(list(se))
print(se[kk-1])
    

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;int n,k,s;vector<int>p;int main(){cin>>n>>k;p.resize(n);for(int i=0;i<n;i++)cin>>p[i];sort(p.begin(),p.end());for(int i=0;i<k;i++)s+=p[i];cout<<s;return 0;}

Measured memory_bytes: 3592
import java.util.Scanner;

public class Main {
	
	static void BubbleSort(int d[]) {
		for (int i = d.length - 1; i > 0; i--) {
			for (int j = 0; j < i; j++) {
				if (d[j] > d[j + 1]) {
					int work;
					work = d[j];
					d[j] = d[j + 1];
					d[j + 1] = work;
				}
				// printData(d);
			}
		}
	}
	
	public static void main(String[] args) {

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int A[] = new int[3];
		for (int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}

		BubbleSort(A);

		int ans = A[0]+A[1];
		
		System.out.println(ans);
		
		
	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define LL long long
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
int n,m;
vector<int>G[1000010];
struct UF{
	int par[1000010],rnk[1000010];
	void rem(int i){
		par[i]=i,rnk[i]=0;
	}
	void init(int n){
		for(int i=1;i<=n;i++)par[i]=i,rnk[i]=0;
	}
	int find(int x){
		if(x==par[x])return x;
		return par[x]=find(par[x]);
	}
	void unite(int x,int y){
		x=find(x),y=find(y);
		if(x==y)return;
		if(rnk[x]<rnk[y])par[x]=y;
		else{
			par[y]=x;
			if(rnk[x]==rnk[y])rnk[x]++;
		}
	}
	bool same(int x,int y){
		return find(x)==find(y);
	}
}uf;
bool vis[1000010];
int mx=0,sum;
void dfs(int x){
	vis[x]=1;
	sum++;
	for(auto to:G[x])if(!vis[to])dfs(to);
}
int h[1000010];
int main(){
	cin>>n>>m;
	uf.init(n);
	for(int i=1,x,y;i<=m;i++){
		cin>>x>>y;
		G[x].pb(y);
		G[y].pb(x);
		uf.unite(x,y);
	}
//	for(int i=1;i<=n;i++)h[uf.par[i]]++;
	int ans=0;
//	for(int i=1;i<=n;i++)ans=max(ans,h[i]);
	for(int i=1;i<=n;i++)if(!vis[i])sum=0,dfs(i),mx=max(mx,sum);
	cout<<mx<<endl;
	return 0;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> room(m+2);
  vector<int> dist(n+1, -1);
  queue<int> que;
  for(int i=1 ; i<=m; i++) {
    int a, b;
    cin >> a >> b;
    room[a].push_back(b);
    room[b].push_back(a);
  }
  // 部屋1から始める
  dist[1]=0;
  que.push(1);
  while(!que.empty()) {
    int v = que.front();
    que.pop();
    for(int nv:room[v]) {
      if(dist[nv] != -1) continue;
      dist[nv] = dist[v] + 1;
      que.push(nv);
    }
  }
  //for(int i=1; i<dist.size(); i++) cout << "room :" << i << ", dist :" << dist[i] << endl;
  cout << "Yes" << endl;
  for(int i=2; i<=n; i++) {
    int minDist = 10000000;
    int minRoom;
    for(int j=0; j<(int)room[i].size(); j++) {
      //cout << "j :" << j << ", room :" << room[i][j] <<  ", dist :" << dist[room[i][j]] << endl;
      if(dist[room[i][j]]<minDist) {
          minDist = dist[room[i][j]];
          minRoom = room[i][j];
      }
    }
    cout << minRoom << endl;
  }
}


Measured memory_bytes: 12512
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>

using namespace std;

int n,k;
int a[100010];
int f[100010];

int main()
{
	memset(f,0x3f,sizeof(f));
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	f[1]=0;
	f[2]=abs(a[2]-a[1]);
	for(int i=3;i<=n;i++)
	{
		for(int j=1;j<=k;j++)
		{
			if(i-j)
			{
				f[i]=min(f[i],f[i-j]+abs(a[i]-a[i-j]));
			}
			else
			{
				break;
			}
		}
	}
	printf("%d",f[n]);
	return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define nw '\n'

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	int x;
	cin>>x;
	if(x>=30 && x<=40)
		cout<<"Yes"<<nw;
	else
			cout<<"No"<<nw;
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;


const int MAX_V = 1000;

int par_uft[MAX_V];
int rank_uft[MAX_V];
 
void init_uft(int n) {
	int i;
	for (i = 0; i < n; i++) {
		par_uft[i] = i;
		rank_uft[i] = 0;
	}
}
 
int find_uft(int x) {
	if (par_uft[x] == x) {
		return x;
	}
	else {
		return par_uft[x] = find_uft(par_uft[x]);
	}
}
 
void unite_uft(int x, int y) {
	x = find_uft(x);
	y = find_uft(y);
	if (x == y)return;
 
	if (rank_uft[x] < rank_uft[y]) {
		par_uft[x] = y;
	}
	else {
		par_uft[y] = x;
		if (rank_uft[x] == rank_uft[y]) {
			rank_uft[x]++;
		}
	}
}
 
bool same_uft(int x, int y) {
	return find_uft(x) == find_uft(y);
}



int main(){
	int n, k;
	cin>>n>>k;
	init_uft(n + 1);

	int m, t, s;
	for(int i = 0; i < k; i++){
		cin>>m>>s;
		for(int j = 0; j < m - 1; j++){
			cin>>t;
			unite_uft(s, t);
		}
	}
	int cnt = 0;
	cin>>m;
	vi v(n + 1, 0);
	for(int i = 0; i < m; i++){
		cin>>s>>t;
		if(same_uft(s, t)){
			if(!v[s]){
				v[s] = 1;
				cnt++;
			}
			if(!v[t]){
				v[t] = 1;
				cnt++;
			}
		}
	}
	cout<<cnt<<endl;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int sum = accumulate(a.begin(), a.end(), 0);
    int cnt = 0;
    rep(i, n) {
        if (4 * m * a[i] < sum) continue;
        cnt++;
    }
    if (cnt >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

int main() {
  int N;
  cin >> N;
  
  vector<int> vec(N);
  
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
  }
  
  int count = 0;
  
  
  for(int i = 0; i < N-2; i++){
    if( (vec.at(i+1) - vec.at(i)) * (vec.at(i+1) - vec.at(i+2)) <= 0 ){
      count++;
    }
  }
    
  cout << count << endl;
    
}
    

Measured memory_bytes: 256
N, M = map(int, input().split())
pairs = []
for i in range(M):
    t = list(map(int, input().split()))
    pairs.append(t)

p_count = [1] * (N + 1)
for r in sorted(pairs, key=lambda x: x[1]):
    r.append("{:06d}{:06d}".format(r[0], p_count[r[0]]))
    p_count[r[0]] += 1

print("\n".join((r[2] for r in pairs)))

Measured memory_bytes: 39100
import java.util.ArrayList;
import java.util.Scanner;


public class Main 
{
	static ArrayList<Integer> prime = new ArrayList<>();
	
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		create();
		
		for(; scanner.hasNext(); )
		{
			int n = scanner.nextInt();
			int i = 0;
			for(; i<prime.size(); i++)
			{
				if(n < prime.get(i))
				{
					break;
				}	
			}
			System.out.println(i);
		}
	}
	
	private static void create()
	{
		for(int i=2; i<999999; i+=(i==2)?1:2)
		{
			int p = (int)Math.sqrt(i);
			boolean is_prime = true;
			for(int j=2; j<=p; j+=(j==2)?1:2)
			{
				if(i % j == 0)
				{
					is_prime = false;
					break;
				}
			}
			if(is_prime)
			{
				prime.add(i);
			}
		}
	}
}

Measured memory_bytes: 29156
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB emplace_back
#define PF emplace_front
#define FILL(a,b) memset(a,b,sizeof(a))
#define lwb lower_bound
#define upb upper_bound
using namespace std;
V<int> v[200005];
int n;
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int ans=0;
	cin>>n;
	int x,y;
	FOR(i,2,n){
		cin>>x>>y;
		v[x].PB(y);
		v[y].PB(x);
	}
	FOR(i,1,n){
		V<int> t;
		for(auto u:v[i]){
			if(u<i)t.PB(u);
		}
		sort(ALL(t));
		if(t.empty()){
			ans+=i*(n-i+1);continue;
		}
		ans+=(i-t.back())*(n-i+1);
		if(t.size()>1)rep(j,0,t.size()-1)ans-=t[j]*(n-i+1);
	}
	cout<<ans;
	RE 0;
}




Measured memory_bytes: 18704
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b,c;
  cin>>a>>b>>c;
  if(a<=c && c<=b){
    cout<<"Yes"<<'\n';
  }
  else{
    cout<<"No"<<'\n';
  }
  return(0);
}


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

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

    int a,b;

    cin>>a>>b;

    if(a==0||b==0) cout<<"Zero\n";
    else if(a>0&&b>0)cout<<"Positive\n";
    else if(a<0&&b>0)cout<<"Zero\n";
    else
    {
        if((abs(a)-abs(min(0,b)))%2==0)cout<<"Negative\n";
        else cout<<"Positive\n";
    }    

    return 0;
}


Measured memory_bytes: 3628