akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}

int A[200000];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();
	int saidai = 1;
	rep(i, N) {
		A[i] = getint();
		if (A[i] > saidai) saidai = A[i];
	}
	nth_element(A, A + N / 2, A + N);

	ll kotae = 0;
	for (int i = N / 2; i < N; i++) kotae += A[i];

	printf("%lld\n", kotae * 2 - saidai - N % 2 * A[N / 2]);

	Would you please return 0;
}

Measured memory_bytes: 2472
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;
//const long long int MOD = 998244353;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> H >> W;
	cin >> N >> M;
	if (N * 2 == H && M * 2 == W) {
		cout << H * W / 2 << " " << 1 << endl;
	}
	else {
		double ans = H * W;
		ans /= 2;
		cout << ans << " " << 0 << endl;
	}
}

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

#define ul unsigned long int
#define ull unsigned long long
#define li long long int


int main()
{
  ul s;
  cin>>s;

  ul h,m;
  h=s/3600;
  s%=3600;
  m=s/60;
  s%=60;

  cout << h<<":"<<m <<":"<<s<< endl;
  return 0;
}



Measured memory_bytes: 3096
def main():
  N, K = map(int, input().split())
  if N % 2 == 0:
    X = N / 2
    if X >= K:
      print('YES')
    else:
      print('NO')
  else:
    X = (N + 1)/2
    if X >= K:
      print('YES')
    else:
      print('NO')
main()

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define int long long
#define N 100010
using namespace std;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}


signed main(){
  string str;
  cin>>str;
  sort(str.begin(),str.end());
  vector<int> cnt(3,0);
  for(char ch:str) cnt[ch-'a']++;
  sort(cnt.begin(),cnt.end());
  //  cout<<cnt[0]<<" "<<cnt[1]<<" "<<cnt[2]<<endl;
  if(max(cnt[0],max(cnt[1],cnt[2])) - min(cnt[0],min(cnt[1],cnt[2])) >=2){
    cout<<"NO"<<endl;
    return 0;
  }
  cout<<"YES"<<endl;
  
    

  return 0;
}


Measured memory_bytes: 512
# D - FT Robot

import copy

s = input()
x, y = map(int, input().split())

f = [len(x) for x in s.split("T")]
x -= f[0]
fx = f[2::2]
fy = f[1::2]

x_possible_set = set([0])
for dx in fx:
    tmp = set()
    for current_x in x_possible_set:
        tmp.add(current_x + dx)
        tmp.add(current_x - dx)
    x_possible_set = tmp.copy()

y_possible_set = set([0])
for dy in fy:
    tmp = set()
    for current_y in y_possible_set:
        tmp.add(current_y + dy)
        tmp.add(current_y - dy)
    y_possible_set = tmp.copy()

print("Yes" if x in x_possible_set and y in y_possible_set else "No")

Measured memory_bytes: 4612
#include <iostream>
#include <cstring>
using namespace std;
int main ()
{
	string a;
	cin>>a;
	for (int i=0; i<a.size(); i++)
	{
		if (a[i]=='C')
		{
			for (int j=i; j<a.size(); j++)
			{
				if (a[j]=='F')
				{
					cout<<"Yes";
					return 0;	
				}
			}
		}
	}
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
int fac(int n){
 return n%2;
}
int main(){
 int n;
 scanf("%d",&n);
 int cnt = 0;
 for(int i=0;i<n;i++){
  int t;
  scanf("%d",&t);
  if(fac(i+1)&&fac(t)){
   cnt++;
  }
 }
 printf("%d",cnt);
}

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

typedef uint64_t u64;
typedef int64_t i64;
typedef uint32_t u32;
typedef int32_t i32;

#define MAX_NUM (1000000000 + 7)

using namespace std;

template <typename T>
static inline void ArrayInput(vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr;
}

template <typename T>
static inline void ArrayPut(const vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cout << *itr << " ";
  cout << endl;
}

template <typename T>
static inline T ArraySum(vector<T>& A) {
  T res = 0;
  for (auto itr = A.begin(); itr < A.end(); ++itr) res += *itr;
  return res;
}

bool Sec_compare(pair<uint64_t, uint64_t> a, pair<uint64_t, uint64_t> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

u64 dec_dig(u64 num) {
  u64 res = 0;
  while (num > 0) {
    num /= 10;
    ++res;
  }
  return res;
}

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

u64 gcd(u64 a, u64 b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }

  return b ? gcd(b, a % b) : a;
}

u64 My_Combination(u64 n, u64 k, i64 m) {
  if (n < k) return 0;
  if (k == 0 || n == k) return 1;
  u64 res = 1;
  k = (n / 2 < k) ? n - k : k;
  for (u64 i = 1; i <= k; ++i)
    res = (((res * (n + 1 - i)) % m) * modinv(i, m)) % m;
  return res;
}

u64 My_Pow(u64 a, u64 n, i64 m) {
  u64 tmp = n, calc = 1;
  while (tmp > 0) {
    if (tmp % 2) {
      tmp--;
      calc *= a;
      calc %= m;
    } else {
      a *= a;
      a %= m;
      tmp /= 2;
    }
  }
  return calc;
}

int main() {
  cout << setprecision(18);
  u64 n, a, b;
  cin >> n >> a >> b;
  i64 res = My_Pow(2, n, MAX_NUM);
  i64 calc = My_Combination(n, a, MAX_NUM) + My_Combination(n, b, MAX_NUM) + 1;
  res -= calc % MAX_NUM;
  if (res < 0) res += MAX_NUM;
  cout << res << endl;
  return 0;
}


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

    typedef long long int ll;
    #define pb         push_back
    #define mp         make_pair
    #define F          first
    #define S          second
    #define fl(i,a,b)  for(ll i=a;i<b;i++)
    #define pll        pair<ll,ll>
    #define pii        pair<int,int>
    #define all(v)     v.begin(),v.end()
    #define M 1000000007
    #define tr(v, it) for(auto it = v.begin(); it != v.end(); it++)
    using namespace std;



    int main()
    {

        ios_base::sync_with_stdio(false);
    	cin.tie(NULL);

          int n;
          cin>>n;
          int arr[n][3];
          for(int i=0; i<n; i++)
            for(int j=0; j<3; j++)
                cin>>arr[i][j];

          int dp[n][3];
          for(int i=0;i<3; i++)
            dp[0][i]=arr[0][i];
          for(int i=1; i<n; i++)
          {
             dp[i][0]=max(dp[i-1][1],dp[i-1][2])+arr[i][0];
             dp[i][1]=max(dp[i-1][0],dp[i-1][2])+arr[i][1];
             dp[i][2]=max(dp[i-1][0],dp[i-1][1])+arr[i][2];
          }
          int result = max(dp[n-1][0],dp[n-1][1]);
          result = max(result, dp[n-1][2]);

          cout<<result;
       return 0;
    }


Measured memory_bytes: 5952
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a[3],ans=0,n=0;
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3,greater<int>());

	n=a[0]-a[1];
	n=n/2;
	ans=ans+n;
	a[1]=a[1]+(n*2);
	
	n=a[0]-a[2];
	n=n/2;
	ans=ans+n;
	a[2]=a[2]+(n*2);
	
	sort(a,a+3,greater<int>());
	if(a[0]!=a[1]) ans++;
	else if(a[0]!=a[2]) ans=ans+2;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;

