akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>


#define REP(i,N) for(auto i = 0; i <N; i++)
using namespace std;
typedef long long ll;


int in(){
    int temp;
    scanf("%d",&temp);
    return temp;
}

ll lin(){
    ll temp;
    scanf("%lld",&temp);
    return temp;
}


int look_site(int i, int j, int H, int W){
    
    if (i < 0) return 0;
    if (j <0) return 0;
    if (i>=H)return 0;
    if (j >= W) return 0;
    
    return 1;
    
}


int main() {
    
    int H = in();
    int W = in();
    
    
    vector<char> s[H];
    char temp;
    for(auto i = 0; i< H; i++){
        for(auto j = 0; j< W; j++){
            cin >> temp;
            s[i].push_back(temp);
        }
    }
    
    if (H == 1 && W == 1){
        cout << "Yes" << endl;
        return 0;
    }
    
    
    
    for(auto i = 0; i< H; i++){
        for(auto j = 0; j< W; j++){
            
            int count = 0;
            
            if (s[i][j] != '#') continue;

            if (look_site(i-1,j,H,W)){
                count += (s[i-1][j] == '#');
            }
            if (look_site(i+1,j,H,W)){
                count += (s[i+1][j] == '#');
            }
            if (look_site(i,j-1,H,W)){
                count += (s[i][j-1] == '#');
            }
            if (look_site(i,j+1,H,W)){
                count += (s[i][j+1] == '#');
            }
            
            if (count == 0) {
                cout << "No" << endl;
                return 0;
            }
            
        }
    }
    
    cout << "Yes" << endl;
    
    
    

    
    return 0;
}


                          





Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}


int main(){
  fastIO();
  ll q,h,s,d,n;
  cin>>q>>h>>s>>d>>n;
  ll cheap = min({q*4,h*2,s});
  if(cheap*2<=d){
  	cout<<cheap*n<<endl;
  }else{
  	if(n%2==0){
  		cout<<(n/2)*d<<endl;
  	}else{
  	    ll res = 1;
  	    cout<<((n/2)*d)+(cheap*res)<<endl;
  	}
  }
}



Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	long long int a, b, z;
	int r,p,x,y;
	while(scanf("%lld %lld", &a, &b) != EOF){
		
		x = a;
		y = b;
		
		if(b<0){
			x *= -1;
		}
		if(a<0){
			y *= -12
			;
		}
		for(;;){
			r = x/y;
			p = x - y*r;
		
			if(p == 0){
				break;
			}
			x = y;
			y = p;
		}
		
		z = a*b/y;
		printf("%d %lld\n",y,z);
		
	}
	return 0;
}

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

int n;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	if(n % 10 == 3){
		cout<<"bon"<<endl;
	}else if(n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8){
		cout<<"pon"<<endl;
	}else{
		cout<<"hon"<<endl;
	}
}


Measured memory_bytes: 3564
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
#define PI 3.1415926535897932384626433832795028
#define INF (1<<29)
#define LINF (1LL<<60)
using namespace std;
using INT = long long;
using P = pair<int,int> ;

int main(){
    int n;
    cin >> n;
    vector<int> d;
    rep(i,n){
        int a;
        cin >> a;
        d.emplace_back(a);
    }
    sort(d.begin(), d.end());
    cout << d[n/2]-d[n/2-1] << endl;
    return 0;
}



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

void solve()
{
    int n;
    cin>>n;
    vector<int> v, v1, v2;
    for(int i=1; i<=n; i++)
    {
        int x;
        cin>>x;
        v1.push_back(x);
    }
    for(int i=1; i<=n; i++)
    {
        int x;
        cin>>x;
        v2.push_back(x);
    }
    for(int i=1; i<=n; i++)
    {
        v.push_back(i);
    }
    int x=0; int a=-1;
    do
    {
        int cnt = 0;
        for(int i=0; i<v.size(); i++)
        {
            if(v1[i]==v[i])
            {
                cnt++;
            }
        }
//        for(auto it: v) cout<<it<<" ";
//        cout<<endl;
        x++;
        if(cnt==n)
        {
           a=x;
        }
    }
    while(next_permutation(v.begin(),v.end()));

    int y=0;
    do
    {
        int cnt = 0;
        for(int i=0; i<v.size(); i++)
        {
            if(v2[i]==v[i])
            {
                cnt++;
            }
        }
//        for(auto it: v) cout<<it<<" ";
//        cout<<endl;
        y++;
        if(cnt==n)
        {
            break;
        }

    }

    while(next_permutation(v.begin(),v.end()));

    cout<<abs(a-y)<<endl;


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

    }
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int n = sc.nextInt();
            int r = sc.nextInt();
            if(n==0 && r==0) break;
            int ans[] = new int[n];
            for(int i = 0; i<n; i++){
                ans[i] = n-i;
            }
            for(int i = 0; i<r; i++){
                int p = sc.nextInt();
                int c = sc.nextInt();
                int tmp[] = new int[p+c-1];
                for(int j = 0; j<p+c-1; j++){
                    tmp[j] = ans[j];
                }
                for(int j = p-1; j<p+c-1; j++){
                    ans[j-p+1] = tmp[j];
                }
                for(int j = 0; j < p-1; j++){
                    ans[j+c] = tmp[j];
                }
            }
            System.out.println(ans[0]);
           
        }
        sc.close(); 
    }
}


