akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <cassert>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <type_traits>
#include <fstream>
//#include <bits/stdc++.h>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// print(x, y, z);
// printVec(va.begin(), va.end());
void print(){ std::cout << std::endl; }
template <typename Head> void print(Head&& head) { std::cout << head << std::endl; }
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail)
{
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...); // or print(tail...);
}
template<typename Iterator> void printVec(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << *it << " ";
    if ((it - begin) % 20 == 19 || it == end - 1) { std::cout << std::endl; }
  }
}
template<typename Iterator> void printVecPair(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << it->first << " " << it->second << " ";
    if ((it - begin) % 10 == 9 || it == end - 1) std::cout << std::endl;
  }
}

template<typename T> T bitnum(T x)
{
  T cnt = 1;
  T ret = 0;
  while (x > 0) {
    ret += (x % 2) * cnt;
    x /= 2;
    cnt *= 10;
  }
  return ret;
}

template<typename T> T lminimum(const std::vector< T >& v) {return *std::min_element(v.begin(), v.end());}
template<typename T> T lmaximum(const std::vector< T >& v) {return *std::max_element(v.begin(), v.end());}
template<typename T> void lunique(std::vector< T >& v) {v.erase(std::unique(v.begin(), v.end()), v.end());}
template<typename T> void lsort(std::vector< T >& v) {std::sort(v.begin(), v.end());}
template<typename T> void lgreatersort(std::vector< T >& v) {std::sort(v.begin(), v.end(), std::greater<>());}
template<typename T> bool lnext_permutation(std::vector< T >& v) {return std::next_permutation(v.begin(), v.end());}

int main(int argc, char* argv[])
{
  ll H, W;
  ll h, w;
  std::cin >> H >> W >> h >> w;

  std::cout << (H - h) * (W - w) << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9 + 5

int main(){
	int n, k;
	cin >> n >> k;
	vector<int> h(n);
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	vector<int> dp(n, INF);
	dp[0] = 0;
	for(int i = 0; i < n; i++){
		for(int j = 1; j <= k; j++){
			if(i - j >= 0){
				dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]));
			}
		}
	}
	cout << dp[n-1] << endl;
	return 0;
}

Measured memory_bytes: 1024
function Main(input) {
  input = input.split("\n");
 
  var n = parseInt(input[0], 10)
  var p = input.slice(1, n + 1).map(n => parseInt(n, 10))
 
  var top = p.reduce((n, m) => n >= m? n: m)
  var sum = p.reduce((n, m) => n + m)
 
  console.log(sum - (top / 2))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,k,p=0;
	scanf("%d %d %d",&a,&b,&c);
	if(a==b&&b!=c)
	p=1;
	if(a==c&&b!=c)
	p=1;
	if(b==c&&a!=c)
	p=1;
	if(p)
	printf("Yes");
	else
	printf("No");
} 

Measured memory_bytes: 256
n, m = map(int, input().split())
dp = [float("INF")]*(1<<n)
dp[0] = 0
for _ in range(m):
    a, b = map(int, input().split())
    c = list(map(int, input().split()))
    C = 0
    for e in c:
        C += 1<<(e-1)
    for i in range(1<<n): 
        dp[i|C] = min(dp[i|C], dp[i]+a)
if dp[-1] == float("INF"): print(-1)
else: print(dp[-1])

Measured memory_bytes: 76552
H, N = map(int, input().split())
A = [0] * N
B = [0] * N 
for i in range(N):
    a, b = map(int, input().split())
    A[i] = a
    B[i] = b

# dp[i][h] := i-1 番目の魔法の中から，減らす体力が h を達成するように選んだ時の魔法の最小値
# DP テーブル
max_h = H + max(A)
dp = [[float("inf")] * (H + 1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(N):
    for h in range(H + 1):
        dp[i+1][h] = min(dp[i][h], dp[i+1][h])
        if h - A[i] >= 0:
            dp[i+1][h] = min(dp[i+1][h - A[i]] + B[i], dp[i][h])
        else:
            dp[i+1][h] = min(dp[i][0] + B[i], dp[i+1][h])
#print(dp)
print(dp[N][H])

Measured memory_bytes: 289800
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int n = sc.nextInt();

		int[] values = new int[w];
		int temp;
		
		for(int i = 0;i < values.length;i++){
			values[i] = i+1;
		}

		for(int i = 0;i<n;i++){
			String str = sc.next();
			String[] ab = str.split(",");
			int a = Integer.parseInt(ab[0])-1;
			int b = Integer.parseInt(ab[1])-1;
			temp = values[a];
			values[a] = values[b];
			values[b] = temp;
		}	
		for(int j = 0;j <= w-1;j++){
			System.out.println(values[j]);
		}
		
	}
}

Measured memory_bytes: 17264
#include<bits/stdc++.h>
using namespace std;
#define MAX 105


int n,m,a,b,c;
int ans=0;

int t[MAX];
int g[MAX];
int G[MAX][MAX];

