akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<stack>
#include<iomanip>
#define rep(i,n) for(int i=0;i<((int)n);i++)
#define Rep(i,n0,n) for(int i=n0;i<((int)n);i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<((int)n);j++)
#define W(x) cout<<x<<endl;
#define Debug(x) cout<<"#DEBUG "<<x<<endl;
#define INF (1<<29)
#define INF2 (long long)8*(long long)INF*(long long)INF
#define mod 1000000007
typedef long long ll;

using namespace std;


int min(int x,int y){if(y<x)return y;else return x;}
int max(int x,int y){if(y>x)return y;else return x;}
int fact(int x){int i=1;rep(j,x){i*=(j+1);} return i;}
long long fact(long long x){long long i=1;rep(j,x){i*=(j+1);} return i;}
int gcd(int x, int y)
{
    if(x%y==0)return y;
    else if(y%x==0)return x;
    else return gcd(x%y,y%x);
}
ll gcd(ll x, ll y)
{
    if(x%y==0)return y;
    else if(y%x==0)return x;
    else return gcd(x%y,y%x);
}

int main()
{
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    W(a[2]-a[0])
    return 0;
}


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

int main(){
    int a, b;
    cin >> a >> b;
    int ans = -1;
    for(int i = 0; i < 20000; i++){
        if (i  * 8 / 100 == a && i * 10 / 100 == b){
            ans = i;
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#define ll long long
using namespace std;
#include <cstdint>

template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};

const int M=1000000007;
modint<M> combi(modint<M> a,modint<M>b){
    modint<M> ans=1;
    for(int i=1;i<=b.a;i++){
        ans*=a-i+1;
    }
    for(int i=1;i<=b.a;i++){
        ans/=i;
    }
    return ans;
}

int main(){    
    int tempx,tempy;
    cin>>tempx>>tempy;

    modint<M> x(tempx),y(tempy);
    modint<M> ndiff=y*2-x;
    modint<M> mdiff=x*2-y;
    if(0!=ndiff.a%3||0!=mdiff.a%3){
        cout<<0<<endl;
        return 0;
    }
    modint<M> n=ndiff/3;
    modint<M> m=mdiff/3;
    int ans=combi(n+m,n).a;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fr(i,n,x) for(int i=0;i<n;i+=x)
#define pb push_back
int main(){
	int n,a,b;
	int a1=0,b1=0,c1=0;
	cin>>n>>a>>b;
	int x;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		if(x<=a)
		a1++;
		else
		if(x>a&&x<=b)
		b1++;
		else
		c1++;
	}
	cout<<min(a1,min(b1,c1));
}

Measured memory_bytes: 3656
#include <cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
int main() {
	ll a;
	cin >> a;
	double b;
	cin >> b;
	ll ib = b * 100 + 0.5;
	a *= ib;
	a /= 100;
	cout << a << endl;
	return 0;
}


Measured memory_bytes: 3724
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main() {
    string s;

    cin >> s;
    vector<char> v(s.size(), 'a');

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

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

    if(v[0] == v[1] && v[0] != v[2] && v[2] == v[3]) cout <<"Yes"<<endl;
    else cout << "No" << endl;


}

Measured memory_bytes: 256
import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.insert(0, 0)
B.insert(0, 0)
for i in range(1, N+1):
    A[i] += A[i-1]
for i in range(1, M+1):
    B[i] += B[i-1]
ans = 0
for i in range(N+1):
    sub = 0
    if A[i] <= K:
        sub += i
        sub += bisect.bisect_right(B, K-A[i])-1
    ans = max(sub, ans)
print(ans)

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

#define ll long long

using namespace std;

int main(){
	string s;
	ll k=0,n,x,i;
	char w;
	
	
	while(1){
		cin>>s;
		if(s=="-") break;
		cin>>n;
		k=0;
		for(i=1;i<=n;i++){
			cin>>x;
			k+=x;
		}
		n=s.size();
		k=k%n;
		for(i=1;i<=k;i++){
			w=s[0];
			s.erase(0,1);
			s.insert(n-1,1,w);
		}
		cout<<s<<"\n";
	}
}


Measured memory_bytes: 3160
#include<stdio.h>
#include<string.h>
int kennsaku(char *xp,char *yp);
int main (){
  int a,A_total=0,B_total=0,c;
  char box_A[100]={},box_B[100]={},*box_Ap,*box_Bp;
  scanf("%d",&a);
  for(int i=0;i<a;i++){
    scanf("%s",box_A);
    box_Ap=box_A;
    scanf("%s",box_B);
    box_Bp=box_B;
    c=kennsaku(&box_A[0],&box_B[0]);
      if(c == 0)A_total+=3;
      else if(c == 1)B_total+=3;
      else if(c == 3){
	 A_total++;
	 B_total++;
       }
  }
  printf("%d %d\n",A_total,B_total);
}
int kennsaku(char *xp,char *yp){
  int nagasa,a;
    if(strlen(xp) < strlen(yp))nagasa=strlen(yp);
      else nagasa = strlen(xp);				       
    for(int i=0;i<nagasa;i++){
      if(i == nagasa-1 && xp[i]  == yp[i]){
	a=3;
	break;
      }
      if(xp[i] > yp[i]) {
	a=0;
	break;
      }
	else if(xp[i] < yp[i]){
	a=1;
	break;
	}
      else if(xp[i]  == yp[i])continue;
    }
	return a;
      }



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

using namespace std;

int main(int argc, const char *argv[]) {
  int a, b, c;
  cin >> a >> b >> c;

  int total = a + b + c;
  if (total % 2 == 1) {
    cout << " No" << '\n';
  } else {
    int half = total / 2;
    bool ans = a == half || b == half || c == half;
    cout << (ans ? "Yes" : "No") << '\n';
  }
  return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // Your code here!
    int n;
    cin >> n;
    vector<int> a(n);
    
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    
    vector<int> rev(n);
    for(int i = 0; i<n; i++) rev[a[i] - 1] = i+1;
    for(int i=0; i< n; i++) cout << rev[i] << " ";
    return 0;
}


Measured memory_bytes: 1536
import java.util.*;
 
class Main{
	static Scanner s=new Scanner(System.in);
	static int gInt(){
		return Integer.parseInt(s.next());
	}
	public static void main(String[]A){
		int a=gInt(),b=gInt();
		System.out.println(a<=b?a:a-1);
	}
}

Measured memory_bytes: 21076
k = input()
epoch = k / 50
tweak = 50 - k % 50

ans = [50 + epoch for _ in range(50)]
for i in range(50):
    if i < tweak:
        ans[i] += -50 + tweak - 1
    else:
        ans[i] += tweak

ans_st = " ".join(map(str, ans))
print 50
print ans_st


Measured memory_bytes: 2568
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int int_pow(int x, int n){
  int r=1;
  while (n--)
  {
    r*=x;
  }
  return r;
}
int main(){
  ll S; cin>>S;
  int len=to_string(S).length();
  int mx = (1<<(len-1));
  int m=0;
  ll sum=0;
  while(m<mx){
    ll x;
    ll s_tmp = S;
    int p=-1;
    for(int i=0; i<len-1; i++){
      if(((m>>i)&1)==1){
        x=int_pow(10,i-p);
        p=i;
        sum+=s_tmp%x;
        s_tmp/=x;
      }
    }
    sum+=s_tmp;
    m++;
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 3768
#include<stdio.h>

int CalcutateWater(int);

int main(){
  int w, ans;

  while(1){
    scanf("%d", &w);
    if(w == -1) break;

    ans = 4280 - CalcutateWater(w);
    printf("%d\n", ans);
  }

  return 0;
}

int CalcutateWater(int w){
  int i, data[4], ans ;

  for(i=0; i<4; i++)
    data[i] = 0;

  for(i=0; i<3; i++){
    if(w > 10*(i+1)){
      data[i] = 10;
    }else{
      data[i] = w - 10*i;
      break;
    }
  }

  if(w > 30)
    data[3] = w - 30;

  ans = 1150 + 125*data[1] + 140*data[2] + 160*data[3];
  return ans;
}

Measured memory_bytes: 0
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
#include <set>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s, t;
    cin >> s >> t;
    if ( s.length() < t.length() ) {
        cout << "UNRESTORABLE";
        return 0;
    }
    int c = (int)(s.length() - t.length() );
    for ( int i = c ; i >= 0 ; i-- ) {
        bool y = 0;
        for ( int j = 0 ; j < t.length() ; j++ ) if ( s[j + i] != '?' && s[j + i] != t[j] ) y = 1;
        if ( y == 0 ) {
            for ( int j = 0 ; j < t.length() ; j++ ) s[j + i] = t[j];
            for ( int j = 0 ; j < s.length() ; j++ ) if ( s[j] == '?' ) s[j] = 'a';
            cout << s;
            return 0;
        }
    }
    cout << "UNRESTORABLE";
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i=j;i<k;i++)
int main(){
    int a[10000];int x;int cnt=0;
    int n,q;
    cin>>n;
    rep(i,0,n)cin>>a[i];
    cin>>q;
    rep(i,0,q){
        cin>>x;
        int j=0;
        bool can=true;
        while(x!=a[j]){
            j++;
            if(j==n){
              can=false;
              break;
            }
        }
        if(can)cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 3108
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
  int D;
  cin >> D;
  switch (D) {
    case 22:
      cout << "Christmas Eve Eve Eve" << endl;
      break;
    case 23:
      cout << "Christmas Eve Eve" << endl;
      break;
    case 24:
      cout << "Christmas Eve" << endl;
      break;
    case 25:
      cout << "Christmas" << endl;
      break;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define vll vector<ll>

using namespace std;

const ll N = 3e5+100;
const ll MOD = 1e9+7;

int main()
{

	ll n;
	cin >> n;
	string a,b;
	cin >> a >> b;
	for(int i =0;i<n;i++){
		cout << a[i]<< b[i];
	}cout << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<string.h>
#include<queue>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<cstdlib>
#include<math.h>
#include<set>
#include<array>
using namespace std;

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



#define rep(p) for(int i=0;i<(p);i++)
typedef pair<int, int> pii;

typedef long long ll;
typedef pair<ll, ll>pll;
const int MOD = 1000000007;
const int INF = 1 << 29;




int main() {
	
	
	ll n;
	cin >> n;
	ll mi = n + 1;
	for (ll i = 1; i*i <= n; i++) {
		ll bb;
		if (n % i == 0) {
			bb = n / i;
			mi = min(mi, abs(bb + i));
		}
		

	}
	cout << mi - 2 << endl;
	return 0;
}


Measured memory_bytes: 384
import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val T = sc.next()
        pw.println(T.replace("?", "D"))
    }
}


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

    #define ll long long
    #define pb push_back
    #define mod 1000000007

    int main() {

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

      ll val,i,n;
      cin>>n;
      vector<ll> arr;
      for(i=0;i<n;i++){
        cin>>val; arr.pb(val);
      }
      vector<ll> dp(n,0);
      ll ans=0;
      for(i=n-2;i>=0;i--){
        if(arr[i]>=arr[i+1])
            {dp[i]=dp[i+1]+1; ans=max(ans,dp[i]); }

      }
      cout<<ans;

      return 0;
      
      }

Measured memory_bytes: 1908
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

long long weights[101];
long long values[101];
const long long vMax = 100*1000+10;
long long dp[101][vMax];
long long const INF = 1LL << 60;
int main()
{
    int n;
    long long W;
    cin >> n >> W;
    for(int i=0;i<n;i++){
        cin >> weights[i] >> values[i];
    }
    for(int i=0;i<=n;i++){
        for(long long v=0;v<vMax;v++){
            dp[i][v] = INF;
        }
    }
    dp[0][0] = 0;
    for(int i=0;i<n;i++){
        for(long long v=0;v<vMax;v++){
            if(v >= values[i]){
                dp[i+1][v] = min(dp[i][v],dp[i][v - values[i]] + weights[i]);
            }
            else{
                dp[i+1][v] = dp[i][v];
            }
        }
    }
    long long ret = 0;
    for(long long v=0;v<vMax;v++){
        if(dp[n][v] <= W){
            ret = v;
        }
    }
    cout << ret;
}

Measured memory_bytes: 79104
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FFOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,b) FOR(i,0,b)
#define RREP(i,b) FFOR(i,1,b)
#define PB push_back
#define F first
#define S second
#define BE(c) c.begin(),c.end()
using namespace std;
typedef long long LL;
typedef LL ut;
typedef long double ld;
typedef pair<ut,ut> pr;
typedef vector<pr> Vpr;
typedef vector<ut> VI;
typedef pair<ut,pr> ppr;
typedef priority_queue<pr,Vpr, greater<pr> > PQ;
const int SIZE=5+3*1e+4;
const ut INF=1<<30;
const ld eps=1e-6;
const LL p=7+1e+9;

int main(){
	int n, m;
	
	while(cin >> n >> m && (n || m)){
		char c;
		int state[102] = {0};
		state[0] = state[n + 1] = -1;
		REP(i,m){
			cin >> c;
			if(c == 'A'){
				RREP(j,n){
					if(state[j] == 0){
						state[j] = 1;
						break;
					}
				}
			}
			else if(c == 'B'){
				bool ok = false;
				for(int j = n; j > 0; --j){
					if(state[j] == 0 && state[j + 1] != 1 && state[j - 1] != 1){
						state[j] = 2;
						ok = true;
						break;
					}
				}
				if(!ok){
					RREP(j,n){
						if(state[j] == 0){
							state[j] = 2;
							break;
						}
					}
				}
			}
			else if(c == 'C'){
				if(i){
					RREP(j,n){
						if(state[j] != 0){
							if(state[j + 1] == 0){
								state[j + 1] = 3;
								break;
							}
							else if(state[j - 1] == 0){
								state[j - 1] = 3;
								break;
							}
						}
					}
				}
				else{
					if(n % 2){
						state[(n + 1) / 2] = 3;
					}
					else{
						state[n / 2 + 1] = 3;
					}
				}
			}
			else{
				if(i){
					int left = -500, right, tmp;
					RREP(j,n){
						if(state[j] != 0){
							right = j;
							break;
						}
					}
					int maxium = 0, pos = 0;
					RREP(j,n){
						if(state[j] == 0){
							int t = min(j - left, right - j);
							if(maxium < t){
								maxium = t;
								pos = j;
							}
						}
						if(right <= j){
							left = right;
							bool discovered = false;
							FFOR(k,j + 1,n){
								if(state[k] != 0){
									right = k;
									discovered = true;
									break;
								}
							}
							if(!discovered){
								right = 500;
							}
						}
					}
					state[pos] = 4;
				}
				else{
					state[1] = 4;
				}
			}
		}
		RREP(i,n){
			if(state[i] == 0)
				cout << "#";
			else if(state[i] == 1)
				cout << "A";
			else if(state[i] == 2)
				cout << "B";
			else if(state[i] == 3)
				cout << "C";
			else if(state[i] == 4)
				cout << "D";
		}
		cout << endl;
	}
}

Measured memory_bytes: 1152
#define f(I)(p[I]+h[I]*(h[I]-2*h[i]))
long C,h[2<<17],p[2<<17],X,a;
P[2<<17];
s,t,x,y;
main(i){
	for(scanf("%*d%ld%d",&C,h);~scanf("%d",&a);P[++t]=i-1){
		for(h[i]=a;X=f(P[s]),s<t&&X>f(P[s+1]);s++);
		for(p[i++]=X+=a*a+C;s<t&&(h[y=P[t]]-h[x=P[t-1]])*(f(y)-f(i-1))>(a-h[y])*(f(x)-f(y));t--);
	}
	printf("%ld",X);
}

Measured memory_bytes: 4608
x1,y1,x2,y2 = gets.split.map(&:to_i)

x_3,y_3 = (x2 - x1) - (y2 - y1),(x2-x1) + (y2 - y1)
x_4,y_4 = -(y2-y1),x2-x1
x3,y3 = x_3 + x1,y_3+y1
x4,y4 = x_4 + x1,y_4+y1

puts "#{x3} #{y3} #{x4} #{y4}"


Measured memory_bytes: 1788
if __name__ == '__main__':
    key_in = input()
    data = [int(x) for x in key_in.split(' ')]
    a = data[0]
    b = data[1]
    c = data[2]

    divisor = 0
    for i in range(a, b+1):
        if c % i == 0:
            divisor += 1
    print(divisor)

Measured memory_bytes: 7708
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>

using namespace std;

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

    int res = a + b;
    res = max(res, a - b);
    res = max(res, a * b);

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[]argc){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int n = sc.nextInt();
        int a,b,c;
        int[] t = new int[w];
        for(int i=0;i<w;i++){
            t[i]=i+1;
        }
        for(int i=0;i<n;i++){
            String s = sc.next();
            String[] suuti = s.split(",");
            a = Integer.parseInt(suuti[0])-1;
            b = Integer.parseInt(suuti[1])-1;
            c = t[a];
            t[a] = t[b];
            t[b] = c;
        }
        for(int i=0;i<w;i++){
            System.out.println(t[i]);
        }
    }
}


Measured memory_bytes: 26236
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1e12

#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>
#define vll vector<ll>
#define vpl vector<pll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pr_d(x) cout << fixed << setprecision(15) << x << endl
#define ud(c, x) distance(c.begin(), upper_bound(all(c), x))
#define ld(c, x) distance(c.begin(), lower_bound(all(c), x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep3(i, n) for (int i = (n - 1); i >= 0; --i)
#define rep4(i, a, b) for (int i = (a); i > (b); --i)
#define pb push_back
#define out(x) cout << x << "\n"
bool odd(int i) { return i % 2; }

#define all(v) v.begin(), v.end()
#define size(x) int(x.size())

int gcd(int a, int b) { return __gcd(a, b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
void Yes_No(bool f) {
  if (f)
    printf("Yes\n");
  else
    printf("No\n");
}

void deb_p(pii p) { printf("pair = %d %d\n", p.fi, p.se); }
void deb_i(int i) { printf("i = %d\n", i); }
void deb_v(vector<int> v) {
  printf("v = ");
  for (auto i : v) printf("%d ", i);
  printf("\n");
}
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
//-------------------ここから回答する-----------------------

void solve(void) {
  int a, b;
  cin >> a >> b;
  if (a == b)
    out("Draw");
  else if (a == 1)
    out("Alice");
  else if (b == 1)
    out("Bob");
  else if (a > b)
    out("Alice");
  else
    out("Bob");
}
int main(void) { solve(); }

Measured memory_bytes: 3560
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


ten = a//10 + b//10 + c//10 + d//10 + e//10

aa = [a%10,b%10,c%10,d%10,e%10]
zero = aa.count(0)

if zero == 5:
	print(ten*10)
else:
	for i in range(1,10):
		if  i in aa:
			one = i
			break
	print(ten*10 + (4-zero)*10 +one)

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

int i;

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

    int count = 0;
    for (i = 0; i < n; i++)
    {
        if (a[i] % 2 == 1)
        {
            count++;
        }
    }

    if (count % 2 == 1)
    {
        puts("NO");
    }
    else
    {
        puts("YES");
    }
}

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

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*int recursion(int x)
{
    if(x==0)
    {cout<<x;
        return 0;}
    cout<<x<<" ";
    recursion(x-1);
}*/

int main() {
    long long str;
 cin>>str;
 long long sum=0;
 sum+=1000*(str/500);
 str%=500;
 sum+=5*(str/5);
 cout<<sum;


}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a[3];
	cin >> a[0]  >> a[1] >> a[2];
	sort(a,a+3);
	cout << a[0] << " " << a[1] << " " << a[2] << endl;
	return 0;
}

Measured memory_bytes: 3156
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        int D =sc.nextInt();
        int D2 = D*2+1;
        int opt = N%D2;
        int opt2 = N/D2;
        if(opt==0) System.out.println(opt2);
        else System.out.println(opt2+1);
    }
}