Measured memory_bytes: 37416
#include<iostream>
using namespace std;
int main()
{
	int n,i,j,k,m,a,b,p,q;
	scanf("%d%d",&a,&b);
	for(i=min(a,b);i<1150;i++)
	{
		if((int)(i*0.08)==a&&(int)(i*0.1)==b)
		{
			printf("%d",i);
			exit(0);
		}
	}
	printf("-1");
 } 

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

int main(void){
   int N;
   cin>>N;
   vector<int> t(N),x(N),y(N);
   for(int i=0;i<N;i++){
      cin>>t[i]>>x[i]>>y[i];
   }
   int time=0;
   int x0=0;
   int y0=0;
   for(int i=0;i<N;i++){
      int dt=t[i]-time;
      int dx=abs(x[i]-x0);
      int dy=abs(y[i]-y0);
      if(dt<(dx+dy)||(dt-(dx+dy))%2==1){
         cout<<"No"<<endl;
         return 0;
      }
      time=t[i];
      x0=x[i];
      y0=y[i];
   }
   cout<<"Yes"<<endl;
   return 0;
}



Measured memory_bytes: 1408
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;
const vector<int> v = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

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

	cout << v[k-1] << endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int n = 0;
  int a[100000] = {};
  int order[100000] = {};
  int i = 0;
  scanf("%d",&n);
  for(i = 0;i < n;i++){
    scanf("%d",&a[i]);
    order[a[i]-1] = i + 1; 
  }
  for(i = 0;i < n;i++){
    printf("%d ",order[i]);
  }
  return 0;
}
  

Measured memory_bytes: 1536
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH
// AUTHOR:: MOHAMMAD FAISAL
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.flush();
	int a,b,x;
  	cin >> a >> b >> x;
  	bool ok = x>=a && x<=a+b;
  	(ok) ? cout<<"YES": cout<<"NO";
	return 0;
	// BYE BYE
}


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

int main() {
	int K = 0;
  	string S;
  
  	cin >> K >> S;
  
  	if(S.size() <= K)
      cout << S;
      
    else{
      for (int i = 0; i < K; i++){
        cout << S.at(i);
      }
      	cout << "...";
    }
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>

using namespace std;

int main(){    
    int N,a;
    int keep = -1;
    cin >> N;
    vector<int> v;

    for(int i = 0; i < N; i++){
        cin >> a;
        v.push_back(a);
    }

    for(int i = 0; i < N; i++){
        if(v[i] == 1){
            keep = i;
            break;
        }
    }

    if(keep == -1){
        cout << -1 << endl;
        exit(0);
    }

    int search = 1;
    int memo = keep;

    for(int i = 0; i < N; i++){
        if(v[i] == search+1 && i > memo){
            search++;
            memo = i;
        }
    }

    cout << N - search << endl;

    return 0;
}

Measured memory_bytes: 1400
#include<iostream>
#include<utility>
#include<cmath>

typedef std::pair<double, int> P;

const int INF = 1 << 30;

int n;

int main()
{
	while( std::cin >> n, n )
	{
		P ans( INF, INF );
		
		while( n-- )
		{
			int i; 
			double h, w;
			std::cin >> i >> h >> w;
			h /= 100.0;
			ans = std::min( ans, P( fabs( w / ( h * h ) - 22.0 ), i ) );
		}

		std::cout << ans.second << std::endl;
	}

	return 0;
}

Measured memory_bytes: 1228
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split(' ');

            long a,b,c,d = 1;
            a = long.Parse(s[0]);
            b = long.Parse(s[1]);

            if (a == 0)
            {
                c = b;
                if(b == 100)
                {
                    c++;
                }
            }
            else
            {
                for(int i = 0;i<a;i++)
                {
                    d *= 100;
                }
                if (b != 100)
                {
                    c = d * b;
                }
                else
                {
                    c = d * (b + 1);
                }
            }

            Console.WriteLine(c);

        }
    }
}