int main() {
    int64_t N, ans = 0;
    cin >> N;
    vector<int64_t> A(N), B(N), C(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }
    for (int i = 0; i < N; i++) {
        cin >> B.at(i);
    }
    for (int i = 0; i < N; i++) {
        cin >> C.at(i);
    }
    sort(ALL(A));
    sort(ALL(B));
    sort(ALL(C));
    for (int i = 0; i < N; i++) {
        int64_t a = lower_bound(ALL(A), B.at(i)) - A.begin();
        int64_t c = N - (upper_bound(ALL(C), B.at(i)) - C.begin());
        ans += a * c;
    }
    cout << ans << endl;

}


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

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    vector<int> v,oddv;
    for(ll i=1;;i++){
        if(i*(i+1)*(i+2)/6<=2000000){
            v.pb(i*(i+1)*(i+2)/6);
        }
        else break;
    }
    int ans1[1000010],ans2[1000010];
    rep(i,0,1000010) ans1[i]=ans2[i]=INF;
    ans1[0]=0; ans2[0]=0;
    rep(i,0,1000000){
        ans1[i]=i; ans2[i]=i;
        for(int j=0;i>=v[j];j++){
            ans1[i]=min(ans1[i-v[j]]+1,ans1[i]);
            if(v[j]%2==1)ans2[i]=min(ans2[i],ans2[i-v[j]]+1);
        }
    }

    int n;
    while(cin>>n&&n){
        cout<<ans1[n]<<" "<<ans2[n]<<endl;
    }
    
    return 0;
}



Measured memory_bytes: 10928
# ABC115C - Christmas Eve
import sys
input = sys.stdin.readline

def main():
    n, k = list(map(int, input().rstrip().split()))
    lst = sorted(list(map(int, [input().rstrip() for _ in range(n)])))
    ans = lst[k - 1] - lst[0]
    for i, j in zip(lst, lst[k - 1 :]):
        ans = min(ans, j - i)
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 14236
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  int N, K;
  cin >> N >> K;

  int sum = 0;
  vector<int> A(N);
  REP(i, N){
    cin >> A[i];
    sum += A[i];
  }

  int ans = 1;

  auto f = [&](int x){
    vector<int> v;
    REP(i, N){
      v.emplace_back(A[i]%x);
    }
    sort(ALL(v));

    int N = v.size();
    vector<int> B(N+1, 0);
    REP(i, N) B[i+1] += B[i]+v[i];

    REP(i, N){
      if(B[i] == x*(N-i)-(B[N]-B[i]) && B[i] <= K){
        chmax(ans, x);
        return;
      }
    }
  };
  

  for(int i = 1; i*i <= sum; i++){
    if(sum%i == 0){
      f(i);
      if(i*i != sum) f(sum/i);
    }
  }

  cout << ans << "\n";

  return 0;
}