Measured memory_bytes: 23124
import sys, re
from collections import deque, defaultdict, Counter
from math import log10, ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = input()
K = INT()
L = len(N)
dp = [[[0]*2 for _ in range(4)] for _ in range(L+1)]
dp[0][0][0] = 1
for i in range(L):
	for j in range(4):
		for k in range(2):
			nd = int(N[i])
			for d in range(10):
				ni, nj, nk = i+1, j, k
				if d != 0:
					nj += 1
				if nj > K:
					continue
				if k == 0:
					if d > nd:
						continue
					if d < nd:
						nk = 1
				dp[ni][nj][nk] += dp[i][j][k]
ans = dp[L][K][0] + dp[L][K][1]
print(ans)


Measured memory_bytes: 13680
import sys

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

antennas = [a, b, c, d, e]

def isDisConnected(i, j):
    if abs(i - j) > k:
        return True
    return False

idx1 = 0
while(True):
    idx2 = idx1 + 1
    if idx1 == 5:
        break
    while(idx2 < 5):
        if isDisConnected(antennas[idx1], antennas[idx2]):
            print(":(")
            sys.exit()
        idx2 += 1
    idx1 += 1

print("Yay!")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
using namespace std;
using P = pair<int, int>;
typedef long long ll;
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; }
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  int n;
  cin >> n;
  vector<int> X(n), Y(n);
  rep(i, n){
    int x, y;
    cin >> x >> y;
    X[i] = x + y;
    Y[i] = x - y;
  }
  sort(ALL(X));
  sort(ALL(Y));
  cout << max(X[n - 1] - X[0], Y[n - 1] - Y[0]) << endl;
}