Measured memory_bytes: 11092
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    for(int i= 1; i<=B; i++){
      if(A*i%B == C){
        System.out.println("YES");
        return;
      }
    }    
    System.out.println("NO");
  }
}

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

using namespace std;

//#define double long double

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<double,double> dd;
typedef pair<ii,int> iii;
typedef pair<double,int> di;
typedef pair<int,ii> iii2;
typedef pair<ii,ii> iiii;
long long mod = 1000000007LL;
long long large = 2000000000000000000LL;



int main(){


	int n;
	cin>>n;
	vector<long long> a(n+1,0);
	for(int i=1;i<=n;i++) scanf("%lld",&a[i]);

	vector<vector<long long> > dp(n+1,vector<long long>(5,large));

	dp[0][0] = dp[0][1] = dp[0][2] = dp[0][3] = dp[0][4] = 0;

	for(int i=0;i<n;i++){
		dp[i+1][0] = min(dp[i+1][0],dp[i][0]+a[i+1]);
		dp[i+1][1] = min(dp[i+1][1],dp[i+1][0]);
		dp[i+1][1] = min(dp[i+1][1],dp[i][0]+(a[i+1]==0?2:a[i+1]%2));
		dp[i+1][1] = min(dp[i+1][1],dp[i][1]+(a[i+1]==0?2:a[i+1]%2));
		dp[i+1][2] = min(dp[i+1][2],dp[i+1][1]);
		dp[i+1][2] = min(dp[i+1][2],dp[i][1]+(a[i+1]+1)%2);
		dp[i+1][2] = min(dp[i+1][2],dp[i][2]+(a[i+1]+1)%2);
		dp[i+1][3] = min(dp[i+1][3],dp[i+1][2]);
		dp[i+1][3] = min(dp[i+1][3],dp[i][2]+(a[i+1]==0?2:a[i+1]%2));
		dp[i+1][3] = min(dp[i+1][3],dp[i][3]+(a[i+1]==0?2:a[i+1]%2));
		dp[i+1][4] = min(dp[i+1][4],dp[i+1][3]);
		dp[i+1][4] = min(dp[i+1][4],dp[i][4]+a[i+1]);
	}

	cout<<dp[n][4]<<endl;




	return 0;
}


Measured memory_bytes: 15872
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int a, b, c, d, h1, h2, k1, k2, ph, pk;
    scanf("%d %d", &h1, &h2);
    scanf("%d %d", &k1, &k2);
    scanf("%d %d %d %d", &a, &b, &c, &d);
    ph = (h1/10) * c + h1 * a + (h2/20) * d + h2 * b;
    pk = (k1/10) * c + k1 * a + (k2/20) * d + k2 * b;

    if (ph == pk) printf("even\n");
    else if (ph > pk) printf("hiroshi\n");
    else printf("kenjiro\n");

    return 0;
}




Measured memory_bytes: 2624
#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
int main(){
ll a,b;

	cin >> a >> b;

	if (a >= b) {
		for (int i = 0; i < a; i++) {
			cout << b;
		}
	}
	else {
		for (int i = 0; i < b; i++) {
			cout << a;
		}
	}
    return 0 ;
}


Measured memory_bytes: 256
A,B,M = map(int,input().split())

a = [int(x) for x in input().split()]

b = [int(x) for x in input().split()]

s = min(a)+min(b)

t = 2000000
for _ in range(M):
  x,y,c = map(int,input().split())
  t = min(t,a[x-1]+b[y-1]-c)

print(min(s,t))

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

int main() {
  int N;
  cin >> N;
  
  vector <int> a(N);
  for(int i=0;i<N;i++) cin >> a.at(i);
  
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  
  int sum=0;
  for(int i=0;i<N;i++){
    sum += a.at(i);}
  
  int sumA=0;
  for(int i=0;i<N;i=i+2){
    sumA += a.at(i);}
  
  int sumB=sum-sumA;
  
  cout<<sumA-sumB<<endl;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	ll n;cin >> n;
	ll ans = 1;
	while(n){
		ans *= 2;
		n /= 2;
	}

	cout << ans-1 << endl;

	return 0;
}


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


int main() {
  int N;
  cin >> N;
  vector<tuple<string, int, int>> rest(N);
  for (int i = 0; i < N; i++) {
    string s;
    int p;
    cin >> s >> p;
    p = 100 - p;
    rest.at(i) = make_tuple(s, p, i);
  }

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

  for (int i = 0; i < N; i++) {
    string s;
    int p, r;
    tie(s, p, r) = rest.at(i);
    cout << r + 1 << endl;
  }

}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            int[] ip = sc.intarr;

            if(ip[0] + ip[1] > ip[2] + ip[3])
            {
                Console.WriteLine("Left");
            }
            else if(ip[0] + ip[1] == ip[2] + ip[3])
            {
                Console.WriteLine("Balanced");
            }
            else
            {
                Console.WriteLine("Right");
            }
        }


    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }

    class Method
    {
        static public int max(params int[] nums)
        {

            int maxx = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                maxx = Math.Max(maxx, nums[i]);
            }
            return maxx;
        }
    }
}