void rec(int p,int cnt,int size){

  
  
  if(cnt==size){
    int sum=0;
    for(int i=0;i<size;i++){

      int mini=1e9;
      for(int j=0;j<size;j++){
        if(i==j)continue;
        mini=min(mini,G[t[i]][t[j]]);
      }
      sum+=mini;
    }

    ans=max(ans,sum);
    return;
  }
  if(p==n+1)return;

  rec(p+1,cnt,size);

  if(g[p]>=size-1){
    t[cnt]=p;
    rec(p+1,cnt+1,size);
  }
}

int main(){
  cin>>n>>m;
  for(int i=0;i<m;i++){
    cin>>a>>b>>c;
    g[a]++;
    g[b]++;
    G[a][b]=G[b][a]=c;
  }
  for(int i=2;i<=15;i++)rec(1,0,i);
  cout<<ans<<endl;
  return 0;
}

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

#define For(i, j, k) for (int i = j; i <= k; ++ i)
#define Forr(i, j, k) for (int i = j; i >= k; -- i)

using namespace std;

inline void File() {
	freopen("E.in", "r", stdin);
	freopen("E.out", "w", stdout);
}

const int N = 42, M = (1 << 17) + 5, mod = 1e9 + 7;
int dp[N][M], n, z, y, x, ans;