Measured memory_bytes: 4824
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	int n; cin >> n;
	vector<int>a(n), b(n); for (auto&& x : a)cin >> x;
	for (int i = 0; i < n; i++) {
		b[i] = a[i] - i + 1;
	}
	sort(b.begin(), b.end());

	int bNum = b.size() % 2 == 0 ? (b[b.size() / 2] + b[b.size() / 2 - 1])/2 : b[b.size() / 2];
	long long sum = 0;
	for (auto&& x : b)sum += abs(x - bNum);
	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<stack>
#include<map>
#include<queue>
#include<vector>
#include<cmath>
#include<set>
#define inf 0x3f3f3f3f
typedef long long ll;

const int maxn=1e5+5;

using namespace std;
string s;

int main()
{
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5])
        printf("Yes\n");
    else
        printf("No\n");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  while(1){
    long long n;
    cin >> n;
    if(n == 0) break;
    long long p[n],j[n];

    long long sum = 0;
    long long maxs;
    for(int i=0;i<n;i++){
      cin >> p[i];
      sum += p[i];
    }

    for(int i=0;i<n-1;i++){
      cin >> j[i];
    }
    
    sort(j, j+n-1);
 
    maxs = sum*n;
    long long num = n-1;
    for(int i=0;i<n-1;i++){
      sum += j[n-i-2];
      maxs = max(maxs, sum*num);
      num--;
    }
    cout << maxs << endl;
  }

  return 0;
}