Measured memory_bytes: 13396
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
// const ll mod = 1000000007;
const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"

bool solve(){
    ll n,W;cin>>n>>W;
    ll dp[n+1][n+1][400];
    rep(i,n+1)rep(j,n+1)rep(k,400)dp[i][j][k]=0;

    vector<ll>w(n),v(n);
    rep(i,n)cin>>w[i]>>v[i];

    rep(i,n)rep(j,n+1)rep(k,400){
        //not use
        chmax(dp[i+1][j][k],dp[i][j][k]);
        //use
        if(j+1<n+1 and w[i]-w[0]+k<400)chmax(dp[i+1][j+1][k+(w[i]-w[0])],dp[i][j][k]+v[i]);
    }

    ll ans=0;
    rep(j,n+1)rep(k,400){
        if(w[0]*j+k<=W){
    
            chmax(ans,dp[n][j][k]);
            // cout<<w[0]*j+k<<" "<<dp[n][j][k]<<endl;
        }
        
    }
    cout<<ans<<endl;
    return false;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout<<fixed<<setprecision(30);
    solve();
}


Measured memory_bytes: 32128
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "cmath"

using namespace std;

const long long int MOD = 1000000007;

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


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

	cin >> N >> M >> K;
	L = 0;
	R = 1000000;
	while (R - L > 1) {
		long long int mid = (L + R + 1) / 2;
		if (mid*M + K*(mid + 1) <= N) {
			L = mid;
		}
		else {
			R = mid;
		}
	}
	cout << L << endl;
	return 0;
}


Measured memory_bytes: 256
program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,j,ans=0

    read*, n
    do i=1,n-1
        j=1
        do while(j*j <= i)
            if (mod(i,j) == 0) then
                if (j == i/j) then
                    ans=ans+1
                else
                    ans=ans+2
                end if
            end if
            j=j+1
        end do
    end do
    print'(i0)', ans
end program main

Measured memory_bytes: 2924
#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:102400000,102400000")
#include<iostream>  
#include<cstdio>  
#include<fstream>  
#include<iomanip>
#include<algorithm>  
#include<cmath>  
#include<deque>  
#include<vector>
#include<bitset>
#include<queue>  
#include<string>  
#include<cstring>  
#include<map>  
#include<stack>  
#include<set>
#include<functional>
#define pii pair<int, int>
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define eps 0.00000001
#define mst(a,i) memset(a,i,sizeof(a))
#define all(n) n.begin(),n.end()
#define lson(x) ((x<<1))  
#define rson(x) ((x<<1)|1) 
#define inf 0x3f3f3f3f
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
deque<int>a;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int i, j, k, m, n;
	cin >> n;
	int mode = n & 1;
	for (int i = 1; i <= n; ++i)
	{
		cin >> k;
		if (mode)a.push_front(k);
		else a.push_back(k);
		mode ^= 1;
	}
	for (int i = 0; i < a.size()-1; ++i)
	{
		cout << a[i] << " ";
	}
	cout << a[(int)a.size() - 1];
	return 0;
}



Measured memory_bytes: 3072
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while (true) {
			String[] lines =  sc.nextLine().split("");
			int sum = 0;
			for(int i = 0;i < lines.length;i++) {
				sum += Integer.parseInt(lines[i]);
			}
			if(sum == 0) {
				break;
			}
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 27404
import java.util.*;
public class Main{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long N = n;
    long m = 0 ;
    for(long i=1;i<N+1;i++){
    if ((i%3)==0){}
    else if ((i%5)==0){}
    else{
    m = m+i;
    }
    }
	System.out.println(m);
    }   
}


Measured memory_bytes: 35820
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N ;
  vector<int> number(N);
  for(int i=0; i<N; i++){
    cin >> number.at(i);
  } //カード入力
  
  int A;
  A = 0;
  vector<int> number2(N);
  
  
  for(int i=0; i<N; i++) {
    for(int j=0; j<N; j++){
      if(A<number.at(j)){
        A = number.at(j);
      } //最大値をA
    }
      for(int k=0; k<N; k++){
        if(A == number.at(k)) {
          number.at(k) = 0;
          break;
        } //使ったところに0を代入
      }
    
      number2.at(i) = A;
      A = 0;
  }
  
  int X,Y;
  X = 0, Y = 0;
  
  for(int i=0; i<N/2; i++){
   X += number2.at(2*i);
    Y += number2.at(2*i+1);
  }
  if(N%2==1){
  X += number2.at(N-1);
  }
  
  cout << X-Y << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <math.h>
