akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

int main() {
  int c[3][3]{};
  for (auto &r : c)
    for (auto &e : r) cin >> e;

  bool flag{false};
  for (int a0 = 0; a0 <= c[0][0]; ++a0) {
    int b0 = c[0][0] - a0, b1 = c[1][0] - a0, b2 = c[2][0] - a0,
        a1 = c[0][1] - b0, a2 = c[0][2] - b0;
    if ((flag = a1 >= 0 && a2 >= 0 && a1 + b1 == c[1][1] &&
                a1 + b2 == c[2][1] && a2 + b1 == c[1][2] && a2 + b2 == c[2][2]))
      break;
  }
  cout << (flag ? "Yes" : "No") << endl;
}


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

#define INF 1000000021
#define MOD 1000000007
#define pb push_back
#define sqr(a) (a)*(a)
#define M(a, b) make_pair(a,b)
#define T(a, b, c) make_pair(a, make_pair(b, c))
#define F first
#define S second
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 222222

using namespace std;
//using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const ld pi = 2 * acos(0.0);
template<class T> bool umin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool umax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int main()
{
	string s;
	cin >> s;
	for(int i = 0; i < s.size(); i ++)
		if(s[i] == '?')
			s[i] = 'D';
		cout << s;





	





	getchar();
	getchar();
	return 0;
	//ios::sync_with_stdio(false);
	//cin.tie(0);
}

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

char TF( char a, char b )
{
    if( a == 'T' && b == 'F' )
        return 'F';
    else
        return 'T';
}

int main()
{
    int n;

    cin >> n;

    char c[n];
    cin >> c[0] >> c[1];
    
    char res = TF( c[0], c[1] );
    for( int i = 2; i < n; i++ )
    {
        cin >> c[i];
        res = TF( res, c[i] );
    }

    cout << res << endl;

    return 0;
}


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

#include <iostream>
using namespace std;
int main() {
  int k;
  cin >> k;
  int a, b;
  cin >> a >> b;
  if ((a % k == 0) || (b % k == 0) || (b > (k + a - (a % k))))
    cout << "OK\n";
  else
    cout << "NG\n";
  return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <utility>
#include <map>
int main(){
	int A, B, X;
	std::cin >>A>>B>>X;
    if(X<A){
        std::cout << "NO" <<std::endl;
        return 0;
    }
	if(X-A<=B){
         std::cout << "YES"<<std::endl;
    } 
    else{
        std::cout << "NO"<<std::endl;
    }
	return 0;
}

Measured memory_bytes: 256
n = int(input())
x = 1
for i in range(1,n+1):
    x *=i

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

a = factorize(x)
prime= []
num = []
for s in a:
    if s[1]>1:
        prime.append(s[0])
        num.append(s[1])
ans = 0
ab24 = []
ab14 = []
ab4 = []
alls = []
for n,p in zip(num,prime):
    if n>=74:
        ans += 1
    if n>=24:
        ab24.append([p,n])
    if n>=14:
        ab14.append([p,n])
    if n>=4:
        ab4.append([p,n])
    alls.append([p,n])

ans += len(ab24)*(len(alls)-len(ab24)) + len(ab24)*(len(ab24)-1)
ans += len(ab14)*(len(ab4)-len(ab14)) + len(ab14)*(len(ab14)-1)
ans += len(ab4)*(len(ab4)-1)*(len(alls)-2)/2
print(int(ans))

Measured memory_bytes: 3064
S = raw_input()
T = raw_input()

LS = len(S)
LT = len(T)

if LS < LT:
  print 'UNRESTORABLE'
  exit()

answers = []
SA = S.replace('?', 'a')
for i in xrange(LS - LT + 1):
  # T start at S[i]
  for j in xrange(LT):
    if S[i+j] != '?' and S[i+j] != T[j]:
      break
  else:
    answers.append(SA[:i] + T + SA[i+LT:])

if len(answers) == 0:
  print 'UNRESTORABLE'
  exit()

print sorted(answers)[0]

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

struct Graph {
  size_t n;
  int cnt;
  vector<vector<int>> g;
  vector<bool> isArt;
  vector<int> ord, low;
  vector<pair<int, int>> bridges;

  Graph(size_t n) : n(n), cnt(0), g(n), ord(n, -1), low(n, -1), isArt(n, false) {}

  void addEdge(int u, int v) {
    g[u].push_back(v);
    g[v].push_back(u);
  }
  void dfs(int u, int p) {
    ord[u] = low[u] = cnt++;
    for (auto&& v : g[u]) {
      if (ord[v] == -1) {
        dfs(v, u);
        low[u] = min(low[u], low[v]);
        if (ord[u] <= low[v]) isArt[u] = (ord[u] > 0) || (ord[v] > 1);
        if (ord[u] < low[v]) bridges.push_back({min(u, v), max(u, v)});
      } else if (v != p) {
        low[u] = min(low[u], ord[v]);
      }
    }
  }
  void biconnectedComponents() {
    for (int i = 0; i < static_cast<int>(n); ++i) {
      if (ord[i] == -1) dfs(i, -1);
    }
  }
};

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

  int n, m; cin >> n >> m;
  Graph g(n);
  while (m--) {
    int s, t; cin >> s >> t;
    g.addEdge(s, t);
  }
  g.biconnectedComponents();

  sort(begin(g.bridges), end(g.bridges));
  for (auto&& p : g.bridges) {
    cout << p.first << ' ' << p.second << endl;
  }
  return 0;
}