Measured memory_bytes: 4124
#include <iostream>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <cmath>
#define INF 100000000000
#define MOD 1000000007
#define ll long long int
//#define int long long int
using namespace std;

int main(){
  int N; cin>>N;
  int a ; cin>>a;
  int b; cin>>b;
  cout<<min(a*N,b)<<endl;
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>  // ver2.2.5
#define int long long
#define endl "\n"
#define ALL(v) (v).begin(),(v).end()
#define COUNT(a,i) upper_bound(ALL(a),i)-lower_bound(ALL(a),i)
#define Vi vector<int>
#define VVi vector<Vi>
#define Vs vector<string>
#define Pii pair<int,int>
#define VPii vector<Pii>
#define Tiii tuple<int,int,int>
#define PQi priority_queue<int>
#define PQir priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define itos to_string
#define stoi stoll
#define FI first
#define SE second
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define _ <<' '<<
#define sortr(v) sort(v,greater<>())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define dem(a,b) ((a+b-1)/(b))
#define Vin(a) rep(iI,0,a.size())cin>>a[iI]
#define Vout(a) rep(lZ,0,a.size()-1)cout<<a[lZ]<<' ';cout<<a.back()<<endl
#define VVout(a) rep(lY,0,a.size()){Vout(a[lY]);}
#define VPout(a) rep(lX,0,a.size())cout<<a[lX].FI<<' '<<a[lX].SE<<endl
#define Verr(a) rep(iZ,0,a.size()-1)cerr<<a[iZ]<<' ';cerr<<a.back()<<endl
#define VVerr(a) rep(iY,0,a.size()){Verr(a[iY]);}
#define VPerr(a) rep(iX,0,a.size())cerr<<a[iX].FI<<' '<<a[iX].SE<<endl
#define INF 3000000000000000000  //  3.0*10^18(MAXの1/3くらい)
#define MAX LLONG_MAX
#define MOD 1000000007  //  10^9 + 7
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm
void press(auto &v){v.erase(unique(ALL(v)),v.end());}  //  圧縮
int mypow(int x, int n, int m){  //  累乗x^n(mod m)  O(log(n))
if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}



signed main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
  int x,a,b,n;
  cin >> x >> a >> b >> n;
  string s;
  rep(i,0,n){
    cin >> s;
    if(s=="nobiro") x += a;
    if(s=="tidime") x += b;
    if(s=="karero") x = 0;;
    if(x < 0) x = 0;
  }
  cout << x << endl;
  return 0;
}