#include <ctype.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main() {
	int n; 
	cin >> n;

	double a = 0;
	double b = 0;
	for (int i = n; i > 0; i--) {
		if (i % 2 == 0) {
			a++;
		}
		else {
			b++;
		}
	}
	cout << b/n << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
constexpr long long INFL = 1LL << 60;
constexpr int INF = 1e9;

using namespace std;

int main()
{
    int N;
    cin >> N;
    int d[110];
    for(int i = 0; i < N; ++i) cin >> d[i];

    sort(d, d+N, greater<int>());
    int cnt = 0;
    int pre = -1;
    for(int i = 0; i < N; ++i){
        if(pre != d[i]){
            pre = d[i];
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-04-04 19:44:07
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <random>
#include <utility>
#include <chrono>

using namespace std;

using int64 = long long;

template<class T> using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { os << '{'; size_t n = vec.size(); for (size_t i = 0; i < n; ++i) { os << vec[i]; if (i != n - 1) os << ','; } os << '}'; return os; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) { return os << '{' << p.first << " " << p.second << '}'; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) { os << '{'; for (auto it = mp.begin(); it != mp.end(); ++it) { os << '{' << it->first << ':' << it->second << '}'; if (it != --mp.end()) os << ','; } os << '}'; return os; }
template<class T> std::ostream& operator<<(std::ostream& os, const std::set<T>& st) { os << '{'; for (auto it = st.begin(); it != st.end(); ++it) { os << *it; if (it != --st.end()) os << ','; } os << '}'; return os; }
template<class T> std::istream& operator>>(std::istream& is, std::vector<T>& vec) { size_t n = vec.size(); for (size_t i = 0; i < n; ++i) is >> vec[i]; return is; }

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...) 1728
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

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

  int n, k; cin >> n >> k;
  vector<int> x(n); cin >> x;

  int ans = 1e9;

  for (int i = 0; i <= n - k; ++i) {
    if (x[i + k - 1] <= 0) {
      ans = min(ans, abs(x[i]));
    } else if (x[i] >= 0) {
      ans = min(ans, x[i + k - 1]);
    } else {
      ans = min(ans, abs(x[i]) + abs(x[i + k - 1]) + min(abs(x[i]), abs(x[i + k - 1])));
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <bitset>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <random>

using namespace std;

static const double EPS = 1e-9;
template<class T> bool INRANGE(T x,T a,T b){return a<=x&&x<=b;}
template<class T> void amin(T &a,T v){if(a>v) a=v;}
template<class T> void amax(T &a,T v){if(a<v) a=v;}
int ROUND(double x) { return (int)(x+0.5); }
bool ISINT(double x) { return fabs(ROUND(x)-x)<=EPS; }
bool ISEQUAL(double x,double y) { return fabs(x-y)<=EPS*max(1.0,max(fabs(x),fabs(y))); }
double SQSUM(double x,double y) { return x*x+y*y; }
#define PI  (acos(-1))
#define ARRAY_NUM(a) (sizeof(a)/sizeof(a[0])) 
#define NG (-1)
#define BIG ((int)1e9)
#define BIGLL ((ll)4e18)
#define SZ(a) ((int)(a).size())
#define SQ(a) ((a)*(a))
typedef unsigned long long ull;
typedef long long ll;


int main()
{
	int N;
	cin >> N;
	vector <int> L(2*N);
	for (int i = 0; i < 2 * N; ++i)
	{
		cin >> L[i];
	}

	sort(L.rbegin(), L.rend());
	int result = 0;
	for (int i = 0; i < N; ++i)
	{
		result += L[2 * i + 1];
	}

	cout << result << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <numeric>
#include <string>

using namespace std;

int main()
{
  int N, K;
  cin >> N >> K;
  cout <<  N - K + 1 << endl;
  return 0;
}


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

double kyori(double x1,double y1,double x2,double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main(){
  int a,n;
  char s[5];
  cin>>s;
  !strcmp(s,"SUN")?a=7:
  !strcmp(s,"MON")?a=6:
  !strcmp(s,"TUE")?a=5:
  !strcmp(s,"WED")?a=4:
  !strcmp(s,"THU")?a=3:
  !strcmp(s,"FRI")?a=2:
  !strcmp(s,"SAT")?a=1:a=0;
  cout << a<< endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n,ice;
 int kind[10];


 while(1){
   for(int i=0;i<10;i++){
   kind[i]=0;}
   cin >> n;
   if(n==0)break;
   for(int k=0;k<n;k++){
     cin >> ice;
       
    for(int i=0;i<10;i++){
      if(ice==i){
	kind[i]++;}
  }
   }
   
 for(int i=0;i<10;i++){
   if(kind[i]==0){cout <<"-";}
  for(int j=0;j<kind[i];j++){
    cout <<"*";}
  cout <<endl;}
 }       
  return 0;
}

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "{";
    rep(i, (int)v.size()) {
        if (i)
            os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
    for (auto val : array)
        std::cout << val << ", ";
    std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::setprecision(10);

    int n; std::cin >> n;
    map<int, int> even, odd;
    rep(i, n) {
        int a; std::cin >> a;
        if ((i+1)&1) odd[a]++;
        else even[a]++;
    }
    auto create = [](vector<pi> &ret, map<int, int> m) {
        pi ma1(0, 0), ma2(0, 0);
        for (auto &p : m) {
            if (ma1.se < p.se) {
                ma2 = ma1;
                ma1 = p;
            } else if (ma2.se < p.se) {
                ma2 = p;
            }
        }
        ret.pb(ma1), ret.pb(ma2);
    };
    vector<pi> e, o;
    create(e, even), create(o, odd);
    e.pb({-2, 0}), o.pb({-1, 0});
    int ans = inf;
    for (auto &ee : e) for (auto &oo : o) {
        if (ee.fi == oo.fi) continue;
        chmin(ans, n-ee.se-oo.se);
    }
    std::cout << ans << "\n";
}


Measured memory_bytes: 9600
from numpy import *

N, M = map(int, input().split())
p = zeros(M, dtype=int)
S = []
for i in range(M):
    x, y = input().split()
    p[i] = int(x) - 1
    S.append(y)

ac = zeros(N, dtype=int)
wa = zeros(N, dtype=int)
s_ac = 0
s_wa = 0
for i in range(M):
    if ac[p[i]] == 0:
        if S[i] == 'AC':
            ac[p[i]] += 1
            s_ac += 1
            s_wa += wa[p[i]]
        elif S[i] == 'WA':
            wa[p[i]] += 1
    else:
        pass

print('{} {}'.format(s_ac, s_wa))

Measured memory_bytes: 20836
#include <bits/stdc++.h>
#define endl '\n'
#define all(a) (a).begin(), (a).end()
#define len(a) (int) (a).size()
#define forn(i, n) for (int (i) = 0; (i) < (n); ++(i))
#define int long long
using namespace std;
void solve();
mt19937 rnd(2007);
signed main(){
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    swap(rng, rnd);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    solve();
} // Code



void solve() {
    int n; cin >> n;
    int ans = 0;
    for (int i = 1; i * 2 < n; ++i)
        ans++;
    cout << ans << endl;
}




Measured memory_bytes: 256
s = input()
if s=="SAT":
  ans=1
if s=="FRI":
  ans=2
if s=="THU":
  ans=3
if s=="WED":
  ans=4
if s=="TUE":
  ans=5
if s=="MON":
  ans=6
if s=="SUN":
  ans=7
  
print(ans)


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

int main() {

  double x1, y1;
  double x2, y2;

  std::cin >> x1 >> y1 >> x2 >> y2;
  printf("%.10lf\n", sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)));
  
  return 0;
}

Measured memory_bytes: 1228
using System;
using System.Linq;
class Program
{
	static void Main(string[] args)
	{
        string[] input = Console.ReadLine().Split(' ');
        int n = int.Parse(input[0]);
        int y = int.Parse(input[1]);
        for(int i = 0;i <= n;i++){
            for(int j = 0;j <= n;j++){
                int k = n - i - j;
                if (i + j + k != n || k < 0) continue;
                if (10000 * i + 5000 * j + 1000 * k == y){
                    Console.WriteLine(i + " " + j + " " + k);
                    return;
                }
            }
        }
        Console.WriteLine("-1 -1 -1");
	}
}

Measured memory_bytes: 13140
def main():
    n = int(input())
    num_list = list(map(int, input().split()))

    flag = True

    for i in range(n-1):
        if num_list[i] != 1 and num_list[i-1] < num_list[i]:
            num_list[i] -= 1
        if num_list[i]  > num_list[i+1]:
            flag = False
            break
            
    print('Yes' if flag else 'No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 63856
// atcoder/abc139/E/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n;
  while (cin >> n) {
    const int N = 1000 + 5;

    static int g[N][N];
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n - 1; ++j) {
        cin >> g[i][j];
        --g[i][j];
      }
    }

    queue<int> q[n];
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n - 1; ++j) {
        q[i].push(g[i][j]);
      }
    }

    static bool vis[N];
    int x = 0;
    while (true) {
      bool f = false;
      fill(vis, vis + N, false);
      for (int i = 0; i < n; ++i) {
        if (vis[i] || q[i].empty()) continue;
        int j = q[i].front();
        if (vis[j] || q[j].empty()) continue;
        if (q[j].front() == i) {
          q[i].pop();
          q[j].pop();
          vis[i] = true;
          vis[j] = true;
          f = true;
        }
      }
      if (!f) break;
      ++x;
    }
    bool f = true;
    for (int i = 0; i < n; ++i) {
      f = f && q[i].empty();
    }
    cout << (f ? x : -1) << endl;
  }

  return 0;
}


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

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

    string input;

    vector<string>vec;

    for(int i = 1; i <= n; i++)
    {
        cin>> input;
        vec.push_back(input);
    }

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

    for(int i = 0; i < vec.size(); i++)
    {
        cout<< vec[i];
    }

    return 0;
}