Measured memory_bytes: 256
a,b,c,d,e,f = map(int,input().split())
rw = rs = 0
conc = 0.0
s = set()
t = set()
for ai in range(30):
    for bi in range(15):
        wat = 100*(a*ai+b*bi)
        if wat > f: continue
        if wat in s:
            continue
        else:
            s.add(wat)
for ci in range(3000):
    for di in range(1500):
        sug = c*ci+d*di
        if sug > f: continue
        if sug in t:
            continue
        else:
            t.add(sug)
for w in s:
    if w == 0: continue
    for x in t:
        if w+x <= f and x/w <= 0.01*e:
            if conc < (100*x)/(x+w):
                conc = (100*x)/(x+w)
                rw = w; rs = x
if rs == 0 and rw == 0: rw = a*100
print(rw+rs,rs)


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

using namespace std;

bool comp(const string& lh, const string& rh)
{
    return lh.length() < rh.length();
}

void _097c()
{
    string s;
    int k;
    set<string> lst;
    vector<string> v;
    
    cin >> s;
    cin >> k;
    
    for (int i = 0; i < s.length(); i++) {
        for (int j = i + 1; j <= i + 1 + k; j++) {
            lst.insert(s.substr(i, j - i));
        }
    }

    set<string>::iterator p = lst.begin();
    while (p != lst.end()) {
        v.push_back(*p);
        //cout << *p << endl;
        p++;
    }
    
    sort(v.begin(), v.end(), greater<string>());
    
    cout << v[v.size() - k] << endl;
}

int main()
{
    _097c();
    return 0;
}

Measured memory_bytes: 2560
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define divup(a,b) ( ( (a) + ( (b) - 1u) ) / (b) ) // a/b の余り切り上げ
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
ll mod = 1000000007;
ll mod9 = 1000000009;

signed main(){
    ll n,m;
    cin>>n>>m;
    ll ans = n;
    rep(i,m){
        ll a;
        cin>>a;
        ans -= a;
    }
    if(ans < 0) ans = -1;
    cout<<ans<<endl;
}


Measured memory_bytes: 3632
#include <stdio.h>

int main(void)
{
	int n,k,i,ans=1;
	scanf("%d %d",&n,&k);
	
	for(i=1;i<=n;i++){
		if(ans*2>=ans+k){
			ans+=k;
		} else{
			ans*=2;
		}
	}
	
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
s = input()
n = len(s)
K = int(input())

chars = sorted(set(s))
lexicon = []

def next_word(cur):
    lexicon.append(cur)
    if len(lexicon) < K:
        for next_c in chars:
            next_w = cur + next_c
            if next_w in s:
                return next_word(next_w)

for char in chars:
    next_word(char)

print(lexicon[K-1])

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

int main(){
    bool flag=true;
    int ans=0,sum=0;
    int n;
    cin >>n;
    int a[n],row=0;

    cin >>a[0];
    for (int i = 1; i < n; i++){
        cin >> a[i];

        if(a[i-1] >= a[i]){
            row++;
        }else{
            row=0;
        }

        ans = max(row,ans);
    }
    


    //cout <<fixed<<setprecision(16)<< << endl;
    cout << ans << endl;

    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


Measured memory_bytes: 640
n = int(input())
c = [0] * (n-1)
s = [0] * (n-1)
f = [0] * (n-1)
ans = [0] * n
for i in range(n-1):
    c[i],s[i],f[i] = map(int,input().split())

for i in range(n-1):
    now = c[i] + s[i]
    for j in range(i+1,n-1):
        if now <= s[j]:
            now = s[j]
        elif now % f[j] != 0:
            now = (now//f[j]+1) * f[j]
        now += c[j]
    print(now)
print(0)
        


Measured memory_bytes: 42604
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		int tmp = 0;
		int ans = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == 'A' || c[i] == 'C' || c[i] == 'G' || c[i] == 'T') {
				tmp++;
			} else {
				ans = Math.max(ans, tmp);
				tmp = 0;
			}
		}
		ans = Math.max(ans, tmp);
		System.out.println(ans);
		sc.close();
	}
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
 
using namespace std;
 
void load(void);
void calc(void);
void output(void);

int N, C[4] = {0, 0, 0, 0};

int main(){
	load();
	output();
	return 0;
}
 
void load(void){
	int i;
	string S;
	cin >> N;
	for(i = 0;i < N;i++){
		cin >> S;
		if(S == "AC"){
			C[0]++;
		}else if(S == "WA"){
			C[1]++;
		}else if(S == "TLE"){
			C[2]++;
		}else if(S == "RE"){
			C[3]++;
		}
	}
}
 
void output(void){
	cout << "AC x " << C[0] << endl;
	cout << "WA x " << C[1] << endl;
	cout << "TLE x " << C[2] << endl;
	cout << "RE x " << C[3] << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define per(i,a,b) for(ll i=b-1;i>=a;i--)
const ll maxn=3e3+5;
ll n,a[maxn],dp[maxn][maxn];
int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>n;
    rep(i,0,n) cin>>a[i];
    rep(r,0,n) {
        dp[r][r]=a[r];
        per(l,0,r)
           dp[l][r]=max(a[r]-dp[l][r-1], a[l]-dp[l+1][r]);
    }
    cout<<dp[0][n-1]<<"\n";
}