Measured memory_bytes: 4644
#include <bits/stdc++.h>
using namespace std;
bool stu[505][505], c[505];
int n, m, a[100005],b[100005], ans;
int main(int argc, char **argv) {
    cin >> n >> m;
    for(int i=1;i<=m;i++)
        cin >> a[i] >> b[i];
    for(int i=1;i<=n;i++) {
        stu[i][i]=1;
        for(int j=m;j>=1;j--) {
            bool x=stu[i][a[j]],y=stu[i][b[j]];
            if(x!=0&&y!=0) {
                c[i]=1;
                break;
            }
            else if(x) stu[i][b[j]]=1;
            else if(y) stu[i][a[j]]=1;
        }
    }
    for(int i=1;i<n;i++) {
        if(c[i]) continue;
        for(int j=i+1;j<=n;j++) {
            if(c[j]) continue;
            bool flag=1;
            for(int k=1;k<=n;k++)
                if(stu[i][k]&&stu[j][k]) flag=0;
            ans+=flag;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h> 
#define LL long long
#define clr(x,i) memset(x,i,sizeof(x))
using namespace std;
const int N=2007;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,K,q,a[N],mx=0,mi=1e9;
bool ban[N];
bool check(int id,int x)
{
	clr(ban,0); ban[0]=ban[n+1]=1;
	for(int i=1;i<=n;i++) if(a[i]<a[id]) ban[i]=1;
	int ls=id,rs=id;
	while(!ban[ls-1]) ls--;
	while(!ban[rs+1]) rs++;
	if(rs-ls+1<K) return 0;
	int len=0,cnt=0,res=0;
	for(int i=1;i<=n+1;i++){
		if(ban[i]) {
			if(len>=K) res+=min(len-K+1,cnt);
			len=cnt=0;continue;
		}
		len++; if(a[i]-a[id]<=x) cnt++;
//		if(len>=K&&len-K>=cnt) res++;
	}
	return res>=q;
}
int cal(int id)
{
	int l=0,r=mx-mi+1,mid=r,ret=r;
	while(l<=r){
		mid=(l+r)>>1;
		if(check(id,mid)) ret=mid,r=mid-1;
		else l=mid+1;
	}
	return ret;
}
int main()
{
//	freopen("E.in","r",stdin);
	n=read();K=read();q=read();
	for(int i=1;i<=n;i++) a[i]=read(),mx=max(mx,a[i]),mi=min(mi,a[i]);
	int ans=2e9;
//	cal(10);
	for(int i=1;i<=n;i++){
		int re=min(ans,cal(i));
		ans=re;
//		cout<<" cal "<<i<<' '<<re<<endl;
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
g=[[] for _ in range(n)] 
for _ in range(m):
    a,b=map(int,input().split())
    g[a-1].append(b-1)

from collections import deque 

def bfs(u, g): #uからの最短経路を求める
    u-=1
    queue = deque([u])
    d=[-1]*n
    d[u]=0
    while queue:
        v=queue.popleft()
        for i in g[v]:
            if d[i] is -1:
                d[i]=d[v]+1
                queue.append(i)
    return d

d = bfs(1,g) #dは頂点sからの最短経路
if d[-1]==2:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Measured memory_bytes: 31780
#include<bits/stdc++.h>
#include <time.h>
using namespace std;
#include <math.h>
#define ll long long 
// to increase precision
// std::cout<<std::fixed;
// 	std::cout<<std::setprecision(6)<<z;
//clock_t tStart = clock();
//printf("Time taken: %.9fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
#define max1 1000007
long long int mod =1e9+7;


int main(){	
//ios_base::sync_with_stdio(false);
	int x,y;
	cin>>x>>y;
	if((y-2*x)<0){
		cout<<"No"<<endl;
	}
	else if( (y-2*x)%2==1){
		cout<<"No"<<endl;
	}
	else{
		int b=(y- 2*x)/2;
		if(b>x){
			cout<<"No"<<endl;
		}
		else{
			cout<<"Yes"<<endl;
		}
	}




		
}

Measured memory_bytes: 3596
import java.io.*;
class Main
{
public static void main(String args[])throws IOException
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
int min1=0;
for(int i=0;i<3;i++)
{
int x=Integer.parseInt(input.readLine());
if(i==0)min1=x;
if(min1>x)min1=x;
}
int min2=0;
for(int i=0;i<2;i++)
{
int x=Integer.parseInt(input.readLine());
if(i==0)min2=x;
if(min2>x)min2=x;
}
System.out.println(min1+min2-50);
}
}

Measured memory_bytes: 17004
//
//  main.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;


int main()
{
    
    double c,a,b;
    cin >> c >> a >> b;
    cout << c*a/2 << endl;
    
    
    return 0;
}


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

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

using namespace std;

using ll = long long int;

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec)
{
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  }
  return os;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k, tmp, result = 0;
  cin >> n >> m;
  vector<vector<int>> v;
  vector<int> s;
  rep(i, m)
  {
    cin >> k;
    vector<int> _v;
    rep(i, k)
    {
      cin >> tmp;
      _v.emplace_back(tmp);
    }
    v.emplace_back(_v);
  }
  for (int i = 0; i < m; ++i)
  {
    cin >> tmp;
    s.emplace_back(tmp);
  }

  for (int i = 0; i < (1 << n); ++i)
  {
    int flag = 0;
    rep(j, v.size())
    {
      int num = 0;
      rep(k, v[j].size())
      {
        rep(l, n)
        {
          if (i & (1 << l))
          {
            if (l + 1 == v[j][k])
              ++num;
          }
        }
      }
      if (num % 2 == s[j])
        ++flag;
    }
    if (flag == m)
      ++result;
  }
  cout << result << endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
B = [0] * 40
for a in A:
  _a = a
  for i in range(40):
    B[i] += _a % 2
    _a >>= 1
KB = [0] * 40
_K = K
P = [[0, 0] for _ in range(40)]
for i in range(40):
  KB[i] = _K % 2
  _K >>= 1
  P[i] = [B[i] * 2 ** i, (N - B[i]) * 2 ** i]
cnt = 0
free = 0
for i in range(39, -1, -1):
  if free == 1:
    cnt += max(P[i])
  elif KB[i] == 0:
    cnt += P[i][0]
  elif P[i][0] >= P[i][1]:
    cnt += P[i][0]
    free = 1
  else:
    cnt += P[i][1]
print(cnt)

Measured memory_bytes: 69136
#include<iostream>
#include<cmath>

using namespace std;

int main()
{
  int x;
  cin>>x;
  int ans;
  int now = x;
  while(true)
  {
    bool flag = false;
    for(int i = 2;i<sqrt(now);i++)
    {
     	if(now % i == 0)
        {
            flag = true;
            break;
        }
    }
    
    if(!flag)
    {
      ans = now;
      break;
    }
    else{
      now++;
    }
  }
  
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mx 505
using namespace std;
int arr[mx][mx];
main(){
	int n,m,q;
	cin>>n>>m>>q;
	int a[n+1][n+1];
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		arr[a][b]++;
	}
	
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			arr[i][j] += arr[i][j-1];
		}
	}
	while(q--){
		int a,b;
		cin>>a>>b;
		int count = 0;
		for(int i=a;i<=b;i++){
			count += (arr[i][b] - arr[i][i-1]);
		}
		cout<<count<<endl;
	}
}


Measured memory_bytes: 1920
N = int(input())
A = list(map(int, input().split()))

l=1; r=1

XOR = A[0]
SUM = A[0]

answer = 0

while True:
  if r < N: #r増やす余地あり
    if XOR^A[r] == SUM + A[r]: #rを1増やしても成立
      XOR = XOR ^ A[r]
      SUM = SUM + A[r]
      r+=1
      continue
    else: # rをこれ以上増やせないので、lを増やす
      if l==r: # rもlと1増やす
        answer +=1
        XOR = A[r]
        SUM = A[r]
        l+=1
        r+=1        
      else: # lのみ1増やす
        answer += r-(l-1)
        XOR = XOR ^ A[l-1]
        SUM = SUM - A[l-1]
        l+=1
  else:
    answer +=  (N-(l-1))*(N-(l-1)+1) //2 # (N-(l-1))C2
    break

print(answer)

Measured memory_bytes: 24840
#include <stdio.h>

int max(int ary[100], int t, int prev);

int main (int argc, char *argv[]) {
    int k, t;
    scanf("%d", &k);
    scanf("%d", &t);
    int i = 0;
    int a[100];
    int b[100];
    int scanned = 1;
    while (i < 100 && scanned == 1) {
        scanned = scanf("%d", &a[i]);
        if (scanned == 1) {
            b[i] = a[i];
        }
        i++;
    }
    int day[10001];
    day[0] = -1;
    for (i = 1; i < k + 1; i++) {
        day[i] = max(b, t, day[i-1]);
        b[day[i]]--;
    }
    
    int count = 0;
    for (i = 1; i < k + 1; i++) {
        //printf("%d,", day[i]);
        if (day[i] == day[i-1]) count++;
    }
    printf("%d\n", count);
    return 0;
}

int max(int ary[100], int t, int prev) {
    int i;
    int max = 0;
    int maxi = 0;
    for (i = 0; i < t; i++) {
        if (i != prev && ary[i] != 0) {
            if (ary[i] > max){
                //printf("max=%d\n", max);
                max = ary[i];
                maxi = i;
            }
        } else if (i == prev && max == 0) {
            maxi = i;
        }
    }
    return maxi;
}

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

double dist( const vector<int>& a, const vector<int>& b ) {
	double d = 0;

	for( int i = 0; i < a.size(); ++i ) {
		int t = a.at( i ) - b.at( i );
		d += t * t;
	}

	return sqrt( d );
}

int main() {
	int N, D;
	cin >> N >> D;

	vector<vector<int>> X( N, vector<int>( D ) );
	for( int i = 0; i < N; ++i ) {
		for( int j = 0; j < D; ++j ) {
			cin >> X.at( i ).at( j );
		}
	}

	int count = 0;

	for( int i = 0; i < N; ++i ) {
		for( int j = 0; j < N; ++j ) {
			if( i <= j ) { continue; }

			double d = dist( X.at( i ), X.at( j ) );

			if( d - (int)d == 0 ) {
				count += 1;
			}
		}
	}

	cout << count << endl;
}


Measured memory_bytes: 256
using System;
using System.Linq;
namespace ABC137
{
    class Question_B
    {
        static void Main()
        {
            var input = Console.ReadLine()
                               .Split(' ')
                               .Select(int.Parse);
            var k = input.ElementAt(0);
            var x = input.ElementAt(1);
            Console.WriteLine(string.Join(" ", Enumerable.Range(x - k + 1, k * 2 - 1)));
        }
    }
}

Measured memory_bytes: 11348
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int page_num;
	cin>>page_num;
	int pass_num;
	cin>>pass_num;
	if(page_num==pass_num){
		cout<<"Yes";
		return 0;
		}
	else{
		cout<<"No";
		return 0;
	}
	
	return 0;
}

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

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) {
        ll d = euclid(b, a % b, y, x);
        return y -= a / b * x, d;
    }
    return x = 1, y = 0, a;
}

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    string s; cin >> s;
    int d = 0;

    for (char c : s) {
        if (c == '(') d++;
        if (c == ')') d--;
        if (c == '*') {
            cout << d << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 3248
n = int(input())
s = [input() for _ in range(n)]
d = {}
for i in range(n):
    d[s[i]] = d.get(s[i],0)+1

m = max(d.values())
lst = []
for key in d:
    if d[key] == m:
        lst.append(key)

lst.sort()
for i in lst:
    print(i)




Measured memory_bytes: 35220
import java.util.Scanner;

public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();

		if (a <= b){
			// 出力
			System.out.println(a);
		} else {
			// 出力
			System.out.println( a-1 );
		}
	}
}

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