Measured memory_bytes: 3556
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int K = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			list.add(scan.nextInt());
		}

		Collections.sort(list, Collections.reverseOrder());
		int min = 1000000000;
		for (int i = 0; i < N - K + 1; i++) {
			min = Math.min(min, list.get(i) - list.get(i + K - 1));
		}
		System.out.println(min);

	}

}


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

using namespace std;
#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) REP(i,0,(int)a-1)
#define FORD(i,a) REV(i,(int)a-1,0)
#define PB push_back
#define POB pop_back
#define MP make_pair
#define FI first
#define SE second
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int , int > pii;
typedef vector < int > vi;
typedef vector < pii > vii;
typedef vector < ll > vl;

const double EPS = 1e-9;
const double PI = acos(-1);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

ll addMod(ll a, ll b){
	return (a+b) % MOD;
}

ll mulMod(ll a, ll b){
	return (a*b) % MOD;
}

/////////////////////////////////////////////////////////


int a[5];

int solve(){
	int ret = 1;
	FOR(i,2){
		if(a[i] == a[i+1]) continue;
		ret++;
	}
	return ret;
}

int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	FOR(i,3) cin >> a[i];
	sort(a,a+3);
	cout << solve() << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        String[] ymd = s.split("/");
        int month = Integer.parseInt(ymd[1]);
        int day = Integer.parseInt(ymd[2]);
        if (month < 4) {
            System.out.println("Heisei");
        } else if (month == 4 && day <= 30) {
            System.out.println("Heisei");
        } else {
            System.out.println("TBD");
        }
    }
}