Measured memory_bytes: 70016
#include<iostream>
#include<stdio.h>
#include<queue>
#include<stack>
#include<algorithm>
#include<string.h>
#include<string>
#include<math.h>
using namespace std;
long long n,a;
int main(){
    cin>>n>>a;
    long long x=n*n;
    cout<<x-a;
}

Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))
r = sum(A)-A[0]
l = A[0]
ans = abs(r-l)
for i in range(1,len(A)-1):
    r -= A[i]
    l += A[i]
    ans = min(ans, abs(l-r))
print(ans)

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

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

int main() {

    ll n; cin >> n;

    vector<ll> a(n);
    for (ll i = 0; i < n; ++i) {
        cin >> a[i];
    }

    vector<ll> b(n);
    for (ll i = 0; i < n; ++i) {
        b[i] = a[i] - (i+1);
    }

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

    ll t = b[n/2];

    ll ans = 0;
    for (ll i = 0; i < n; ++i) {
        ans += abs(b[i] - t);
    }

    cout << ans << endl;
}

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

typedef long long ll;
typedef double db;

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

const ll LINF = LLONG_MAX, MOD = 1e9 + 7, N = 1e5 + 5, LG = 20;
const int INF = INT_MAX;
const db PI = acos(-1), EPS = 1 / db(1e6);

void test() {
    int x, y; cin >> x >> y;
    int n = y - 2 * x, m = 4 * x - y;
    if ((n >= 0 and n % 2 == 0) and (m >= 0 and m % 2 == 0)) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
}

int main() {
      fast_io();
      #ifdef HOME
            freopen("input.txt", "r", stdin);
            freopen("output.txt", "w", stdout);
      #endif
      cout << fixed << setprecision(15);
      int t = 1;
      // cin >> t;
      for (int i = 1; i <= t; ++i) {
          test();
      }
      #ifdef HOME
          cout << "Time: " << (int)(clock() * 1000. / CLOCKS_PER_SEC) << "ms";
      #endif
      return 0;
}


Measured memory_bytes: 3608
function Main(input){
	var A = parseInt(input.trim().split(" ")[0],10);
  	var B = parseInt(input.trim().split(" ")[1],10);
  	var min = 0;
 	var MAX = 1000;
  	var res = [];
  	for(var i = 1;i<=MAX;i++){
      	var x1 = Math.floor(i*0.08);
      	var x2 = Math.floor(i*0.1);
    	if(x1 == A && x2 == B)res.push(i);
    }
  	if(res.length == 0){
    	console.log(-1);
    }else{
    	console.log(Math.min(...res));
    }
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));

Measured memory_bytes: 7500
package main

import "fmt"

func main() {
	var x int
	fmt.Scan(&x)
	for a := -200; a < 200; a++ {
		for b := -200; b < 200; b++ {
			fiveA := a * a * a * a * a
			fiveB := b * b * b * b * b
			if fiveA-fiveB == x {
				fmt.Printf("%v %v", a, b)
				return
			}
		}
	}
}


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