Measured memory_bytes: 3212
import numpy as np
import sys
i4 = np.int32
i8 = np.int64
u4 = np.uint32

if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC
    from numba import njit
    from numba.types import int64, Array, uint32
    cc = CC('my_module')

    @cc.export('factorization', (uint32, ))
    @njit
    def factorization(N):
        p = np.zeros(N + 1, u4)
        n_max = int(np.sqrt(N)) + 1
        p[0] = 1
        p[1] = 1
        for i in range(2, n_max):
            if p[i] == 0:
                j = i
                while j <= N:
                    p[j] = i
                    j += i
        for i in range(n_max, N + 1):
            if p[i] == 0:
                p[i] = i
        return p

    @cc.export('solve', (Array(uint32, 1, 'C'),))
    def solve(A):
        a = np.sort(A)
        p_max = a[-1]
        p = factorization(p_max)
        primes_num = 0
        for i in range(p.shape[0]):
            if i == p[i]:
                primes_num += 1
        a_start = 0
        while a[a_start] == 1:
            a_start += 1
            if a_start == a.shape[0]:
                return 0
        a = a[a_start:]
        if len(a) > primes_num:
            return 1
        check = np.zeros(p_max + 1, u4)
        stack = np.empty(20, u4)
        p_stack = 0
        for d in a:
            while d > 1:
                x = p[d]
                for i in range(p_stack):
                    if stack[i] == x:
                        break
                else:
                    stack[p_stack] = x
                    p_stack += 1
                d //= x

            while p_stack > 0:
                p_stack -= 1
                check[stack[p_stack]] += 1

        if check.max() > 1:
            return 1
        else:
            return 0
    cc.compile()
    from my_module import solve, factorization
    exit()