Measured memory_bytes: 21844
#include<iostream>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;
int main(){
    string a,b;
    cin >> a >> b;
    string ans;
    if(a.size() > b.size()){
        ans = "GREATER";
    }else if(a.size() < b.size()){
        ans = "LESS";
    }else{
        if(a > b)
            ans = "GREATER";
        else if(a < b)
            ans = "LESS";
        else
            ans = "EQUAL";
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Ord
import Control.Monad

main :: IO ()
main = breads >>= main'
    where
        main' [_, m] = replicateM m (build <$> breads) >>= print . solve . sortOn snd
        build [a, b] = (a, b)

solve :: [(Int, Int)] -> Int
solve = fst . foldl' ff (0, 0)
    where
        ff (acc, prev) (a, b)
            | prev < a = (acc + 1, b - 1)
            | otherwise = (acc, prev)

breads :: IO [Int]
breads = unfoldr uff <$> B.getLine
    where
        uff b = check <$> B.readInt b
        check (a, b)
            | B.null b = (a, b)
            | otherwise = (a, B.tail b)

Measured memory_bytes: 39292
using System;
using System.Collections.Generic;
using System.Linq;

namespace CSharpSample01
{

    
    class Program
    {
       

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

            var list = new List<long>();
            for(int i = 0; i < N; i++)
            {
                list.Add(long.Parse(str[i]) - (i + 1));
            }

            //昇順(だんだん大きくなる)
            list.Sort();

            //Console.WriteLine(string.Join(" ", list));

            long b = list[list.Count / 2];

            long ans = 0;

            for(int i = 0; i < N; i++)
            {
                ans += Math.Abs(list[i] - b);
            }

            Console.WriteLine(ans);

        }
    }
}


Measured memory_bytes: 33028
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vlli vector<ll>
#define vi vector<int>
#define vs vector<string>
#define vplli vector< pair< ll,ll> >
#define plli pair< ll,ll >
#define vps vector< pair< string, string> >
#define vpi vector< pair< int, int> >
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n) for(ll i=a;i<n;i++)
#define forr(i,n,a) for(ll i=n-1;i>=a;i--)
#define scan(arr,a,n) for(int i=(a);i<(n);i++)cin>>(arr)[i];
#define print(arr,a,n) for(int i=(a);i<(n);i++)cout<<(arr)[i]<<' ';