int main() {

	cin >> n >> x >> y >> z;

	int all = (1 << x + y + z) - 1,
		fbd = (1 << x - 1) | (1 << x + y - 1) | (1 << x + y + z - 1);

	dp[0][0] = 1, ans = 1;
	
	For(i, 1, n) {
		ans = 10ll * ans % mod;
		For(st, 0, all) For(k, 1, 10) {
			int nw = ((1 << k - 1) | (st << k)) & all;
			if ((nw & fbd) ^ fbd) 
				dp[i][nw] = (dp[i][nw] + dp[i - 1][st]) % mod;
		}
	}

	For(i, 0, all) ans = (ans - dp[n][i] + mod) % mod;

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 20736
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  if(S.size()>=4&&S.at(0)=='Y'&&S.at(1)=='A'&&S.at(2)=='K'&&S.at(3)=='I')
    cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 3624
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;

//Towns along a Highway
public class Main{
	
	int n;
	int[] rs;
	int[][] a;
	int[] p, c;
	Set<String> res;
	Set<String> v;
	
	boolean check(){
		String k = trans(p);
		if(v.contains(k))return false;
		v.add(k);
		return true;
	}
	
	void dfs(int k, int l, int r){
		if(k<0){
			res.add(trans(p)); return;
		}
		if(c[k]==0){
			dfs(k-1, l, r); return;
		}
		if(!check())return;
		int d = k;
		if(p[0]==-1){
			a[0][n-1]=a[n-1][0]=d;
			p[0] = 0; p[n-1] = d; c[d]--; dfs(k, l+1, r-1);
			p[0] = d; p[n-1] = 0; dfs(k, l+1, r-1); c[d]++;
			return;
		}
		for(int i=0;i<n;i++){
			if(p[i]!=-1||(i!=l&&i!=r))continue;
			for(int j=0;j<n;j++){
				if(p[j]==-1)continue;
				int pos = p[j]-d;
				if(0<=pos&&pos<=400){
					boolean ok = true;
					for(int m=0;m<n;m++){
						if(p[m]==-1)continue;
						int dif = Math.abs(p[m]-pos);
						a[i][m]=a[m][i]=dif;
						c[dif]--;
						if(c[dif]<0)ok = false;
					}
					if(ok){
						boolean f = i==l;
						p[i] = pos; dfs(k, f?l+1:l, f?r:r-1); p[i] = -1;
					}
					for(int m=0;m<n;m++){
						if(p[m]==-1)continue;
						int dif = Math.abs(p[m]-pos);
						a[i][m]=a[m][i]=-1;
						c[dif]++;
					}
				}
				pos = p[j]+d;
				if(0<=pos&&pos<=400){
					boolean ok = true;
					for(int m=0;m<n;m++){
						if(p[m]==-1)continue;
						int dif = Math.abs(p[m]-pos);
						a[i][m]=a[m][i]=dif;
						c[dif]--;
						if(c[dif]<0)ok = false;
					}
					if(ok){
						boolean f = i==l;
						p[i] = pos; dfs(k, f?l+1:l, f?r:r-1); p[i] = -1;
					}
					for(int m=0;m<n;m++){
						if(p[m]==-1)continue;
						int dif = Math.abs(p[m]-pos);
						a[i][m]=a[m][i]=-1;
						c[dif]++;
					}
				}
			}
		}
	}
	
	String trans(int[] p){
		String r = "";
		int[] t = p.clone();
		Arrays.sort(t);
		for(int i=1;i<n;i++)r+=String.format("%03d", t[i]-t[i-1]);
		return r;
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			n = sc.nextInt();
			if(n==0)break;
			a = new int[n][n];
			v = new HashSet<String>();
			for(int[]b:a)Arrays.fill(b, -1);
			c = new int[401];
			rs = new int[n*(n-1)/2];
			int k = 0;
			for(int i=0;i<n;i++)for(int j=i+1;j<n;j++){
				int d = sc.nextInt();
				rs[k++] = d;
				c[d]++;
			}
			p = new int[n];
			Arrays.fill(p, -1);
			res = new HashSet<String>();
			dfs(400, 0, n-1);
			PriorityQueue<String> q = new PriorityQueue<String>();
			for(String t:res)q.add(t);
			while(!q.isEmpty()){
				String t = q.poll();
				List<Integer> l = new ArrayList<Integer>();
				for(int i=0;i<t.length();i+=3)l.add(Integer.parseInt(t.substring(i, i+3)));
				for(int i=0;i<l.size();i++)System.out.print(l.get(i)+(i==l.size()-1?"\n":" "));
			}
			System.out.println("-----");
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

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

int digit(ll x) {
    if (x / 10 == 0) return 1;
    return digit(x / 10) + 1;
}

ll gcd(long long a,long long b) {
    if (a < b) swap(a,b);
    if (b == 0) return a;
    
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    a / gcd(a,b) * b;
}
const ll mod = 1e9 + 7;
const ll INF = 1e9 + 7;

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


/////////////////////////////////////////////////////////////////////////////////////////
struct unionfind {
    vector<int> par,rank;
    unionfind(int n) : par(n),rank(n,1){
        for (int i = 0;i < n;i++){
            par[i] = i;
        }
    }

    int find(int x){
        if (par[x] == x){
            return x;
        }

        return par[x] = find(par[x]);
    }

    void unite(int x,int y){
        int rx = find(x);
        int ry = find(y);
        if (rx == ry) return;
        if (rank[rx] < rank[ry]){
            swap(rx,ry);
        }
        par[ry] = rx;
        rank[rx] += rank[ry];
    }

    bool same(int x,int y){
        return find(x) == find(y);
    }

    int size(int x){
        return rank[find(x)];
    }
};

int main(){
    int n,m,k;
    cin >> n >> m >> k;
    vector<set<int>> br(n);
    unionfind uf(n);

    for (int i = 0;i < m;i++){
        int a,b;
        cin >> a >> b;
        a--; b--;
        br[a].insert(b);
        br[b].insert(a);
        uf.unite(a,b);
    }

    for (int i = 0;i < k;i++){
        int c,d;
        cin >> c >> d;
        c--; d--;
        if(!uf.same(c,d)) continue;
        br[c].insert(d);
        br[d].insert(c);
    }

    for (int i = 0;i < n;i++){
        int num = uf.size(i) - 1;
        num -= br[i].size();
        cout << num << " ";
    }

    cout << endl;

    return 0;

}

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

#define ll long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

int main(){
	fastio
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 1,tmp;i <= n;i++){
		cin >> tmp;
		if(i&1&&tmp&1) ans++;
	}
	cout << ans << "\n";
}

Measured memory_bytes: 3604
#include <stdio.h>

int main() {
	int health, n_attack;
	scanf("%d %d", &health, &n_attack);
	
	int total_dmg = 0;
	for(int i=0; i<n_attack; i++) {
		int dmg;
		scanf("%d", &dmg);
		total_dmg = total_dmg + dmg;
	}
	health = health - total_dmg;
	if(health > 0) puts("No");
	else puts("Yes");
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
  int h, w;
  cin >> h >> w;
  vector<string> vec(h);

  for (int i = 0; i < h; i++) {
    cin >> vec.at(i);
  }
  
  for (int i = 0; i < w+2; i++) {
    cout << "#";
  }
  
  cout << endl;
  
  for (int i = 0; i < h; i++) {
    cout << "#" << vec.at(i) << "#" << endl;
  }
  
  for (int i = 0; i < w+2; i++) {
    cout << "#";
  }
  
  cout << endl;
  

}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int ans = (n == 0) ? 0 : n * (n - 1) / 2;
  int bar = (m == 0) ? 0 : m * (m - 1) / 2;
  cout << ans + bar << '\n';
  return 0;
}

Measured memory_bytes: 256
//Decision's template
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cstdlib>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<set>
using namespace std;

#define DP_maxn 16
#define maxn 1000000+10
#define INF 1000000007
#define mod 1000000007
#define mst(s,k) memset(s,k,sizeof(s))
#define eps 1e-12

typedef long long ll;

struct Edge{
    int from,to,dist;
    Edge(int u,int v,int d):from(u),to(v),dist(d){}
};

/*-------------------------------template End--------------------------------*/

int n,q,l,r;

char s[100007];
int cnt[100007],tmp = 0;

int main(){
	cin>>n>>q;
	cin>>s;
	cnt[0] = 0;
	for(int i = 1;i<n;i++){
		if(s[i] == 'C' && s[i - 1] =='A'){
			cnt[i] = 1;
		}
	}
	for(int i = 1;i<n;i++){
		cnt[i] += tmp;
		tmp = cnt[i];
	}
	cnt[n] = tmp;
	for(int i = 1;i<=q;i++){
		cin>>l>>r;
		cout<<cnt[r - 1] - cnt[l - 1]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
    #define REP(i, n) for(int i = 0; i < n; i++)
    #define REPR(i, n) for(int i = n; i >= 0; i--)
    #define FOR(i, m, n) for(int i = m; i < n; i++)
    #define INF 2e9
    #define ALL(v) v.begin(), v.end()
    using namespace std;
    typedef long long ll;
    int main()
    {
      int N;
     cin>>N ;
      double s;
      s = 0;
      for(int i = 0;i < N;i++){
        double A;
        cin>>A ;
        s += 1/A;
      }
      s = 1/s ;
      cout<<s<<endl;
      
    }

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>




int main()
{
	char S[100];
	int K=0,N=0,i=0;
	
	scanf("%d", &K);
	
	scanf("%s",S);
	
	N=strlen(S);
	
	if(N<=K){
		printf("%s",S);
	}
	else{
		for(i=0;i<K;i++){
			printf("%c",S[i]);
		}
		printf("...");
	}
	
	return 0;
}


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

#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;

bool end(ll a, ll b, ll c) {
  if(a%2 == 1 || b%2 == 1 || c%2 == 1) return true;
  return false;
}

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

  ll a, b, c; cin >> a >> b >> c;
  if(end(a, b, c)) {
    cout << 0 << '\n';
    return 0;
  }
  if(a == b && b == c && c == a) {
    cout << -1 << '\n';
    return 0;
  }

  ll ans = 0;
  while(!end(a, b, c)) {
    ll cp_a = a, cp_b = b, cp_c = c;
    a = (cp_b+cp_c)/2;
    b = (cp_c+cp_a)/2;
    c = (cp_a+cp_b)/2;

    ans++;
  }

  cout << ans << '\n';
  return 0;
}


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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

// a^b mod M
long myPow(long a,long b,int M) {
    long ret = 1;
    long tmp = a;
    while(b>0) {
        if((b&1)==1) ret = (ret * tmp) % M;
        tmp = (tmp * tmp) % M;
        b = b>>1;
    }
    return ret;
}

 // nCk mod M
int nCk(int n,int k,int M) {
    long ret = 1;
    int mi = min(k, n-k);
    for(int i=1;i<=mi;i++) {
        ret = (ret * myPow(i,M-2,M)) % M;
    }
    for(int i=n-mi+1;i<=n;i++) {
        ret = (ret * i) % M;
    }
    return (int)ret;
};

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

ll num[2020][2020];
ll sum[2020][2020];

int main() {
    int N,M;
    int S[2020];
    int T[2020];

	cin >> N >> M;
	REP(i,N) cin>>S[i];
	REP(i,M) cin>>T[i];
	
	REP(x,2020) sum[x][0]=sum[0][x]=1;
    ll ret=1;
	REP(x,N) REP(y,M) {
		if(S[x]==T[y]) {
			num[x+1][y+1]=(sum[x][y])%MOD;
            ret+=num[x+1][y+1];
		}
		sum[x+1][y+1]=(sum[x][y+1]+sum[x+1][y]+MOD-sum[x][y]+num[x+1][y+1])%MOD;
	}

	cout<<ret%MOD<<endl;	
}

Measured memory_bytes: 63744
N = int(input())
A = list(map(int,input().split()))
import sys
tmp = 1
A.sort(reverse = True)
if 0 in A:
    print(0)
else:
    for i in range(N):
        tmp *= A[i]
        if tmp > 10**18:
            print(-1)
            sys.exit()
    print(tmp)

Measured memory_bytes: 21484
import java.io.IOException;
import java.util.Scanner;

public class Main {

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

	    // 面積
	    int area = x * y;
	    // 周の長さ
	    int cf = x*2 + y*2;

	    System.out.println(area + " " + cf);
	}

}


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

int main() {
  int N , M;
  cin >> N;
  int goukei = 0;
  int MAX = 0;
  vector<string> ao(N);
  for (int i = 0; i < N; i++){
    cin >> ao.at(i);
  }
  cin >> M;
  vector<string> aka(M);
  for (int i = 0; i < M; i++){
    cin >> aka.at(i);
  }
  //ここまでok
  for (int i = 0; i < N; i++){
    goukei = 0;
    for(int b = 0; b < N; b++){
      if (ao.at(i) == ao.at(b)){
        goukei++;
      }
    }
    for(int b = 0; b < M; b++){
      if (ao.at(i) == aka.at(b)){
        goukei--;
      }
    }
    if (goukei > MAX){
       MAX = goukei;
    }
  }
  cout << MAX << endl;
}

Measured memory_bytes: 3612
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printfin(a) printf(a ? "possible\n" : "inposible\n")
#define all(x) (x).begin(), (x).end()

using ll = long long;

const int INF = 2147483647;
//const ll LINF = ll();今度書く

//マクロとかここまで

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>

using namespace std;

int ggd(int number1, int number2) {
	int m = number1;
	int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}

	while (m != n) {
		int temp = n;
		n = m - n;
		m = temp;
	}

	return m;
}