#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}
int f(LL x){
    return to_string(x).size();
}
int main(){
    LL N;
    cin>>N;
    int res=f(N);
    for(LL i=1;i*i<=N;i++)
        if(N%i==0)chmin(res,max(f(i),f(N/i)));
    cout<<res<<endl;
    return 0;
}


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

int main() {
    int N, X; cin >> N >> X;
    int cnt = 0;
    vector<ll> diff;
    for (int i = 0; i < N; i++)
    {
        int x; cin >> x;
        diff.push_back(abs(X-x));
    }

    ll ans = diff[0];
    for (int i = 1; i < N; i++)
    {
        ans = __gcd(ans, diff[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1400
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            coin = i * 500 + j * 100 + k * 50
            if coin == x:
                ans+=1
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>

using namespace std;
typedef long long ll;
ll mod = 1000000007;

int main()
{
	ll a, b, k;
	cin >> a >> b >> k;
	if(a>=k)
	{
		a-=k;
		cout << a << ' ' << b <<endl;
	} 
	else
	{
		k-=a;
		cout << 0 << ' ' << max(0ll, b-k) << endl;
	}
	return 0;
}


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

using namespace std;

typedef long long int ll;
typedef long double ld;

int main()
{
//	int a, b, c, d, e, f, x, k, y, p, r, n = 1;
	
	string s, s1, s2;
	
	ld l1, l2, l3, l4;
	
//	cin >> a;
	
	char c;
	cin >> c;
	
	if(c >= 'A' && c <= 'Z') cout << "A";
	else cout << "a";
}

Measured memory_bytes: 3568
#include <algorithm>
#include <cmath>
#include <climits>
#include <functional>
#include <iostream>
#include <queue>
#include <string>
#include <numeric>
#include <vector>
#include <unordered_set>

using namespace std;
using ll = long long;
template<typename T> void print(T t) {cout << t << endl;}


int main() {
	int N, A, B, p;
	cin >> N >> A >> B;
	int count[3] = {}; 
	for (int i = 0; i < N; i++) {
		cin >> p;
		if (p <= A) count[0]++;
		else if (p <= B) count[1]++;
		else count[2]++;
	}
	print(min({ count[0], count[1], count[2] }));
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
#define fi first
#define se second
#define upb upper_bound
#define lwb lower_bound
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;

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

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y){
    if(y<=0) return 1;
    ll ans = 1;
    x %= mod;
    while(y){
        if(y&1)
            ans = (x * ans) % mod;
        x = (x * x) % mod;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = (a - b); if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = (a + b); if(c >= mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

//------------------------------------------------------------------------------------------

//const ll N = 2e5 + 1;
//vector<ll> adj[N];
//bool visited[N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cout<<fixed<<setprecision(10);

	ll x;
	cin>>x;
	if(x>=30)cout<<"Yes";
	else cout<<"No";


    return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  int n;
  cin>>n;
  vector<int> a(n);
  for(auto&& e: a) 
  {
    cin>>e;
    e--;
  }
  int ans=0;
  for (int i = 0; i < n; ++i)
  {
    if(a[a[i]]==i) ans++;
  }
  cout<<ans/2<<endl;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int lli;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef pair <lli,lli> pii;
#define ff first
#define ss second
#define MOD 1000000007
#define pb push_back
#define EPS 1e-6
 
 
 
int main()
{
    fast;
    lli n;
    cin>>n;
    map<int,int> mp;
    for(lli i=1; i<=n; i++){
        int x;
        cin>>x;
        mp[x]=i;
    }
    for(auto i:mp){
        cout<<i.ss<<" ";
    }
    
    return 0;
}

Measured memory_bytes: 5504
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

using ll = int_fast64_t;

template <class T> using vt = vector<T>;
template <class T> using vvt = vector<T>;
using vi = vt<int>;
using vvi = vvt<int>;
using vl = vt<ll>;
using vvl = vvt<ll>;
using pi = pair<int, int>;

constexpr int INF = 1 << 30; // 2倍するとオーバーフローする
// constexpr ll INFL = 1 << 58;
constexpr int dx[] = {0, 1, 0, -1};
constexpr int dy[] = {1, 0, -1, 0};

// [a, b)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); i--)
// [a, b]
#define RANGE(i, a, b) for (int i = (a); i <= (b); i++)
#define RANGER(i, a, b) for (int i = (b); i >= (a); i--)
// [0, n)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) RFOR(i, 0, (n))

#define ALL(i) i.begin(), i.end()

inline int gint() {
  int a;
  cin >> a;
  return a;
}

int main() {
  int N, K;
  cin >> N >> K;
  auto h = vi(N); // h[i]=i+1番目の木の高さ
  REP(i, N) cin >> h[i];
  sort(ALL(h)); // 小さいものから並ぶ
  int result = INF;
  RANGE(i, 0, N - K) {
    int mn = h[i], mx = h[i + K - 1];
    result = min(result, mx - mn);
  }
  cout << result << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<vector>
#include<iomanip>
#include<map>
#include<set>
#include<utility>
#include<iterator>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
//#define t ll t;cin>>t;while(t--)
#define nn cout<<endl;
#define ff(a,n) for(ll i=a;i<n;i++)
#define cY cout<<"YES\n"
#define cN cout<<"NO\n"
#define cy cout<<"Yes\n"
#define cn cout<<"No\n"
#define sc second
#define fs first
#define c(a) cout<<a<<endl

void solve()
{
	ll n, d; cin>>n>>d;
	ll ans=0;
	while(n--)
	{
		ll x, y; cin>>x>>y;
		if(sqrt(x*x+y*y)<=d)ans++;
	} 
	cout<<ans;
}

int main()
{
	solve();
}
/*

20 100000
14309 -32939
-56855 100340
151364 25430
103789 -113141
147404 -136977
-37006 -30929
188810 -49557
13419 70401
-88280 165170
-196399 137941
-176527 -61904
46659 115261
-153551 114185
98784 -6820
94111 -86268
-30401 61477
-55056 7872
5901 -163796
138819 -185986
-69848 -96669


*/


Measured memory_bytes: 3604
#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <random>
#include <iomanip>
#include <limits>
 
using namespace std;
 
typedef long long ll;
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<int> G[100005];
std::vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define re(i,a,b) for(i=a;i<=b;i++)
 
ll i,j,k,l,ii,jj;
ll n,m,a,b,c,d,ans,num,ddx,ddy;
ll x[100005],y[100005];
char s[300004];


int main(){
	cin>>a>>b;
	c = max(a+b,max(a-b,a*b));
	p(c);
	return 0;
}

Measured memory_bytes: 4992
#include <iostream>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s = "ACL";
  int n;
  cin >> n;
  rep(i,n) cout<<s;
  cout<<endl;

  return 0;
}


Measured memory_bytes: 3104
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
struct pnt{
    double x,y;
};
struct line{
    pnt a,b;
};
bool parallel(line p,line q){
    double vl=(p.a.y-p.b.y)*(q.a.x-q.b.x);
    double vr=(p.a.x-p.b.x)*(q.a.y-q.b.y);
    return vl==vr;
}
bool orthogonal(line p,line q){
    double vl=(p.a.y-p.b.y)*(q.a.y-q.b.y);
    double vr=(p.a.x-p.b.x)*(q.a.x-q.b.x);
    return vl==-vr;
}
int main(){
    ll q;cin>>q;
    while(q--){
	line p,q;
	cin>>p.a.x>>p.a.y>>p.b.x>>p.b.y;
	cin>>q.a.x>>q.a.y>>q.b.x>>q.b.y;
	if(parallel(p,q))cout<<2<<endl;
	else if(orthogonal(p,q))cout<<1<<endl;
	else cout<<0<<endl;
    }
    return 0;
}



Measured memory_bytes: 3192
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main() {
	int n;
	cin >> n;
	vector<int> w(n);
	vector<int> ans;
	int sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> w.at(i);
		sum += w.at(i);
	}
	//sort(w.begin(), w.end());
	int i = 0;
	for (int i = 0; i < n; i++) {
		int s1 = 0, s2 = 0;
		for (int j = 0; j < i; j++) {
			s1 += w.at(j);
		}
		for (int j = i; j < n; j++) {
			s2 += w.at(j);
		}
		int t = abs(s1 - s2);
		ans.push_back(t);
	}
	sort(ans.begin(), ans.end());
	cout << ans.at(0);
}

Measured memory_bytes: 256
#include <stdio.h>
#define M 10000
#define N 500
#define NOT_FOUND -1

int cnt=0,n;

int linearsearch(int a[],int key)
{
  int i=0;
  a[n]=key;
  while(a[i]!=key)
    i++;
  if(i==n)return NOT_FOUND;
  return i;
}


int main(){
  int a[M],j[N],x,y,i;
  
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);

  scanf("%d",&y);
  for(i=0;i<y;i++)
  scanf("%d",&j[i]);

   for(i=0;i<y;i++)
     if(linearsearch(a,j[i])!=NOT_FOUND)cnt++;

   printf("%d\n",cnt);
   return 0;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define ff first
#define ss second
#define pb push_back
#define mod 1000000007
#define pl pair<lli,lli>
#define vl vector<lli>
#define vvl vector<vl>
#define INF (lli)1e18

vvl v,dp;

lli dfs0(lli,lli);
lli dfs1(lli,lli);

lli dfs0(lli u,lli par)
{
	if(dp[u][0]!=-1)
		return dp[u][0];
	lli ans=1;
	for(auto it:v[u])
	{
		if(it!=par)
			ans=(ans*dfs1(it,u))%mod;
	}
	return dp[u][0]=ans;
}

lli dfs1(lli u,lli par)
{
	if(dp[u][1]!=-1)
		return dp[u][1];
	lli ans=1;
	for(auto it:v[u])
	{
		if(it!=par)
			ans=(ans*((dfs1(it,u)+dfs0(it,u))%mod))%mod;
	}
	return dp[u][1]=ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,i,x,y,ans;
    cin>>n;
    v.resize(n+1);
    dp.resize(n+1,vl(2,-1));
    for(i=1;i<n;i++)
    {
    	cin>>x>>y;
    	v[x].pb(y);
    	v[y].pb(x);
    }
    ans=(dfs1(1,-1)+dfs0(1,-1))%mod;
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 19584
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<queue>
#include<list>
#include<stdio.h>
#include<stdlib.h>
#include<map>
#include<cstdio>
#include <iomanip>

#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()

typedef long long ll;

using namespace std;

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

	int limit = 0;
	for (int i = 1; i <= x; i++) {
		if (2*x <= (i*i + i)) {
			limit = i;
			break;
		}
	}

	int excludenum = limit*(limit + 1) / 2 -x;

	for (int i = 1; i <= limit; i++) {
		if (i != excludenum) {
			cout << i << endl;
		}
	}
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long[] V = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            long[] C = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            long X = 0;
            for (int j = 0; j < N; j++)
            {
                if (V[j] > C[j])
                    X += V[j] - C[j];
            }
            Console.WriteLine(X);
        }
    }
}
// 文字列の入力
//string s = Console.ReadLine();

// 整数の入力
//long n = long.Parse(Console.ReadLine());

// 文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');

// 整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();


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

int main(){
    char s[4], t[4];
    int k = 0;

    cin >> s;
    cin >> t;


    for(int i = 0; i < 3; i++){
        if(s[i] == t[i]){
            k++;
        }
    }
    cout << k << "\n";
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		int[] city = new int[N];
		for(int i = 0 ; i < N ; i++){
			city[i] = Math.abs(X-sc.nextInt());
		}
		sc.close();



		int tmp = city[0];
		for(int i = 0 ; i <N ; i++){
			tmp = getgcd(tmp,city[i]);
			if(tmp == 1){
				break;
			}
		}
		System.out.println(tmp);

	}
	public static int getgcd(int m, int n) {
	    if(m < n) return getgcd(n, m);
	    if(n == 0) return m;
	    return getgcd(n, m % n);
	}
}



Measured memory_bytes: 46368
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define vc vector;

const int INF = 100000000;

using namespace std;

void p(int x) {
	cout << x << endl;
}

void pp(string s) {
	cout << s << endl;
}

int main() {
	string s;
	cin >> s;
	int count = 0;
	while (1) {
		string ss;
		cin >> ss;
		if (ss == "END_OF_TEXT")break;

		if (s.length() == ss.length()) {
			bool judge = true;
			rep(i, 0, s.length()) {
				if (s[i] != ss[i] && s[i] != ss[i] + 'a' - 'A' && s[i] != ss[i] + 'A' - 'a') {
					judge = false;
					break;
				}
			}
			if (judge) count++;
		}
	}
	p(count);

	return 0;
}

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


int main () {
    int n ;
    string s;
    cin >> n >> s ;
    string t ,k  ;
    t = s.substr(0, n/ 2);
    k = s.substr(n/2, n);
    if (t == k){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

}


Measured memory_bytes: 256
import collections
n = int(input())
v = list(map(int, input().split()))

count = 0
v1 = []
v2 = []
while count < n:
  v1.append(v[count])
  v2.append(v[count + 1])
  count += 2

c1 = collections.Counter(v1)
c2 = collections.Counter(v2)

num1, count1 = c1.most_common()[0]
num2, count2 = c2.most_common()[0]

if num1 != num2:
  min_count = (n // 2 - count1) + (n // 2 - count2)
elif count1 == count2 and count1 == n // 2:
  min_count = (n // 2)
else:
  if len(c1.most_common()) > 1 and len(c2.most_common()) > 1:
    num3, count3 = c1.most_common()[1]
    num4, count4 = c2.most_common()[1]
    a = (n // 2 - count1) + (n // 2 -count4)
    b = (n // 2 - count2) + (n // 2 -count3)
    min_count = min(a,b)
  else:
    if count1 > count2:
      num2, count2 = c2.most_common()[1]
      min_count = (n // 2 - count1) + (n // 2 - count2)
    else:
      num1, count1 = c1.most_common()[1]
      min_count = (n // 2 - count2) + (n // 2 - count1)
print(min_count)

Measured memory_bytes: 99080
from collections import defaultdict, deque, Counter
N,M,K= map(int,input().split())

friend = defaultdict(list)
#block = defaultdict(list)

for i in range(M):
    a,b= list(map(int,input().split()))
    friend[a].append(b)
    friend[b].append(a)
'''
for i in range(K):
    c,d= list(map(int,input().split()))
    block[c].append(d)
    block[d].append(c)
    '''
block = [list(map(int,input().split())) for i in range(K)]

IDs = [-1] * (N+1)
ID = 0
for i in range(1,N+1):
    if IDs[i] != -1:
        continue
    dq = deque([i])
    while dq:
        v = dq.popleft()
        IDs[v] = ID
        for nv in friend[v]:
            if IDs[nv] == -1:
                dq.append(nv)
    ID += 1

group = Counter(IDs)

ans = []
for i in range(1,N+1):
    temp = group[IDs[i]] - len(friend[i]) - 1
    ans.append(temp)

for c,d in block:
    if IDs[c] == IDs[d]:
        ans[c-1] -= 1
        ans[d-1] -= 1

print(*ans)









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

using namespace std;

int main(int argc, char const *argv[]) {
	int N;
	std::cin >> N;
	std::vector<int> c,s,f;
	c.resize(N-1,0);
	s.resize(N-1,0);
	f.resize(N-1,0);
	for (size_t i = 0; i < N-1; i++) {
		std::cin >> c[i] >> s[i] >> f[i];
	}

	int ans;
	for (size_t i = 0; i < N-1; i++) {
		ans = 0;
		for (size_t j = i; j < N-1; j++) {
			if (ans < s[j]) {
				ans = s[j];
			}
			if (ans % f[j] != 0) {
				ans = (int)(ans/f[j] + 1) * f[j];
			}
			ans += c[j];
		}
		std::cout << ans << '\n';
	}
	std::cout << 0 << '\n';
	return 0;
}


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

int main() {
    int n, d, m, t;
    cin >> n;
    map<int, int> mp;
    for(int i = 0; i < n; ++i) {
        cin >> d;
        mp[d]++;
    }
    cin >> m;
    for(int i = 0; i < m; ++i) {
        cin >> t;
        mp[t]--;
        if(mp[t] < 0) {
            cout << "NO" << '\n';
            return 0;
        }
    }
    cout << "YES" << '\n';
    return 0;
}


Measured memory_bytes: 9600
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(X))
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void solve(long long N, std::vector<long long> T, std::vector<long long> A) {
  ll t = 1;
  ll a = 1;
  rep(n, N) {
    ll tmp = a / A[n];
    if (a % A[n] != 0) {
      tmp++;
    }
    ll a1 = tmp * A[n];
    ll t1 = tmp * T[n];

    tmp = t / T[n];
    if (t % T[n] != 0) {
      tmp++;
    }
    ll t2 = tmp * T[n];
    ll a2 = tmp * A[n];

    if (a1 >= a && t1 >= t) {
      a = a1;
      t = t1;
    } else {
      a = a2;
      t = t2;
    }
  }

  print(t + a);
  return;
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> T(N);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &T[i]);
    scanf("%lld", &A[i]);
  }
  solve(N, std::move(T), std::move(A));
  return 0;
}


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

//Function Macros:
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)

//Type Definitions:
typedef long long ll;
typedef unsigned long long ull;

//Constants:
const int INF = 2e9;
const int MOD = 1e9 + 7;

//Global Variables:

//Prototype Declarations:
int gcd(int, int);

//================ Main Loop ================
int main() {
    int n;
    cin >> n;
    cout << (int)ceil(n / 2.0) << endl;
    return 0;
}
//===========================================

//Functions:
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

Measured memory_bytes: 256
using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Atcoder_Answer
{
    class Program
    {
        const int mod = 1000000007;

        static void Main(string[] args)
        {
            string[] Reader = ReadLine().Split(' ');
            int A1 = int.Parse(Reader[0]);
            int A2 = int.Parse(Reader[1]);
            int A3 = int.Parse(Reader[2]);

            if (A1 + A2 + A3 >= 22) WriteLine("bust");
            else WriteLine("win");
        }

    }

    public static class Extension
    {
        #region 拡張:bool
        #region キャスト関連
        public static int ToInt(this bool Bool)
        {
            if (Bool) return 1;
            else return 0;
        }

        public static string ToString(this bool Bool, string TrueStr, string FalseStr)
        {
            if (Bool) return TrueStr;
            else return FalseStr;
        }
        #endregion
        #endregion

        #region 拡張:int
        #region キャスト関連
        public static char ToAlphaBets(this int Base) => (char)Base;
        #endregion
        #endregion

        #region 拡張:char
        #region 変換関連
        public static char NextAlpha(this char Char) => (char)((Char) + 1); //次の文字を取得
        #endregion
        #endregion

        #region 拡張:int[]
        public static long Sum(this int[] Array)
        {
            int Ret = 0;
            for (int loop = 0; loop < Array.Length; loop++) Ret += Array[loop];
            return Ret;
        }
        #endregion

        #region 拡張: string
        public static string Multi(this string THIS, int Value) 
        {
            string RetValue = "";

            for (int loop = 0; loop < Value; loop++) RetValue += THIS;

            return RetValue;
        }
        #endregion
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long ,long long>pll;

ll gcd(ll a, ll b) {return (!b ? a : gcd(b, a % b));}
ll lcm(ll a, ll b) {return ((a*b)/gcd(a,b));}
bool cmp(int a,int b){return a>b;}

const ll mod = 1e9 + 7;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;
const ld pi = 3.141592653589793;

long long modpow(long long n, long long k, long long mod)
{
if (k == 0) return 1;
long long r = modpow(n * n % mod, k >> 1, mod);
if (k & 1) r = r * n % mod;
return r;
}
vector<vector<int>>adj(50);
vector<bool>vis(2e5+10,0);
int ans = 0;
int cnt = 0;
void dfs(int v){
  vis[v] = 1;
  cnt++;
  for(int i = 0;i<adj[v].size();i++){
        int vi = adj[v][i];
    if(!vis[vi]) dfs(vi);
  }
}
void solve(){
   int n,m;
   cin >> n >> m;
   adj.resize(n);
   int ans = 0;
   for(int i = 0;i<m;i++){
    int v,u;cin >> v >> u;
    v--;u--;
    adj[v].push_back(u);
    adj[u].push_back(v);
   }
   for(int i = 0;i<n;i++){
        cnt = 0;
    if(!vis[i]){
        dfs(i);
        ans = max(ans,cnt);
    }
   }
   cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    solve();
    return 0;
}



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

int main() {
    int k;
    cin >> k;
    int odd, eve;
    if (k%2==0) {
        odd = k/2;
        eve = k/2;
    } else {
        odd = k/2 + 1;
        eve = k/2;
    }
    cout << odd * eve << endl;
}

Measured memory_bytes: 256
n, m, l = map(int, input().split())
A = []
B = []
C = [[0] * l for i in range(n)]
for x in range(n):
	A.append(list(map(int, input().split())))

for x in range(m):
	B.append(list(map(int, input().split())))

for x in range(n):
	for y in range(l):
		sum = 0
		for z in range(m):
			sum += A[x][z] * B[z][y]
		C[x][y] = sum

for x in range(n):
	for y in range(l-1):
		print("{0} ".format(C[x][y]), end = '')
	print(C[x][l-1])

		

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


int main() {
	int n, m, x;
	cin >> n >> m >> x;
	vector<int> c(n);
	vector<vector<int> > a(n, vector<int>(m));

	for (int i = 0; i < n; i++) {
		cin >> c[i];
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}

	int ans = -1;
	int flag = 0;
	rep(s, 1 << n) {
		int cost = 0;
		vector<int> d(m, 0);
		rep(i, n) {
			if (s >> i & 1) {
				cost += c[i];
				rep(j, m) {
					d[j] += a[i][j];
				}
			}
		}
		bool ok = true;
		rep(i, m)
			if (d[i] < x)
				ok = false;
		if (ok) {
			if (flag == 1)
			    ans = min(ans, cost);
			else {
				ans = cost;
				flag = 1;
			}
		}
	}
	
    cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3632
A, B, C = map(int, input().split())
f = True
for i in range(10000):
  if A%2 == 1 or B%2 == 1 or C%2 == 1:
    f = False
    print(i)
    break
  A, B, C = B//2 + C//2, A//2 + C//2, A//2 + B//2
if f:
  print(-1)

Measured memory_bytes: 3060
import sys
import itertools

n = str(input())

fugo =["+","-"]
p = list(itertools.product(fugo,repeat=3))

for i in p:
  shiki = n[0]+i[0]+n[1]+i[1]+n[2]+i[2]+n[3]
  if eval(shiki) == 7:
    print(shiki+"=7")
    sys.exit()

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		final String[] suits = {"S", "H", "C", "D"};
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] cards = new String[n];
		sc.nextLine();
		for(int i=0; i<n; i++){
			cards[i] = sc.nextLine();
		}
		
		for(int i=0; i<4; i++){
			for(int j=1; j<=13; j++){
				boolean flag_found = false;
				for(int k=0; k<n; k++){
					if(cards[k].equals(suits[i] + " " + j)){
						flag_found = true;
						break;
					}
				}
				if(flag_found == false){
					System.out.println(suits[i] + " " + j);
				}
			}
		}
		
	}

}

Measured memory_bytes: 26088
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int K = fs.nextInt();
        int A = fs.nextInt();
        int B = fs.nextInt();

        boolean flag = false;
        for (int i = A; i <= B; ++i) {
            if (i % K == 0) {
                flag = true;
                break;
            }
        }

        if (flag)
            System.out.println("OK");
        else
            System.out.println("NG");
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}

    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() { return Double.parseDouble(next());}
}




Measured memory_bytes: 32580
#include<bits/stdc++.h>
using namespace std;
main()
{
    int a,b,v,c,d,f,g,i,j=100000;
    string z;
    cin>>z;
    a=z.size();
    for(i=0;i<a-2;i++)
    {
        f=(int)(z[i]-48)*100+(int)(z[i+1]-48)*10+(int)(z[i+2]-48);
       // cout<<f<<endl;
       v=abs(f-753);
       if(j>=v)
        j=v;

    }
    cout<<j<<endl;
    return 0;

}


Measured memory_bytes: 256