from my_module import solve, factorization

def main(in_file):
    stdin = open(in_file)
    stdin.readline()
    A = np.fromstring(stdin.readline(), u4, sep=' ')
    ans = solve(A)
    if ans:
        g = np.gcd.reduce(A)
        if g > 1:
            ans = 2
        else:
            ans = 1
    p = ['pairwise coprime', 'setwise coprime', 'not coprime']
    print(p[ans])


if __name__ == '__main__':
    main('/dev/stdin')

Measured memory_bytes: 42624
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
int main(){
ll i,j;
char a[3][3];
for(i=0;i<3;i++){
	for(j=0;j<3;j++){
		cin>>a[i][j];
	}
}
if(a[0][0]==a[1][2]&&a[0][1]==a[1][1]&&a[0][2]==a[1][0])
cout<<"YES";
else cout<<"NO";

return 0;}



Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
#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 Forr(i,m,n) for(int i=m;i>n;i--)
#define Sort(a) sort(a.begin(),a.end())
#define pb push_back
#define vl vector<ll>
#define vll vector<vector<ll>>
#define INF 999999999999

int main(){
  int A,B;
  cin>>A>>B;
  if(A<=2*B) cout<<"0"<<endl;
  else cout<<A-2*B<<endl;
return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", ans);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(void) {
	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n);
	rep (i, n) cin >> a[i];
	rep (i, n) cin >> b[i];
	rep (i, n) cin >> c[i];

	sort(rng(a));
	sort(rng(b));
	sort(rng(c));

	bool stop = false;
	vector<int> numB(n), numC(n + 1, 0);
	rep (i, n) {
		numB[i] = upper_bound(rng(b), a[i]) - b.begin();
		
	}	
	rep (i, n) {
		numC[i] = n - (upper_bound(rng(c), b[i]) - c.begin());
		
	}

	vector<ll> sum(n + 1, 0);
	for (int i = n - 1; i >= 0; i--) {
		sum[i] = numC[i] + sum[i + 1];
	}


	ll ans = 0;
	rep (i, n) {
		int Bid = numB[i];

		ans += sum[Bid];
	}

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

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

int main() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << "\n";
    return 0;
}

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

#define rep(i, n) for(int i=0; i < n; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

using namespace std;
using ll=long long;

// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}


int main(){
  int N;
  cin >> N;
  int X[N];
  int sum=0;
  rep(i,N) {cin >> X[i];sum+=X[i];}

  int grab = sum/N;
  int gra = grab+1;
  int ans=0;
  int ans1=0;

  rep(i,N){
    ans += (X[i]-grab)*(X[i]-grab);
    ans1 += (X[i]-gra)*(X[i]-gra);

  }
  cout << min(ans,ans1);
}

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

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

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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n, k;
    cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    map<int, int> cnt;
    rep(i, n) cnt[a[i]]++;
    int sub = max(0,sz(cnt)-k);
    vi t;
    for (auto p : cnt) {
        t.pb(p.second);
    }
    VSORT(t);
    int ans = 0;
    rep(i, sub) ans += t[i];
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 14284
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
//#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> pll;
typedef long double ldouble;
typedef pair<double, double> pdd;