int main()
{
    ll n, l[2000], ans = 0;
    cin >> n;
    rep(i, n) cin >> l[i];
    sort(l, l + n);

    for (int i = 0; i < n - 2; i++)
    {
        for (int j = i + 1; j < n - 1; j++)
        {
            for (int k = j + 1; k < n; k++)
            {
                if (l[k] < l[i] + l[j])
                {
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3664
#include<cstdio>
#define MAXN 50
char Pi[MAXN+5][MAXN+5];
bool B[MAXN+5][MAXN+5],flag;
int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i=1;i<=n;i++){
		getchar();
		for(int j=1;j<=m;j++){
			scanf("%c",&Pi[i][j]);
			if(Pi[i][j]=='#'){	
				B[i-1][j]=true;
				B[i][j-1]=true;
				if(Pi[i-1][j]=='#'||Pi[i][j-1]=='#')
					B[i][j]=true;
			}
		}
	}
	for(int i=1;i<=n;i++){
		if(flag) break;
		for(int j=1;j<=m;j++)
			if(Pi[i][j]=='#'&&!B[i][j]){
				flag=true;
				break;
			}
	}
	if(!flag) printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;

//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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; }
#define rep(i, n)         for(ll i = 0; i < (ll)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(ll i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define RES(a,i,j) a.resize(i);rep(ii,i)a[ii].resize(j); 
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout<<a<<" "<<b<<" "<<c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 
#define gre(n) greater<n>()

typedef long long ll;
//
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
const int INF = 1000000000;
const double dINF = 1000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
//const ll MOD = 998244353ll;
const dou pi=3.141592653589793*2;

int main(){
    ll a,b;
    std::cin >> a>>b;
    if(a*b<=0){
        std::cout << "Zero" << std::endl;
    }
    else if(a<0){
        if((b-a+1)%2==1)std::cout << "Negative" << std::endl;
        else std::cout << "Positive" << std::endl;
    }
    else std::cout << "Positive" << std::endl;
}

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end())
#define vdelete(v) (v).erase(unique(all(v)), (v).end())
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF 9223372036854775807

int a,b,c;

signed main() {
    cin >> a >> b >> c;
    if (a>b) swap(a,b);
    if (a < c && c < b) cout << "Yes" << endl;
    else cout << "No" << endl;
}












Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<string>
#define ll long long
#define dd double
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	ll t1 = (s[0] - '0') * 10 + (s[1] - '0');
	ll t2 = (s[2] - '0') * 10 + (s[3] - '0');
	if (t1 == 0 || t2 == 0) {
		if (t1 == 0) {
			if (t2 >= 1 && t2 <= 12) {
				cout << "YYMM" << endl;
			}
			else {
				cout << "NA" << endl;
			}
		}
		else {
			if (t1 >= 1 && t1 <= 12) {
				cout << "MMYY" << endl;
			}
			else {
				cout << "NA" << endl;
			}
		}
	}
	else if (t1 >= 1 && t1 <= 12) {
		if (t2 >= 1 && t2 <= 12) {
			cout << "AMBIGUOUS" << endl;
		}
		else {
			cout << "MMYY" << endl;
		}
	}
	else if (t1 > 12) {
		if (t2 >= 1 && t2 <= 12) {
			cout << "YYMM" << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, q;
  cin >> n;
  vector<int> s(n);
  rep(i, 0, n) cin >> s.at(i);
  cin >> q;
  vector<int> t(q);
  rep(i, 0, q) cin >> t.at(i);
  
  int ans = 0;
  
  rep(j, 0, q) {
    rep(i, 0, s.size()) {
      if(t.at(j) == s.at(i)) {
        ans++;
        break;
      }
    }
  }    
  
  cout << ans << "\n";

}



Measured memory_bytes: 3168
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

int h, w, n;
int sy, sx;
int dy[4] = {-1, 0, 1, 0};
int dx[4] = { 0, 1, 0, -1};
string s, t;
string dir = "URDL";
bool contain(int y, int x){
   return (0 <= y && y < h && 0 <= x && x < w);
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> h >> w >> n >> sy >> sx >> s >> t;
    sy--; sx--;
    int x = sx;
    bool f = false;
    // right
    rep(i, 0, n){
        if(s[i] == 'R') x++;
        if(x >= w) f = true;
        if(t[i] == 'L') x--;
        x = max(0LL, x);
    }
    x = sx;
    // left
    rep(i, 0, n){
        if(s[i] == 'L') x--;
        if(x < 0) f = true;
        if(t[i] == 'R') x++;
        x = min(w - 1, x);
    }
    // up
    int y = sy;
    rep(i, 0, n){
        if(s[i] == 'U') y--;
        if(y < 0) f = true;
        if(t[i] == 'D') y++;
        y = min(h - 1, y);
    }
    y = sy;
    // down
    rep(i, 0, n){
        if(s[i] == 'D') y++;
        if(y >= h) f = true;
        if(t[i] == 'U') y--;
        y = max(0LL, y);
    }
    if(!f) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 920
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define  ll  long long
#define  pii pair<int,int>
#define  pll pair<ll , ll>
#define  debug cout << "this far" << endl;
#define  For(i, n) for(int i = 0; i < (n); ++i)
#define  lsb(x) ((x) & (-x))
#define  PI acos(-1)
#define  line cout << endl;
#define  getbit(n, i) (((n) & (1LL << (i))) != 0)
#define  resetbit(n, i) ((n) & (~(1LL << (i))))
#define  setbit(n, i) ((n) | (1LL << (i)))
#define  togglebit(n, i) ((n) ^ (1LL << (i)))
#define  gap " "
#define  ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace __gnu_pbds;
using namespace std;
const int N = 5e5 + 4;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n ; cin >> n ;
    string s ; cin >> s;
    int r = 0 , w = 0 ;
    for(auto i : s) {
        i == 'R' ? ++ r : ++w ;
    }
    string  t ;
    while (r--) t.push_back('R') ;
    while (w--) t.push_back('W') ;
    int x = 0 , y = 0  ;
    for(int i = 0 ; i < n ; ++i ) {
        if(s[i] == 'R' && t[i] == 'W') ++x ;
        else if(s[i] == 'W' && t[i] == 'R') ++y ;
    }
    int ans = min(x ,y) ;
    x -= ans;
    y -= ans  ;
    cout << ans + x + y << endl ;

}

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

int main() {
	int n; cin >> n;
	int a[n]; for(int i = 0; i < n; ++i) cin >> a[i];
	set<int> st;
	for(int i = 0; i < n; ++i) {
		int tmp = a[i];
		for(int j = 2; j * j <= tmp; ++j) {
			while(tmp % j == 0) {
				st.insert(j);
				st.insert(tmp / j);
				tmp /= j;
			}
		}
		st.insert(tmp);
	}
	int64_t ans = 0;
	for(int k : st) {
		if(k < 2) continue;
		int64_t tmp = 0;
		for(int i = 0; i < n; ++i) {
			if(a[i] % k == 0) tmp += a[i];
		}
		ans = max(ans, tmp);
	}
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 3268
#include<bits/stdc++.h>
using namespace std;
int a[4],b[4];
int k[5],c[5];

int main(){
	for(int i=1;i<=3;i++) cin>>a[i]>>b[i],k[a[i]]++,k[b[i]]++;
	for(int i=1;i<=4;i++) c[k[i]]++;
	if(c[1]==2&&c[2]==2) cout<<"YES\n";
	else cout<<"NO\n";
	
	return 0;
}

Measured memory_bytes: 256
N = int(input())

dp_table = [[0] * N for j in range(3)]

a, b, c = map(int, input().split())
dp_table[0][0] = a
dp_table[1][0] = b
dp_table[2][0] = c

for i in range(1, N):
    a, b, c = map(int, input().split())
    dp_table[0][i] = max(dp_table[1][i-1] + a, dp_table[2][i-1] + a)
    dp_table[1][i] = max(dp_table[0][i-1] + b, dp_table[2][i-1] + b)
    dp_table[2][i] = max(dp_table[0][i-1] + c, dp_table[1][i-1] + c)

print(max(dp_table[0][N-1], dp_table[1][N-1], dp_table[2][N-1]))


Measured memory_bytes: 20792
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;

public class Main {
	static int v = 0;
	static List<List<Integer>> ansList = null;

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		char[] s = br.readLine().toCharArray();
		br.close();

		int[] cnt = new int[3];
		for (int i = 0; i < s.length; i++) {
			cnt[s[i] - 'a']++;
		}

		int limit = (s.length + 2) / 3;
		for (int i : cnt) {
			if (i > limit) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    int k;
    cin >> n >> k;
    vector<int> a;
    int count = 0;
    for(int i=0; i < n; i++){
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }
    int l = n -1;
    int r = k -1;
    while(l > 0){
       l = l - r;
       count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 892
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

# define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<vs> vvs;


typedef vector<pair<int, int>> vpi;
typedef vector<tuple<int, int, int>> vti;


int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int n, l;
    cin >> n >> l;
    vi a(n);
    int min_val = 100;
    int ans = 0;
    rep(i, n){
        a[i] = l + i;
        ans += a[i];
        if (abs(a[i]) < abs(min_val)){
            min_val = a[i];
        }
    }
    cout << ans - min_val << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

const int INF = INT_MAX / 4;

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

	while ( true )
	{
		int n, m;
		cin >> n >> m;

		if ( !( n | m ) )
		{
			break;
		}

		VVI Gl( n, VI( n, INF ) ), Gs = Gl;

		REP( i, 0, n )
		{
			Gl[i][i] = Gs[i][i] = 0;
		}

		REP( i, 0, m )
		{
			int v, u, c;
			char t;

			cin >> v >> u >> c >> t;

			v--;
			u--;

			switch ( t )
			{
				case 'L':
					Gl[v][u] = Gl[u][v] = c;
					break;
				case 'S':
					Gs[v][u] = Gs[u][v] = c;
					break;
			}
		}

		REP( k, 0, n )
		{
			REP( i, 0, n )
			{
				REP( j, 0, n )
				{
					Gl[i][j] = min( Gl[i][j], Gl[i][k] + Gl[k][j] );
					Gs[i][j] = min( Gs[i][j], Gs[i][k] + Gs[k][j] );
				}
			}
		}

		int r;
		cin >> r;

		VI zs( r );

		EACH( z, zs )
		{
			cin >> z;
			z--;
		}

		VVI dp( r, VI( n, INF ) );
		dp[0][ zs[0] ] = 0;

		REP( i, 0, dp.size() - 1 )
		{
			REP( j, 0, dp[i].size() )
			{
				if ( dp[i][j] == INF )
				{
					continue;
				}

				dp[ i + 1 ][j] = min( dp[ i + 1 ][j], dp[i][j] + Gl[ zs[i] ][ zs[ i + 1 ] ] );

				REP( k, 0, n )
				{
					int &next = dp[ i + 1 ][k];

					next = min( next, dp[i][j] + Gl[ zs[i] ][j] + Gs[j][k] + Gl[k][ zs[ i + 1 ] ] );
				}
			}
		}

		cout << *min_element( ALL( dp.back() ) ) << endl;
	}

	return 0;
}

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

#include <vector>
using namespace std;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)

typedef long long ll;

int main() {
    int N;
    cin >> N;
    vector<ll> x(N);
    vector<ll> y(N);
    rep(i, N) {
        ll a, b;
        cin >> a >> b;
        x[i] = a - b;
        y[i] = a + b;
    }

    ll xmin = 1e10;
    ll xmax = -1e10;
    ll ymin = 1e10;
    ll ymax = -1e10;
    rep(i, N) {
        xmin = min(xmin, x[i]);
        xmax = max(xmax, x[i]);
        ymin = min(ymin, y[i]);
        ymax = max(ymax, y[i]);
    }

    ll xdiff = xmax - xmin;
    ll ydiff = ymax - ymin;

    ll ans = max(xdiff, ydiff);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 6432
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	n=n%10;
	if(n==3)cout<<"bon"<<endl;
	else if(n==0||n==1||n==6||n==8)cout<<"pon"<<endl;
	else cout<<"hon"<<endl;
	return 0;
}


Measured memory_bytes: 3632
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	m := make(map[string]bool, n)

	var x string
	for i := 0; i < n; i++ {
		fmt.Scan(&x)
		m[x] = true
	}

	if len(m) == 3{
		fmt.Println("Three")
	} else {
		fmt.Println("Four")
	}
}


Measured memory_bytes: 512
import java.util.Scanner;


public class Main {

	Scanner sc;
	
	int ni(){
		return sc.nextInt();
	}
	
	final int INF=1<<30;
	
	int solve(int h[], int n){
		for(int skip=0;skip<=n;++skip){
			int diff=INF, dh=INF, prev=INF;
			boolean ac=true;
			for(int i=0;i<=n;++i){
				if(i==skip) continue;
				
				if(prev!=INF){
					if(diff==INF){
						diff=prev-h[i];
					}
					else{
						dh=prev-h[i];
						if(dh!=diff){
							ac=false;
							break;
						}
					}
				}
				prev=h[i];
			}
			if(ac) return h[skip];
		}
		return -1;
	}
	
	void io(){
		int n;
		sc=new Scanner(System.in);
		
		while((n=ni())!=0){
			int h[]=new int[n+1];
			for(int i=0;i<n+1;++i){
				h[i]=ni();
			}
			System.out.println(solve(h, n));
		}
		sc.close();
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Main().io();
	}

}

Measured memory_bytes: 35712
#pragma GCC optimize("Ofast")   //Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  foo(i,a,n)     for(ll i = (a); i <= n; i++)
#define  frr(i,a,n)     for(ll i = (a); i >= n; i--)
#define  fo(i,n)        for(ll i = 0; i < n; i++)
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  newl           cout<<"\n"
#define  pb             push_back
#define  mp             make_pair
#define  s              second
#define  f              first
#define  dline          cerr<<"///REACHED///\n";
#define  deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define  deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define  deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   MAXN  =  1e+5+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

//<<-----Declare Variable Here------->>//
int t=1;
ll n;
ld a,b;
//<<-----Implement Functions Here---->>//


//<<-----Start of Main--------------->>//
void MAIN(){
		cin>>a>>b;
		cout<<ll((ld)a*(ld)b);
}		

int main(){
	fastio;randomINIT;

	//cin>>t;
	while(t--){
		MAIN();
	}

    
}

Measured memory_bytes: 6096
import java.util.*;
public class Main{
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  int n = sc.nextInt();
	  int[] a = new int[n];
	  for(int i=0;i<n;i++){
	  	a[sc.nextInt()-1]=i+1;
	  }
	  for(int i=0;i<n;i++){
	  	System.out.print(a[i] + " ");
	  }
	}
}

Measured memory_bytes: 60284
n = int(input())
l = [0] * 3
for i in map(int,input().split()):
  if i % 4 == 0:
    l[0] += 1
  elif i % 2 == 0:
    l[1] += 1
  else:
    l[2] += 1
if l[1] == 0:
  if l[0]+1 >= l[2]:
    print('Yes')
  else:
    print('No')
else:
  if l[0] >= l[2]:
    print('Yes')
  else:
    print('No')

Measured memory_bytes: 62704
#include <bits/stdc++.h>
using namespace std;
 
const int maxn = 1e5 + 7;
struct Point {
  int first, second, id;
} ;
Point d[maxn], o[maxn], Data[maxn];
 
bool cmp1(const Point &a, const Point &b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
 
bool cmp2(const Point &a, const Point &b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
 
bool used[maxn];
int dist(int inx, int cur) {
  if (cur >= Data[inx].first && cur <= Data[inx].second) return 0;
  if (cur < Data[inx].first) return Data[inx].first - cur;
  return cur - Data[inx].second;
}
 
int n;
long long work() {
  int t = n, h = 1;
  if (d[t].first < 0) return 0;
  for (int i = 1; i <= n; i++) used[i] = false;
  int cur = 0;
  long long rt = 0;
  for (int i = 1; i <= n; i++) {
    while (used[ d[t].id ]) t--;
    while (used[ o[h].id ]) h++;
    if (i & 1) {
      if (d[t].first >= cur) {
        rt += d[t].first - cur;
        used[ d[t].id ] = true;
        cur = d[t].first;
      }
      else break;
    }
    else {
      if (o[h].second <= cur) {
        rt += cur - o[h].second;
        used[ o[h].id ] = true;
        cur = o[h].second;
      }
      else break;
    }
  }
  return abs(cur) + rt;
}

int main(int argc, char **argv) {
  scanf("%d", &n);
 
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &d[i].first, &d[i].second);
    d[i].id = i;
    o[i] = d[i];
    Data[i] = d[i];
  }
  sort(d + 1, d + n + 1, cmp1);
  sort(o + 1, o + n + 1, cmp2);
  long long ans = work();
  for (int i = 1; i <= n; i++) {
    swap(o[i].first, o[i].second);
    o[i].first = -o[i].first;
    o[i].second = -o[i].second;
    swap(d[i].first, d[i].second);
    d[i].first = -d[i].first;
    d[i].second = -d[i].second;
  }
  sort(d + 1, d + n + 1, cmp1);
  sort(o + 1, o + n + 1, cmp2);
  ans = max(work(), ans);
 
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3968
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100000;

int main() {
	int n;
	cin >> n;
	int d[N];
	rep(i, n) cin >> d[i];
	sort(d, d + n);
	cout << d[n / 2] - d[n / 2 - 1] << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <utility>
#include <cmath>
#include <iomanip>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

typedef long long lint;
typedef pair<int,int> P;

int main()
{

    int N,M;
    cin >> N >> M;

    vector<int> A;
    vector<int> B;
    vector<P> AB;

    int a,b;
    REP(i,N){
    	cin >> a >> b;
    	A.push_back(a);
    	B.push_back(b);
    	AB.push_back(P(a,b));
    }

    sort(ALL(AB));

    lint ans=0;
    int num=0;
    REP(i,N){
    	REP(j,AB[i].second){
    		ans+=AB[i].first;
    		num++;

    		if(num==M) break;
    	}
    	if(num==M) break;
    }



    cout << ans << endl;

}


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

typedef long long lint;
typedef pair<int, int> P;
#define REP(i, x, n) for(lint i = x ; i < n ; i++)
#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for(lint i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())

const int IINF = 1e9 + 10;
const lint LLINF = (lint)1e18 + 10;
const lint MOD = (lint)1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    lint n;
    cin >> n;
    vector<lint> a(n*3);
    rep(i, n*3){
        cin >> a[i];
    }

    priority_queue< lint, vector<lint>, greater<lint> > left;
    priority_queue<lint> right;
    lint lsum = 0, rsum = 0;

    rep(i, n){
        lsum += a[i];
        left.push(a[i]);
        rsum += a[n*3-i-1];
        right.push(a[n*3-i-1]);
    }

    vector<lint> l(n+1), r(n+1);
    l[0] = lsum;
    r[n] = rsum;

    REP(i, n, n*2){

        lsum += a[i];
        left.push(a[i]);
        lsum -= left.top();
        left.pop();
        l[i-n+1] = lsum;

        rsum += a[n*3-i-1];
        right.push(a[n*3-i-1]);
        rsum -= right.top();
        right.pop();
        r[n*2-i-1] = rsum;
        
    }

    lint ans = -LLINF;

    rep(i, n+1){
        ans = max(ans, l[i] - r[i]);
    }

    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 5996
N, X, M = map(int, input().split())
count_memo = [-1] * 10**6 # 回数のメモ
num_memo = [0] #1インデックスるにする

a = X
count = 1
count_memo[a] = count
num_memo.append(a)
for i in range(1, N):
    a = a**2 % M
    if count_memo[a] == -1:
        count += 1
        count_memo[a] = count
        num_memo.append(a)
    else:
        break

if count == N:
    answer = sum(num_memo)
else:
    # 周期に入るまでの回数と合計
    count_before_cycle = count_memo[a] - 1
    sum_before_cycle = sum(num_memo[:count_before_cycle+1])
    # 1周期の数と合計
    count_cycle = count - count_before_cycle
    sum_cycle = sum(num_memo[count_before_cycle+1:])
    # 残りのサイクルの数と合計
    cycle_count = (N - count) // count_cycle
    sum_after_cycle = sum_cycle * cycle_count
    # あまりの数と合計
    remain_count =  (N - count) % count_cycle
    sum_remain = sum(num_memo[count_before_cycle+1:count_before_cycle+1 + remain_count])

    answer = sum_before_cycle + sum_cycle + sum_after_cycle + sum_remain

print(answer)



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

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
    ll n;
    cin>>n;
    n%=26;
	string a;
	cin>>a;
    for(auto i=0;i<a.size();++i)
    {
        a[i]='A'+((a[i]-'A')+n)%26;
    }
    cout<<a;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9 + 7;
const int maxn = 2001005;

void go() {
	string s;
	cin >> s;
	int n = s.size();
	s = " " + s;
	ll dp[n + 5][3] = {};
	ll mul = 1;
	f1(n) {
		if (s[i] == 'A') {
			(dp[i][0] = dp[i - 1][0] + mul) % mod;
			dp[i][1] = dp[i - 1][1];
			dp[i][2] = dp[i - 1][2];
		}
		if (s[i] == 'B') {
			dp[i][1] = (dp[i - 1][1] + dp[i - 1][0]) % mod;
			dp[i][0] = dp[i - 1][0];
			dp[i][2] = dp[i - 1][2];
		}
		if (s[i] == 'C') {
			dp[i][2] = (dp[i - 1][2] + dp[i - 1][1]) % mod;
			dp[i][0] = dp[i - 1][0];
			dp[i][1] = dp[i - 1][1];
		}
		if (s[i] == '?') {
			dp[i][0] = (dp[i - 1][0] * 3 + mul) % mod;
			dp[i][1] = (dp[i - 1][1] * 3 + dp[i - 1][0]) % mod;
			dp[i][2] = (dp[i - 1][2] * 3 + dp[i - 1][1]) % mod;
			mul *= 3;
			mul %= mod;
		}
	}
	cout << dp[n][2] << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        go();
    }
    
}

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

void solveA(){
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  sort(a.begin(),a.end(),greater<int>());

  cout << a[0]*10+a[1]+a[2] << endl;  
}
void solveB(){ 
}

void solveC(){
}
void solveD(){
}

int main(){
  solveA();
}

Measured memory_bytes: 256