const ll inf = 1e18;

ll add(ll x, ll y) {ll res = x + y; return (res >= mod ? res - mod : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= mod ? res % mod : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + mod : res);}
ll power(ll x, ll y) {ll res = 1; x %= mod; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}
ll mod_inv(ll x) {return power(x, mod - 2);}

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

Measured memory_bytes: 3664
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <sstream>
#include <cmath>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()

typedef pair<int, int> Pii;
typedef vector<int> V;
typedef long long ll;
const int inf = 1e9;
const int mod = 1e9 + 7;

int main()
{
	int N;
	V L;
	cin >> N;
	rep(i,0,N*2) {
		int t;
		cin >> t;
		L.pb(t);
	}
	sort(all(L));

	int sum = 0;
	rep(i,0,N) sum += L[i*2];
	cout << sum << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,q,x,tot=0;
	int a[10001];
	cin>>n;
	for (int i=0; i<n; i++)
	    cin>>a[i];
	cin>>q;
	while (q--){
		  cin>>x;
		  for (int i=0; i<n; i++){
		  	  if (x==a[i]){
		  	     tot++; break;	
			  }
		  }
	}
	cout<<tot<<endl; 
	return 0;
}  


Measured memory_bytes: 3116
# import sys
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def main():

    N, M, K = map(int, input().split())

    uf = UnionFind(N)
    friends = [set() for _ in range(N)]

    for _ in range(M):
        a, b = map(int, input().split())
        a, b = a - 1, b - 1
        uf.union(a, b)
        friends[a] |= set([b])
        friends[b] |= set([a])

    blocks = [set() for _ in range(N)]
    for _ in range(K):
        c, d = map(int, input().split())
        c, d = c - 1, d - 1
        if uf.same(c, d):
            blocks[c] |= set([d])
            blocks[d] |= set([c])

    # print(uf)
    # print(friends)
    # print(blocks)

    for i in range(N - 1):
        ans = uf.size(i) - 1 - len(friends[i]) - len(blocks[i])
        print(str(ans) + " ", end="")

    ans = uf.size(N - 1) - 1 - len(friends[N - 1]) - len(blocks[N - 1])
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 74916
#define onlycc ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

typedef long long ll;

double d, t, s;

int main()
{
    onlycc;
    cin >> d >> t >> s;

    if(d/s <= t) cout << "Yes";
    else cout << "No";

    return 0;
}


Measured memory_bytes: 3736
package main

import (
        "fmt"
)

func solution(a, b, c, k int) int {
        ans := 0

        if a >= k {
                return k
        } else {
                ans = a
                k -= a
        }

        if b >= k {
                return ans
        } else {
                k -= b
        }
        return ans - k
}

func main() {
        var a, b, c, k int
        fmt.Scan(&a, &b, &c, &k)
        fmt.Println(solution(a, b, c, k))
}

Measured memory_bytes: 1752
#include <bits/stdc++.h>
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
const lli INF = 2147483647;
const lli MINF = -2147483648;
const lli LINF = 9223372036854775807;
const lli MOD = 1000000007; //10^9+7
const long double PI = acos(-1);
#define SORT(n) sort(n.begin(), n.end())
#define SORTR(n) sort(n.begin(), n.end(), greater<int>())
#define REV(n) reverse(n.begin(), n.end())
#define Vec(K, L, N, S) vector<L> K(N, S)
#define rt sqrt
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("Ofast")
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<lli>;
using P = pair<lli, lli>;
// vector<P> vp;
// vp.emplace_back(a[i], b[i]);
using vs = vector<string>;
using ll = long long;

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;
}

// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  // os << '}';
  return os;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli a, b, c, h, k, n, w, ans = 0, count = 0;
  string s, t;
  cin >> a >> b >> c >> k;
  if (k - a > 0)
  {
    k -= a;
    ans += a;
    if (k <= 0)
    {
      cout << ans << endl;
      return 0;
    }
  }
  else
  {
    ans += k;
    cout << ans << endl;
    return 0;
  }
  if (k - b > 0)
  {
    k -= b;
    if (k <= 0)
    {
      cout << ans << endl;
      return 0;
    }
  }
  else
  {
    k -= b;
    if (k <= 0)
    {
      cout << ans << endl;
      return 0;
    }
  }
  if (k - c > 0)
  {
    k -= c;
    ans -= c;
    if (k <= 0)
    {
      cout << ans << endl;
      return 0;
    }
  }
  else
  {
    ans -= k;
    cout << ans << endl;
    return 0;
  }
}

Measured memory_bytes: 3648