const double PI = acos(-1);
const double EPS = 1e-9;

const int MX = 1<<17;
const int MM = 1000000007;

t3 A, B;

int main()
{
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	A = t3(a, b, c);
	if( a%2 == 0 && b%2 == 0 && c%2 == 0 && a == b && b == c ) printf("-1\n");
	else{
		for(int t = 0;; t++){
			tie(a, b, c) = A;
			if( a%2 == 1 || b%2 == 1 || c%2 == 1 ) return !printf("%d\n", t);
			A = t3((b+c)/2, (c+a)/2, (a+b)/2);
		}
	}
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;


public class Main {

	private static final int MIN_X = 0;
	private static final int MIN_Y = 0;
	private static final int MAX_X = 9;
	private static final int MAX_Y = 9;

	public static final int INK_SMALL = 1;
	public static final int INK_MEDIUM = 2;
	public static final int INK_BIG = 3;
	
	private static int[][] paper = new int[MAX_X + 1][MAX_Y + 1];
	
	private static ArrayList<Integer> dropX = new ArrayList<Integer>();
	private static ArrayList<Integer> dropY = new ArrayList<Integer>();
	private static ArrayList<Integer> dropSize = new ArrayList<Integer>();
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try{
			clearPaper();
			while(true){
				String str = sc.nextLine();
				String[] input = str.split(",");
				dropInk(Integer.valueOf(input[0]), Integer.valueOf(input[1]), Integer.valueOf(input[2]));
			}
		}catch(NoSuchElementException e){
			//½àµÈ¢ÅÌÉÚé
		}finally{
			sc.close();
		}
		
		//³F}XÌÆêÔZ¢}XÌZ³ðoÍ·é
		System.out.println(getNumUnColored());
		System.out.println(getHowMuchDarkest());
	}
	
	public static void clearPaper(){
		for(int x = 0; x <= MAX_X; x++){
			for(int y = 0; y < MAX_Y; y++){
				paper[x][y] = 0;
			}
		}
	}
	
	public static void dropInk(int x, int y, int ink){
		switch(ink){
		case INK_SMALL:
			dropInkSmall(x, y);
			break;
		case INK_MEDIUM:
			dropInkMedium(x, y);
			break;
		case INK_BIG:
			dropInkBig(x, y);
			break;
		}
	}
	
	private static void dropInkSmall(int x, int y){
		paper[x][y]++;
		
		if(MIN_X <= (x - 1)){
			paper[x - 1][y]++;
		}
		if((x + 1) <= MAX_X){
			paper[x + 1][y]++;
		}
		
		if(MIN_Y <= (y - 1)){
			paper[x][y - 1]++;
		}
		if((y + 1) <= MAX_Y){
			paper[x][y + 1]++;
		}
	}
	
	private static void dropInkMedium(int x, int y){
		dropInkSmall(x, y);
		
		if(MIN_X <= (x - 1) && MIN_Y <= (y - 1)){
			paper[x - 1][y - 1]++;
		}
		if((x + 1) <= MAX_X && MIN_Y <= (y - 1)){
			paper[x + 1][y - 1]++;
		}
		
		if(MIN_X <= (x - 1) && (y + 1) <= MAX_Y){
			paper[x - 1][y + 1]++;
		}
		if((x + 1) <= MAX_X && (y + 1) <= MAX_Y){
			paper[x + 1][y + 1]++;
		}
	}
	
	private static void dropInkBig(int x, int y){
		dropInkMedium(x, y);
		
		if(MIN_X <= (x - 2)){
			paper[x - 2][y]++;
		}
		if((x + 2) <= MAX_X){
			paper[x + 2][y]++;
		}
		
		if(MIN_Y <= (y - 2)){
			paper[x][y - 2]++;
		}
		if((y + 2) <= MAX_Y){
			paper[x][y + 2]++;
		}
	}
	
	public static int getNumColored(){
		int numColored = 0;
		for(int x = 0; x <= MAX_X; x++){
			for(int y = 0; y <= MAX_Y; y++){
				if(paper[x][y] != 0){
					numColored++;
				}
			}
		}
		return numColored;
	}

	public static int getHowMuchDarkest(){
		int valueDarkest = paper[0][0];
		for(int x = 0; x <= MAX_X; x++){
			for(int y = 0; y <= MAX_Y; y++){
				if(valueDarkest < paper[x][y]){
					valueDarkest = paper[x][y];
				}
			}
		}
		return valueDarkest;
	}

	public static int getNumUnColored(){
		return 100 - getNumColored();
	}
}

Measured memory_bytes: 0
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>
#define DEBUG true
#ifdef ONLINE_JUDGE
#undef DEBUG
#define DEBUG false
#endif 

using namespace std;

#define TRACE(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr << endl;}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << "[" << *it << " = " << a << "]";
	err(++it, args...);
}