int lcm(int number1, int number2) {
	return number1 * number2 / ggd(number1, number2);
}

bool is_prime(int64_t x) {
	for (int64_t i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

int main() {

	int n;
	scanf("%d", &n);
	vector<int> v(n);
	double ans;
	rep(i, n)scanf("%d", &v[i]);
	sort(all(v));
	ans = v[0];
	rep(i, n - 1) {
		ans = double(ans + v[i + 1]) / 2;
	}
	printf("%.16f\n", ans);

	return 0;
}


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

int main() {
    int n;
    int ans;
    while(cin >> n){
        ans = 0;
        for(int a=0; a<10;a++){
            for(int b=0; b<10; b++){
                for(int c=0; c<10; c++){
                    for(int d=0; d<10; d++){
                        if(a+b+c+d == n){
                            ans++;
                        }
                    }
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
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; }
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;


int main() {
    ll k,a,b;
    bool ok = false;
    cin >> k >> a >> b;
    for (ll i = a;i<=b;i++) {
        if (i%k==0) ok = true;
    }
    if (ok) cout << "OK" << endl;
    else cout << "NG" << endl;

}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
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 Would
#define you
#define please


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


	int A, B;
	cin >> A >> B;

	co(max(0, A - B * 2));

	Would you please return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

signed main() {
    int n;
    ll d;
    cin >> n >> d;
    int ans = 0;
    ll x, y;
    rep(i, n) {
        cin >> x >> y;
        ans += (x * x + y * y <= d * d);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3584
#include<iostream>
#include<algorithm>

using namespace std;
static const int MAX = 200000;

int main()
{
  int R[MAX];
  int n;

  cin >> n;
  for (int i = 0; i < n; i++)
  {
    cin >> R[i];
  }
  int maxv = -2000000000; // 十分小さい値を初期値に設定
  int minv = R[0];

  for (int i = 1; i < n; i++)
  {
    maxv = max(maxv, R[i] - minv);  // 最大値を更新
    minv = min(minv, R[i]);         // ここまでの最小値を保持しておく
  }
  cout << maxv << endl;
  return 0;
}


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

int main(){
    int N,M;
    cin >> N >> M;
    vector<int> A(M);
    for(int i=0; i<M; i++){
        cin >> A.at(i);
    }
    int ans = N;
    for(int i=0; i<M; i++){
        ans -= A.at(i);
    }
    if(ans < 0) ans = -1;
    cout << ans << endl;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <iomanip>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}


int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  int n, sum = 0;
  cin >> n;
  vector<int>l(n);
  rep(i,n) cin >> l[i];
  sort(l.begin(),l.end());
  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[j]<l[i]+l[k] && l[k]<l[j]+l[i]) sum++;
      }
    }
  }
  cout<<sum<<endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define LINF 3e18+7
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

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; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const double PI = acos(-1.0);
const double EPS = 1e-10;

vector<vector<int>> G;
vector<int> color;

bool dfs(int v, int cur=0){
    color[v] = cur;
    for(auto nv:G[v]){
        if(color[nv]!=-1){
            if(color[nv]==cur) return false;
            continue;
        }
        if(!dfs(nv,1-cur)) return false;
    }
    return true;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,M;
    cin>>N>>M;
    G.resize(N);
    REP(i,M){
        int a,b;
        cin>>a>>b;
        --a,--b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    color.assign(N,-1);
    bool bipartite =true;
    REP(v,N){
        if(color[v]!=-1) continue;
        if(!dfs(v)) bipartite = false;
    }

    if(bipartite){
        ll b=0, w=0;
        REP(i,N) (color[i]? b++ : w++);
        cout<< b*w - M <<endl;
    }
    else{
        cout << (ll)N*(N-1)/2 - M << endl;
    }

}

Measured memory_bytes: 6528
n, m = map(int, input().split())
es = [[] for _ in range(n)]
for _ in range(m):
  s, t = map(int, input().split())
  es[s-1].append(t-1)
  es[t-1].append(s-1)
for i in range(n):
  print(len(es[i]))  


Measured memory_bytes: 2940
n = int(input())
h = [int(i) for i in input().split()]
ans = 'Yes'
for i in range(n - 1, 0, -1):
    if h[i - 1] > h[i]:
        h[i - 1] -= 1
    if h[i - 1] > h[i]:
        ans = 'No'
print(ans)

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

using namespace std;

long long N, M, an;

bool check(long long v)
{
    return M / v >= N;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> N >> M;
    for (long long i = 1; i*i <= M; ++i) if (M % i == 0) {
        if (check(i)) an = max(an, i);
        if (check(M/i)) an = max(an, M/i);
    }
    cout << an << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll MOD=1e9+7;
static const int MAX = 100;
static const int INF = (1<<23);
template<class T> T gcd(T a, T b){return b? gcd(b,a%b) : a;}
template<class T> T lcm(T a,T b){return a / gcd(a,b)*b;}

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

    vector<int> v(n);
    rep(i,n){
        cin>>v[i];
    }
    int ans = 0;
    rep(i,n){
        
        if(v[i]>=1&&v[v[i]-1]==i+1){
            ans++;
            v[v[i]-1] = -1*v[v[i]-1];
            v[i]=-1*v[i];
         //   cout<<v[v[i]-1]<<endl;
        }
    }
//    rep(i,n){
//        cout<<v[i]<<endl;
//    }
    cout<<ans<<endl;
    
return 0;
}


Measured memory_bytes: 640
#include <stdio.h>

int main(void) {
    int i, j, k, N, a[310], one=0, two=0, three=0;
    double dp[310][310][310];
    scanf("%d", &N);
    for (i=1;i<=N;i++) {
        scanf("%d", &a[i]);
        switch (a[i]) {
            case 1:
                one++;
                break;
            case 2:
                two++;
                break;
            case 3:
                three++;
                break;
            default:
                break;
        }
    }

    dp[0][0][0] = 0.0;
    for (i=1;i<=N;i++) {
        dp[i][0][0] = dp[i-1][0][0] + (N + 0.0)/i;
    }
    for (k=0;k<=N;k++) {
    for (j=0;k+j<=N;j++) {
        if (k+j == 0) continue;
    for (i=0;k+j+i<=N;i++) {
                if (i>0) dp[i][j][k] += dp[i-1][j][k] * i / (i+j+k);
                if (j>0) dp[i][j][k] += dp[i+1][j-1][k] * j / (i+j+k);
                if (k>0) dp[i][j][k] += dp[i][j+1][k-1] * k / (i+j+k);
                dp[i][j][k] += (N + 0.0)/(i+j+k);
            }
        }
    }

    printf("%.13lf\n", dp[one][two][three]);
    return 0;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
    double W, H; cin >> W >> H;
    ll x, y; cin >> x >> y;

    ll cnt = H * W;
    double ans = cnt / 2.0;
    string str = "0";

    if(x == W / 2 && y == H / 2) str = "1";
    cout << fixed << setprecision(10) << ans;
    cout << " " << str << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

int main() {
    ll N;
    cin>>N;
    VL H(N);
    ll flg=1;
    ll ma=0;
    rep(i,0,N){
        cin>>H[i];
        ma=max(ma,H[i]);
        if(i!=0){
            ll d=H[i]-H[i-1];
            if(H[i]-ma<-1)flg*=0;
            //if(d<-1)flg*=0;
            //if(i==N-1&&d<-1)flg*=0;
        }
    }
    cout<<(flg ? "Yes":"No")<<endl;
}

Measured memory_bytes: 1024
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	/*
		sum := 0
		for k := 1; k <= n; k++ {
			for d := 1; d <= k; d++ {
				if k%d == 0 {
					sum += k
				}
			}
		}
	*/

	sum := 0
	for d := 1; d <= n; d++ {
		maxK := n / d
		sum += d * maxK * (maxK + 1) / 2
	}

	fmt.Printf("%d\n", sum)

}


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
#define MP make_pair
ll MOD = 1e9+7;
//ll MOD = 998244353;
ll INF = 1e18;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }
void answer1(bool x){
  if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void answer2(bool x){
  if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void answer3(bool x){
  if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void answer(bool x, ll y, ll z){
  if(x) cout<<y<<endl;else cout<<z<<endl;}   


int main(){
  ll i, j;
  //ll n;
  //cin >> n;
  //ll a, b, c;
  //cin >> a >> b;
  string s; cin >> s;
 
  ll result = 700;
  bool judge = true;
  for(i=0;i<3;i++){
    if(s[i]=='o')
    result+=100;
  }
  cout<<result<<endl;

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





  return 0;
}

Measured memory_bytes: 256
using System;

namespace Contest
{


    class Program
    {

        static void Main(string[] args)
        {
            var a = Console.ReadLine();
            if (Char.IsUpper(a[0]))
            {
                Console.WriteLine("A");
            }
            else
            {
                Console.WriteLine("a");
            }

        }
    }
}

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

int main(void){
    int i,j;
    int n;
    long long int min = LONG_MAX;
    long long int tmp = LONG_MAX;

    cin >> n;
    vector<int> l(n);
    for (i = 0; i < n; i++) {
        cin >> l[i];
    }
    for (i = 1; i <= 100; i++) {
        tmp = 0;
        for (j = 0; j < n; j++) {
            tmp += pow(l[j] - i, 2.0);
        }
        if (tmp < min)
            min = tmp;
    }
    cout << min << endl;
}


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

long long count(map<char,vector<int>> &dic, char a, char b, char c)
{
    long long result = 0;
    for(int x : dic[a])
    {
        vector<int>::iterator y = lower_bound(dic[b].begin(), dic[b].end(), x);
        for(; y != dic[b].end(); ++y)
        {
            vector<int>::iterator z = lower_bound(dic[c].begin(), dic[c].end(), *y);
            if(z == dic[c].end())
            {
                continue;
            }
            vector<int>::iterator t = lower_bound(dic[c].begin(), dic[c].end(), *y+(*y-x));
            result += (dic[c].end()-z);
            if(t != dic[c].end()
            && *y-x == *t-*y)
            {
                --result;
            }
        }
    }
    return result;
}

int main()
{
    int n;
    cin >> n;
    string str;
    cin >> str;
    map<char,vector<int>> dic;
    for(int i = 0; i < n; ++i)
    {
        dic[str[i]].push_back(i);
    }
    long long ans = 0;
    ans += count(dic,'R','G','B');
    ans += count(dic,'R','B','G');
    ans += count(dic,'G','R','B');
    ans += count(dic,'G','B','R');
    ans += count(dic,'B','R','G');
    ans += count(dic,'B','G','R');
    cout << ans << endl;
}

Measured memory_bytes: 3624
#include <stdio.h>
#include <stdlib.h>

int main(void) {
  int N, i;
  int l[1000] ,r[1000], a[1000];
  int ans = 0;

  scanf("%d", &N);

  for ( i = 0; i < N; i++)
  {
    scanf("%d", &l[i]);
    scanf("%d", &r[i]);
    a[i] = r[i] - l[i] +1;
  }
  for ( i = 0; i < N; i++)
  {
    ans += a[i];
  }
  printf("%d", ans);
}

Measured memory_bytes: 128
import itertools
import math 
n = int(input())
# 順列
# permutations(list, n) で list から n 個選んで並べる
loc = [list(map(int, input().split())) for i in range(n)]
#print(loc)
root = list(itertools.permutations(list(range(1, n+1)), n))
#print(root)
sum = 0
for i in root:
  temp = 0
  for j in range(len(i)-1):
    temp = temp + math.sqrt(((loc[i[j+1]-1][0]-loc[i[j]-1][0])**2 + 
                             (loc[i[j+1]-1][1]-loc[i[j]-1][1])**2))
    #print(temp)
  sum += temp

print(sum/len(root))

Measured memory_bytes: 7972
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

W, H, N = map(int, input().split())

lx = 0
rx = W
by = 0
ty = H
for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1:
        lx = max(lx, x)
    if a == 2:
        rx = min(rx, x)
    if a == 3:
        by = max(by, y)
    if a == 4:
        ty = min(ty, y)
if rx - lx < 0 or ty - by < 0:
    print(0)
else:
    s = (rx - lx) * (ty - by)
    print(s)

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

template <typename T>
void print(const T &v);

const int MAX = 510000;
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main()
{
    COMinit();
    ll n, m, k;
    cin >> n >> m >> k;
    ll comb = COM(n * m - 2, k - 2);
    // cout << "comb:" << comb << endl;
    ll sum = 0;
    for (int i = 0; i <= n - 1; i++)
    {
        for (int j = 0; j <= m - 1; j++)
        {
            ll tmp = (n - i) % MOD * (m - j) % MOD * (i + j) % MOD;
            if (i != 0 && j != 0)
            {
                tmp = (tmp * 2) % MOD;
            }
            sum = (sum + tmp) % MOD;
        }
    }
    cout << (sum * comb) % MOD << endl;
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << " ";
        cout << v[i];
    }
    cout << endl;
}


Measured memory_bytes: 12160
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    int w,h,n;
    scanf("%d",&h);
    scanf("%d",&w);
    scanf("%d",&n);
    int x;
    if(h>=w) x=h;
    else x=w;
    int c;
    if(n%x==0) c=n/x;
    else c=n/x+1;
    printf("%d",c);
    return 0;
}




Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String t = sc.nextLine();
        t = t.replaceAll("apple", "@@@zzzzzzz");
        t = t.replaceAll("peach", "apple");
        t = t.replaceAll("@@@zzzzzzz", "peach");
        System.out.println(t);
    }
}


Measured memory_bytes: 25856
#include <stdio.h>

int digit(long long int A){
	long long int a = A;
	int ans;
	for(ans = 0; a != 0; a /= 10){
		ans++;
	}
	return ans;
}

int main(){
	long long int N, A;
	int ans;
	scanf("%lld", &N);
	for(A = 1; A * A <= N; A++){
		if(N % A == 0){
			ans = digit(N / A);
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        h1: i32,
        m1: i32,
        h2: i32,
        m2: i32,
        k: i32,
    };
    let t_up = 60 * h1 + m1;
    let t_down = 60 * h2 + m2;

    let ans = t_down - k - t_up;

    println!("{}", ans)
}


Measured memory_bytes: 2180
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
using namespace std;

int min(int a, int b) {
	if (a < b)return a;
	return b;
}

int max(int a, int b) {
	if (a > b)return a;
	return b;
}


int main() {
	int a, b, c;
	cin >> a >> b >> c;

	printf("%d %d\n", min(a, min(b, c)), max(a, max(b, c)));


	//system("pause");
	return 0;
}


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

using ll = long long int;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

#define pi 3.14159265358979323846

template<class T>bool ch1000000(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; }




ll cnt_rep = 0;
ll powmod(ll N, ll P, ll M){
  cnt_rep++;
  if(P == 0) return 1;
  if(P%2 == 0){
    ll t = powmod(N, P/2, M);
    return t*t % M;
  }
  return (N * powmod(N, P-1, M)) % M;
}


ll gcd(ll a, ll b){
  ll resi, g, l;
  if(a > b){
    g = a; l = b;
  }else if(b > a){
    g = b; l = a;
  }else{
    return a;
  }
  resi = g % l;
  if(resi != 0){
    return gcd(l, resi);
  }else{
    return l;
  } 
}

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

int ans = 0;
int N, M, Q;

template<typename T>
void showall(vector<T> v){
  rep(i, 0, v.size()){
    cout << v[i] << " ";
  }
  cout << endl;
}

template<typename T>
ll com(T n, T m, T mod){
  ll a = 1, b = 1, ans;
  if(n == m || m == 0){
    ans = 1;
  }else{
    for(ll i = 0;i < m; i++){
      a *= n-i;
      a %= mod;
      b *= i+1;
      b %= mod;
    }
    ans = (a * powmod(b, mod-2, mod)) % mod;
  }
  
  return ans;
}



int main() {
  ll N;
  cin >> N;
  string ans = "";
  bool z = false;
  ll a = 1;


  while(true){
    N--;
    ll resi = N % 26;
    char code = resi + 'a';
    ans += code;
    N /= 26;
    if(N <= 0) break;
  }

  reverse(all(ans));
  cout << ans << endl;



  
  
  

  
  // cout << setprecision(8) << ans << endl;  // For double
}



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

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

string s;
vs32 Rpos;
vs32 Gpos;
vs32 Bpos;

s64 search(vs32& pos, int l, int r)
{
    auto itl = lower_bound(pos.begin(), pos.end(), l);
    auto itr = lower_bound(pos.begin(), pos.end(), r);
    s64 ret = 0;
    ret += itr - itl;
    if ((l + r) % 2 == 0)
    {
        ret -= upper_bound(pos.begin(), pos.end(), (l + r) / 2) - lower_bound(pos.begin(), pos.end(), (l + r) / 2);
    }
    return ret;
}

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

    int n;
    cin >> n;
    cin >> s;

    rep (i, n)
    {
        if (s[i] == 'R') Rpos.push_back(i);
        else if (s[i] == 'G') Gpos.push_back(i);
        else if (s[i] == 'B') Bpos.push_back(i);
    }

    s64 ans = 0;
    for (int l = 0; l < n; ++l)
    {
        for (int r = l + 1; r < n; ++r)
        {
            if (s[l] == s[r]) continue;
            if (s[l] == 'R' && s[r] == 'G')
            {
                ans += search(Bpos, l, r);
            }
            else if (s[l] == 'R' && s[r] == 'B')
            {
                ans += search(Gpos, l, r);
            }
            else if (s[l] == 'G' && s[r] == 'R')
            {
                ans += search(Bpos, l, r);
            }
            else if (s[l] == 'G' && s[r] == 'B')
            {
                ans += search(Rpos, l, r);
            }
            else if (s[l] == 'B' && s[r] == 'R')
            {
                ans += search(Gpos, l, r);
            }
            else if (s[l] == 'B' && s[r] == 'G')
            {
                ans += search(Rpos, l, r);
            }
        }
    }

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



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


/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define pb push_back


/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
const int inf = pow(2, 62);
const int mod = 1e9 + 7;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};
const string alpha = "abcdefghijklmnopqrstuvwxyz";

/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}
template<class T> void printans(vector<T> v){
    rep(i,0,v.size() - 1){
        cout << v[i] + 1 << " ";
    }
    cout << v[v.size() - 1] + 1 << endl;
}

/* general_method */
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; }

template<typename T>
auto cut(T &a, int l, int r){
    return T(a.begin()+l, a.begin()+r);   
}


/* main */



signed main(){

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

    bool field[100][100];

    rep(i,0,100){
        rep(j,0,100){
            if(i < 50) field[i][j] = true;
            else field[i][j] = false;
        }
    }

    int a, b; cin >> a >> b; a--; b--;

    for(int i = 0; i < 50; i += 2){
        for(int j = 0; j < 100; j+= 2){
            if(a > 0){
                field[i][j] = false;
                a--;

            }
        }
    }

    for(int i = 52; i < 100; i += 2){
        for(int j = 0; j < 100; j += 2){
            if(b > 0){
                field[i][j] = true;
                b--;
            }
        }
    }

    cout << 100 << " " << 100 << endl;

    rep(i,0,100){
        rep(j,0,100){
            if(field[i][j]) cout << "#";
            else cout << ".";
        }
        cout << endl;

    }
















    














    









    






    

}



Measured memory_bytes: 256
n, k = map(int,input().split())
a = [0] * n
for i in range(k):
    d = int(input())
    #b = [0] * d
    b = list(map(int,input().split()))
    for j in range(d):
        a[b[j]-1] += 1

ans = 0
for i in range(n):
    if a[i]== 0:
        ans += 1

print(ans)

Measured memory_bytes: 9200
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=-1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

A,B=get_i
if (A*B).even?
    puts "No"
else
    puts "Yes"
end

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

int main() {
  int H,W,K,ans=0; cin>>H>>W>>K;
  vector<vector<char>> C(6,vector<char>(6));
  rep(i,H){
    rep(j,W){
      cin>>C.at(i).at(j);
    }
  }

for (int t = 0; t < (1 << H); t++) {
  for(int k=0; k<(1<<W);k++){
    bitset<6> s(t); 
    bitset<6> l(k);
    int sum = 0;
  rep(i,H){
    rep(j,W){
      if(s.test(i)&&l.test(j)&&C.at(i).at(j)=='#') sum++;
    }
  }
  if(sum==K) ans++;

    }
  }
cout<<ans;
}

Measured memory_bytes: 3624