#define MAXN ((int)2e5+5)
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9 + 9)
#define ll long long
#define _ << " " <<
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define LOG(x) if(DEBUG) cerr << x << endl;
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl "\n"
#define pii pair<int,int>
#define mid ((l+r)/2)
#define BASE 29
#define BASE2 41

int n;

struct Node
{
	bool is_end = 0;
	Node* ch[26] = {NULL};
};

Node* head = NULL;

void add(string s)
{
	auto cur = head;
	
	for (int i = 0; i < s.size(); ++i)
	{
		if(cur->ch[s[i]-'a'] == NULL)
			cur->ch[s[i]-'a'] = new Node;
		cur = cur->ch[s[i]-'a'];
	}

	cur->is_end = true;
}

int count(Node* node)
{
	int res = node->is_end;
	for (int i = 0; i < 26; ++i)
		if(node->ch[i])
			res += count(node->ch[i]);
	return res;
}

int hash2(string s)
{
	int res = 0;

	for (int i = 0; i < s.size(); ++i)
		res = (res * BASE + (s[i] - 'a') + 1) % MOD;
	return res;
}

int hash3(string s)
{
	int res = 0;

	for (int i = 0; i < s.size(); ++i)
		res = (res * BASE2 + (s[i] - 'a') + 1) % MOD;
	return res;
}


signed main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	head = new Node;

	vector <pii> v;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		string a;
		cin >> a;
		v.pb({hash2(a), hash3(a)});
		// add(a);
	}

	sort(all(v));

	int ct = 0;
	int t = 0;
	while(t < v.size())
	{
		while(v[t].first == v[t+1].first && v[t].second == v[t+1].second) t++;
		ct++;
		t++;
	}

	cout << ct << endl;

	// cout << count(head) << endl;
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/

Measured memory_bytes: 5284
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

const int n = 50LL;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll k;
    cin >> k;
    vector<ll> a;
    ll r = k % n;
    for (ll i = 0; i < n - r; i++)
    {
        a.push_back(n - 1 - r);
    }
    for (ll i = 0; i < r; i++)
    {
        a.push_back(n);
    }
    for (ll i = 0; i < n; i++)
    {
        a[i] += k / n;
    }
    cout << n << endl;
    for (auto ans : a)
    {
        cout << ans << ' ';
    }
    cout << endl;
}

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

int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

int main(){
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    int g = 0;
    int maximum = 0;
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
        maximum = max(maximum, a.at(i));
        g = gcd(a.at(i), g);
    }
    
    cout << ((maximum >= k && k % g == 0) ? "POSSIBLE": "IMPOSSIBLE") << endl; 
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
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;
} 

 
struct Dinic {
  struct edge {
    int to, cap, rever;
    edge(int to, int cap, int rever):to(to), cap(cap), rever(rever){}
  };
  vector< vector<edge> > graph;
  vector<int> level, iter;
  Dinic(int V):graph(V), level(V), iter(V){}
  void add_edge(int from, int to, int cap) {
    graph[from].emplace_back(to, cap, graph[to].size());
    graph[to].emplace_back(from, 0, graph[from].size()-1);
  }
  void bfs(int s) {
    fill(all(level), -1);
    queue<int> que;
    level[s] = 0;
    que.push(0);
    while(que.size()) {
      int v = que.front(); que.pop();
      for(edge& e : graph[v]) {
        if(e.cap > 0 && level[e.to] < 0) {
          level[e.to] = level[v] + 1;
          que.push(e.to);
        }
      }
    }
  }
  int dfs(int v, int t, int f) {
    if(v == t) return f;
    for(int& i = iter[v]; i < graph[v].size(); i++) {
      edge& e = graph[v][i];
      if(e.cap > 0 && level[v] < level[e.to]) {
        int d = dfs(e.to, t, min(e.cap, f));
        if(d > 0) {
          e.cap -= d;
          graph[e.to][e.rever].cap += d;
          return d;
        }
      }
    }
    return 0;
  }
  int max_flow(int s, int t) {
    int flow = 0;
    while(true) {
      bfs(s);
      if(level[t] < 0) return flow;
      fill(all(iter), 0);
      int f; while((f = dfs(s, t, inf)) > 0) flow += f;
    }
  }
}; 

int main(){
    ll n,m;cin >> n >> m;
    Dinic dn(n);
    rep(i,m){
        ll u,v,c;cin >> u >> v >> c;
        dn.add_edge(u,v,c);
    }
    cout << dn.max_flow(0,n-1) <<endl;
}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
 using namespace std;
 using pii = pair<int, int>;
 using ll = long long;
 #define rep(i, j, n) for(int i = j; i < (int)(n); i++)
 const ll MOD = 1000000007;
 const ll INFL = (1LL << 60);
 const int INFI = (1 << 30);

 int main() {
   ll N, ans = 0; cin >> N;

   for (ll i = 1; i <= N; i++) {
     ll tmp = N / i;
     ans += i * (N / i + 1) * (N / i) / 2;
   }

   cout << ans << endl;
 }


Measured memory_bytes: 3632