akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp>
//#include <functional> // for less
#define PI acos(-1.0)
#define eps 1e-9
#define ll long long
#define ull unsigned long long
#define nl printf("\n")
#define sf scanf
#define pf printf
#define INF (ll)1e15
#define mod 1000000007

///#define isValid(n,m,nx,ny)nx>=0&&nx<n&&ny>=0&&ny<m
///int kx[]={1, 1, -1, -1, 2, 2, -2, -2}; //knight moves
///int ky[]={2,-2,  2, -2, 1,-1,  1, -1}; //knight moves
///int dx[]={1,-1,0,0,1,-1,1,-1};//eight direction
///int dy[]={0,0,1,-1,1,-1,-1,1};//eight direction
 
///using namespace __gnu_pbds;
using namespace std;
 
///inline double toRad(double deg){return deg*PI/180;}
///inline double toDeg(double rad){return rad*180/PI;}
///typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;
 
const int S=223456;
int main()
{
    #ifndef ONLINE_JUDGE
    //freopen("input.txt","r",stdin);
    #endif
    ll x,y;
    while(sf("%lld %lld",&x,&y)==2)
    {
        int ans=1;
        while(1)
        {
            if(x*2<=y)ans++,x*=2;
            else break;
        }
        pf("%d\n",ans);
    }
    return 0;
}
 









 




























Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <time.h>
#include <stdlib.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/__gcd((a),(b))
#define clr(x) x.clear()
#define vi vector<int>
#define vll vector<long long>
#define vvi vector<vi>
#define mp make_pair
#define hell 1000000007
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define all(a) a.begin(),a.end()
#define ign cin.ignore();

#define o_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define o_setll tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

using namespace std;
using namespace __gnu_pbds;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef MY_PROJECT
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

int main()
{
    IOS
    int n,m;
    cin>>n>>m;
    vi v(n);
    int sum=0;
    for(int i=0;i<n;i++)
    {
     cin>>v[i];
     sum=sum+v[i];
    }
    sort(all(v),greater<>());
    if(v[m-1]*4*m>=sum){
        cout<<"Yes\n";
    }
    else cout<<"No\n";
    return 0;
}


Measured memory_bytes: 256
while True:
    w, h = map(int, input().split())
    if h == 0:
        break
    m = [list(input()) for _ in range(h)]
    sx = 0
    sy = 0
    for yi, row in enumerate(m):
        if '@' in row:
            sy = yi
            sx = row.index('@')
    def dfs(x, y):
        if x < 0 or w <= x or y < 0 or h <= y or m[y][x] == '#':
            return 0
        else:
            m[y][x] = '#'
            dy = [1, -1] + [0] * 2
            dx = [0] * 2 + [1, -1]
            return sum([dfs(x+dx[i], y+dy[i]) for i in range(4)]) + 1
    print(dfs(sx, sy))




Measured memory_bytes: 6252
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;
const int MAX = 1000000;
int data[MAX];
vector<int> V;

void make(){
  fill(data,data+MAX,1);
  
  for(int i = 2; i*i < 1000000; i++){
    if(data[i] == 1){
      for(int j = i*2; j < 1000000; j+=i) data[j] = 0;
    }
  }
  V.push_back(2);
  for(int i = 3; i < MAX; i+=2)
    if(data[i]) V.push_back(i);
}

int main(){
  make();
  int in;
  while(cin >> in){ 
    cout << upper_bound(V.begin(),V.end(),in)-V.begin() << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (1+(c-1)/b <= 1+(a-1)/d)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}



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

int c(int a, int b){
    if(a < b) return 0;
    else if(b == 0) return 1;
    else return c(a-1, b-1) + c(a-1, b);
}

int main() {
  int n, m;
  cin >> n >> m;
  cout << c(n, 2) + c(m, 2) << endl;
}

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

int main() {
	int n, r;
	cin >> n >> r;
	if (n >= 10) {
		cout << r << "\n";
	}
	else {
		cout << r + 100 * (10 - n) << "\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,temp =0,count=0;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++) cin >> vec.at(i);
  sort(vec.begin(), vec.end());
  reverse(vec.begin(),vec.end());
  
  for(int i = 0; i < N; i++){
    if(temp != vec.at(i)){
      temp = vec.at(i);
      count++;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
s = gets.chop
gets.to_i.times{
  m, a, b, c = gets.split
  an = a.to_i
  bn = b.to_i
  case m
  when 'print'
    puts s[an..bn]
  when 'reverse'
    s[an..bn] = s[an..bn].reverse
  else
    s[an..bn] = c
  end
}

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

int main(){
    long long N, M;
    std::cin >> N >> M;
    std::vector< long long > A(N);
    for(int i=0; i<N; i++){
        std::cin >> A[i];
    }
    
    std::map< long long, int > cnt;
    
    long long total = 0;
    long long ans = 0;
    for(int i=0; i<N; i++){
        long long A_a = A[i] % M;
        total = (total + A_a) % M;
        long long total_M = (M - total) % M;
        A_a = (A_a + total_M) % M;
        auto f = cnt.find(A_a);
        if(f == cnt.end()){
            cnt[A_a] = 1;
        }else{
            cnt[A_a]++;
        }
        
        auto f2 = cnt.find(total_M);
        if(f2 != cnt.end()){
            ans += cnt[total_M];
        }
    }
    
    std::cout << ans << std::endl;
    
    
    return 0;
    
}


Measured memory_bytes: 7768
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    x, y = LI()
    for i in range(x+1):
        j = x - i
        if i * 2 + j * 4 == y:
            print("Yes")
            return
    print("No")
    return

main()



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

int main(){
	string a,b,c;
	cin>>a>>b>>c;
	char ans[4];
	ans[0] = a[0]-32;
	ans[1] = b[0]-32;
	ans[2] = c[0]-32;
	ans[3] = '\0';
	cout<< ans <<endl;
}

Measured memory_bytes: 256
import java.io.*;

 public class Main{
	 public static void main(String args[]) throws IOException{
		 BufferedReader bf = new BufferedReader(
				 new InputStreamReader(System.in));
		 int w,n,right,left,x;
		 String str;
		 w = Integer.parseInt(bf.readLine());
		 n = Integer.parseInt(bf.readLine());
		 int[] order = new int[w];
		 for(int i = 0; i < w; i++){
			 order[i] = i+1;
		 }
		 for(int i = 0; i < 2*n; i += 2){
			 str = bf.readLine();
			 String deta[] = str.split(",",0);
			 left = Integer.parseInt(deta[0]);
			 right = Integer.parseInt(deta[1]);
			 x = order[left-1];
			 order[left-1] =order[right-1];
			 order[right-1] = x;
		 }
		 for(int i = 0; i < w; i++){
			 System.out.println(order[i]);
		 }
	 }
}

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

const int MAX_VAL = 1000;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, capacity;
    cin >> n >> capacity;
    int MAX_SUM = n * MAX_VAL;
    vll dp(MAX_SUM + 1, capacity+1);
    dp[0] = 0;
    while (n--) {
        int w, val;
        cin >> w >> val;
        for (int i=MAX_SUM; i>=val; i--) {
            dp[i] = min(dp[i], dp[i-val]+w);
        }
    }
    for (int i=MAX_SUM; i>=0; i--) {
        if (dp[i] <= capacity) {
            cout << i << '\n';
            break;
        }
    }
}


Measured memory_bytes: 1024
def main():
  n = int(input())
  hs = tuple(map(int, input().split()))
 
  a, b = 0, abs(hs[1] - hs[0])
 
  for i in range(2, n):
    c = hs[i]
    d1 = a + abs(c - hs[i-2])
    d2 = b + abs(c - hs[i-1])
    a, b = b, d1 if d1 <= d2 else d2
 
  print(b)
 
if __name__ == "__main__":
  main()

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

dp=[0]*(N+1)
cost=[0,2,5,5,4,5,6,3,7,6]
for i in range(1,N+1):
    for a in A:
        if i-cost[a]>=0:
            if dp[i-cost[a]]==0 and i-cost[a]>0:
                continue
            dp[i]=max(dp[i],dp[i-cost[a]]*10+a)
print(dp[-1])

Measured memory_bytes: 14388
#include<iostream>
#include<vector>
#include<math.h>
#include<string>
#include<algorithm>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

int main(){
	int A, B;
	cin >> A >> B;
	cout << max({ A + B, A - B, A * B }) << endl;
	
}

Measured memory_bytes: 256
/*
 *
 *    I am o0o0oo00.
 *
 */
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll          long long
#define p7          1000000007
#define p9          998244353
#define pb          push_back
#define ff          first
#define ss          second
#define vll         vector<ll>
#define pll         pair<ll,ll>
#define vpll        vector<pll>
#define mll         map<ll,ll>
#define test        ll T;cin>>T;while(T--)
#define ad(a,n)     vll a;a.resize(n);for(ll i=0;i<n;i++)cin>>a[i];
#define as(a,n)     for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<endl;
#define all(x)      x.begin(),x.end()

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

ll powm(ll x, ll y, ll m = p7) {
    x = x % m; ll res = 1; while (y)
    {if (y & 1)res = res * x; res %= m; y = y >> 1; x = x * x; x %= m;} return res;
}
ll modi(ll a, ll m = p7) {return powm(a, m - 2, m);}
void yesno(bool f) {f ? cout << "YES" << endl : cout << "NO" << endl;}


void ss99()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
}


int32_t main()
{
 //   ss99();
//    test
    {
        ll n; cin >> n;
        ll h[n + 1], dp[n + 1] = {0};
        for (ll i = 1; i <= n; i++)
            cin >> h[i];
        dp[n] = 0;
        dp[n - 1] = abs(h[n] - h[n - 1]);
        dp[n - 2] = min(abs(h[n] - h[n - 2]), dp[n - 1] + abs(h[n - 1] - h[n - 2]));
        for (ll i = n - 3; i >= 1; i--)
        {
            ll val1 = abs(h[i + 1] - h[i]) + dp[i + 1];
            ll val2 = abs(h[i + 2] - h[i]) + dp[i + 2];
            dp[i] = min(val1, val2);
        }
        cout << dp[1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,a;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            std::deque<int> deq;
            for (int i=0;i<n;i++) {
                cin>>a;
                deq.emplace_back(a);
            }
            sort(deq.begin(),deq.end());
            deq.erase(deq.begin(),deq.begin()+1);
            sort(deq.begin(),deq.end(),greater<int>());
            deq.erase(deq.begin(),deq.begin()+1);
            int sum=0;
            for (int j=0;j<deq.size();j++) {
                sum+=deq[j];
            }
            int ave=floor(sum/(n-2));
            cout<<ave<<endl;
        }
    }
}



Measured memory_bytes: 3080
/*
 
 * This code is written by Sanskar Agarwal
 
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds;
using namespace std;

#define ll long long
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; 
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define VPLL vector<PLL>
#define VPII vector<PII>
#define PQ priority_queue<PLL,VPLL, greater<PLL> > 
#define PQI priority_queue<PII,VPII,greater<PII> >
#define S second
#define F first
#define PB push_back

ll a[3000];
ll dp[3000][3000][2];

ll solve(ll x,ll y,ll ch)
{
    if(x==y) {
        if(ch==0)
            return dp[x][y][ch]=-a[x];
        else
            return dp[x][y][ch]=a[x];
    }
    if(dp[x][y][ch]!=-1)
        return dp[x][y][ch];

    if(ch==0)
        return dp[x][y][ch]=min(solve(x+1,y,1)-a[x],solve(x,y-1,1)-a[y]);
    else
        return dp[x][y][ch]=max(solve(x+1,y,0)+a[x],solve(x,y-1,0)+a[y]);
}

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

    ll n,i;
    cin>>n;
    for(i=0;i<n;i++)
        cin>>a[i];
    
    memset(dp,-1,sizeof dp);
    cout << solve(0,n-1,1);


    return 0;
}

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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<29)
#define INFLL (1LL<<61)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  string s, ns("");
  cin >> s;

  rep(i, s.size()) {
    if (i % 2 != 0) continue;
    ns += s[i];
  }

  cout << ns << endl;
  return 0; 
}


Measured memory_bytes: 592
#include<iostream>
#include<cstdlib>

using namespace std;

bool solve(int i,int m,int n,int A[]);

int main(){
	int n,q;
	int *A,*m;

	cin>>n;
	A = new int[n];
	for(int i=0;i<n;i++) cin>>A[i];

	cin>>q;
	m = new int[q];
	for(int i=0;i<q;i++){
		cin>>m[i];
		if(solve(0,m[i],n,A)){
			cout<<"yes"<<endl;
		}else{
			cout<<"no"<<endl;
		}
	}

	delete [] A; delete [] m;

	cin.get();
	cin.get();
}

bool solve(int i,int m,int n,int A[]){
	if(m==0) return true;
	if(m<0 || i>=n) return false;
	bool res = solve(i+1,m,n,A) || solve(i+1,m-A[i],n,A);
	return res;
}

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

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

   ll p = 100;
   ll t = 0;
   while(p<x){
      p *= 1.01;
      t += 1;
   }

   cout << t << endl;
   return 0;  
}

Measured memory_bytes: 3620
#include<stdio.h>
int main() { 
	long long l,r;
	scanf("%lld%lld",&l,&r);
	r=(r>l+2019)?l+2019:r;
	long long ans=2019;
	for(long long i=l;i<=r;i++)
		for(long long j=i+1;j<=r;j++)
			ans=(ans>(i*j)%2019)?(i*j)%2019:ans;
	printf("%lld",ans);
}
// read the question correctly (ll vs int)
// template by bqi343

Measured memory_bytes: 1704
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,m;
    cin>>n>>m;
    ll arr[10005];
    ll sum=0;
    for(int i=0;i<m;i++)
    {
        cin>>arr[i];
        sum+=arr[i];
    }
    if(sum>n)
    {
        cout<<"-1";
    }
    else
    {
        cout<<n-sum;
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 3728
#include <iostream>
#include <stdlib.h>
#include <vector> 
using namespace std;

int main(){
    string s = "0024";
    
    cin >> s;    
 
    for (int i=0; i<4; i++){
        char tmp = s[i];
        if(i>=1){
            // cout << s[i] << endl;
            // cout << s[i-1] << endl;
            if( s[i-1] == s[i]){
                cout << "Bad" << endl;
                return 0;
            }
        }
    }

    cout << "Good" <<endl;
    return 0;
}

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

namespace AtCoderWorkspace
{
    class Program
    {
        static void Main(string[] args)
        {
            var cin = new Scanner();
            var a = cin.nextInt();
            var b = cin.nextInt();
            var c = cin.nextInt();
                       
            Console.WriteLine(b - a == c - b? "YES":"NO");
        }
    }

    static class C
    {
        public static long LowerBound(long[] a, long key)
        {
            long l = 0;
            long r = a.Length;
            long mid;
            while (l < r)
            {
                mid = ((r - l) / 2) + l;
                if (a[mid] <= key)
                    l = mid + 1;
                else
                    r = mid;
            }
            return l;
        }
    }

    static class Subsequence
    {
       /// <summary>
       /// 最長増加部分列
       /// </summary>
       /// <param name="a">long[]</param>
       /// <returns></returns>
        public static long LIS(long[] a)
        {
            var dp = Enumerable.Range(0, a.Length).Select(x => long.MaxValue).ToArray();
            for (int i = 0; i < a.Length; i++)
            {
                dp[C.LowerBound(dp, a[i])] = a[i];
            }
            return C.LowerBound(dp, long.MaxValue-1);
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define pri_que priority_queue
#define vint vector<int>
#define vvint vector<vector<int>>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vs vector<string>
#define vvc vector<vector<char>>
#define vc vector<char>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define show(x) cout<<#x<<"="<<x<<endl;
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e15;
const long long MOD = 1e9+7;

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

    int a,b; cin >> a >> b;
    vi res;

    res.pb(b-a);
    res.pb(b-a*-1+1);
    res.pb(b*-1-a+1);
    res.pb((-b+a)+2);
    int ans=INF;
    rep(i,4){
        if(res[i]>=0) chmin(ans,res[i]);
    }
    cout<<ans<<endl;
}

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

typedef long long ll;
static const int MOD = 1e9+7;
static const ll INF = 1ll<<60;

int main(){
    vector<int> x(5);
    for(int i=0; i<5; i++) cin>>x[i];
    for(int i=0; i<5; i++){
        if(x[i] == 0){
            cout<<i+1<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3592
char s[100][101];h;r[100],R,c[100],C,i,j;
main(w){scanf("%d%d",&h,&w);for(i=h;i;)scanf("%s",s[--i]);
for(i=h;i--;){int x=0;for(j=0;j<w;j++)if(s[i][j]=='#')x=1;if(x)r[R++]=i;}
for(j=0;j<w;j++){int x=0;for(i=h;i--;)if(s[i][j]=='#')x=1;if(x)c[C++]=j;}
for(i=0;i<R;i++){for(j=0;j<C;j++)putchar(s[r[i]][c[j]]);puts("");}
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#include <numeric>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; // x軸方向への変位
ll dy[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; // y軸方向への変位

int main(void){
    string s;
    cin >> s;
    ll k;
    cin >> k;
    string al = "abcdefghijklmnopqrstuvwxyz";
    for(ll i = 0; i < s.length(); i++){
        if(s[i]=='a') continue;
        char a = s[i];
        ll b = 27-(a-96);
        //cout << k << " " << b << " " << a << endl;
        if(k >= b){
            s[i] = 'a';
            k-=b;
        }
    }
    //cout << k << endl;
    if(k!=0){
        ll check = k%26;
        char a = s[s.length()-1];
        //cout << check << endl;
        check = (check + a - 97)%26;
        //cout << check << endl;
        s[s.length()-1] = al[check];
    }
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 512
def 解():
    N = int(input())
    def testD(N,iD1,iD2):
        while 0 < N:
            if N % iD1 == 0:
                return True
            else:
                N -= iD2
        return False
    if testD(N,4,7) or testD(N,7,4):
        print("Yes")
    else:
        print("No")
解()


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

int main() {
    int hp_init, hp_max;
    while(cin >> hp_init >> hp_max, hp_init) {
        int R, C;
        cin >> R >> C;
        vector<string> dungeon(R);
        for(int i=0; i<R; ++i) {
            cin >> dungeon[i];
        }

        int T;
        cin >> T;
        vector<int> damage(26, 0);
        for(int i=0; i<T; ++i) {
            char c;
            int d;
            cin >> c >> d;
            damage[c - 'A'] = d;
        }

        int S;
        cin >> S;
        vector<char> dir(S);
        vector<int> dist(S);
        for(int i=0; i<S; ++i) {
            cin >> dir[i] >> dist[i];
        }

        int P;
        cin >> P;
        vector<int> portion(P);
        for(int i=0; i<P; ++i) {
            cin >> portion[i];
        }

        vector<int> dp(1 << P);
        dp[(1 << P) - 1] = hp_init;
        int y = 0, x = 0;
        for(int i=0; i<S; ++i) {
            int dy = 0, dx = 0;
            if(dir[i] == 'D') {
                dy = 1;
            } else if(dir[i] == 'U') {
                dy = -1;
            } else if(dir[i] == 'L') {
                dx = -1;
            } else {
                dx = 1;
            }

            for(int j=0; j<dist[i]; ++j) {
                int ny = y + dy;
                int nx = x + dx;
                for(int p = (1 << P) - 1; p >= 0; --p) {
                    if(dp[p] <= 0) {
                        continue;
                    }
                    for(int k = 0; k < P; ++k) {
                        if(!((p >> k) & 1)) {
                            continue;
                        }
                        int next_p = p & ~(1 << k);
                        int next_hp = min(dp[p] + portion[k], hp_max);
                        dp[next_p] = max(dp[next_p], next_hp);
                    }
                }
                for(int p=0; p < (1 << P); ++p) {
                    dp[p] -= damage[dungeon[ny][nx] - 'A'];
                }
                y = ny;
                x = nx;
            }
        }
        if(*max_element(dp.begin(), dp.end()) > 0) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}


Measured memory_bytes: 3172
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cctype>
#include <locale>

using namespace std;

int main(){
    locale l = locale::classic(); //touppser,tolowerクラスはlocaleを与えることで返り値がintからcharに変換できる
    string W;
    cin >> W;
    string search_word;
    for(int i = 0; i < W.size(); i++) {
        search_word += toupper(W[i], l);
    }
    // toupper(W,l);
    // cout << "search_word: " << search_word << endl;
    // cout << "test" << endl;
    string S;
    string sentence;
    int count = 0;
    while(S != "END_OF_TEXT"){        
        // sentence += S;
        cin >> S;
        for(int i = 0; i < S.size(); i++) {    
            sentence += toupper(S[i], l);
        }
        // toupper(S,l);
        // cout << "sentence: " << sentence << endl;
        if(sentence == search_word){
            count++;
        }
        // cout << "S: " << S << endl;
        sentence = "";
    }
    // cout << sentence << endl;
    cout << count << endl;
    return 0;
}



Measured memory_bytes: 3180
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const long long INF=1e9+5;
const string alp="abcdefghijklmnopqrstuvwxyg"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYG";
typedef long long ll;

int main() {
  ll x;
  cin>>x;
  ll ans;
  ll i=1;
  while(true){
    if((360*i)%x==0){
      ans=(360*i)/x;
      break;
    }
    else{
      i++;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static ConsoleReader;

class Program
{
    static void Main(string[] args)
    {
        var n = Read<int>();
        var a = ReadArray<uint>(n);
        uint all = 0;
        n.Times(i =>
        {
            all ^= a[i];
        });

        n.Times(i =>
        {
            Console.Write($"{all ^ a[i]} ");
        });

    }
}

public static class IntExtentions
{
    public static void Times(this int n, Action<int> action)
    {
        for (var i = 0; i < n; i++)
        {
            action(i);
        }
    }

    public static void Times(this (int n, int m) dimensions, Action<int, int> action)
    {
        var (n, m) = dimensions;
        n.Times(i => m.Times(j => action(i, j)));
    }
}

public static class ConsoleReader
{
    public static T Read<T>()
        where T : IConvertible
    {
        var inputBuffer = new StringBuilder();
        int currChar;

        while ((currChar = Console.Read()) != -1)
        {
            if (!char.IsWhiteSpace((char)currChar))
            {
                inputBuffer.Append((char)currChar);
            }
            else if (inputBuffer.Length != 0)
            {
                break;
            }
        }

        return (T)Convert.ChangeType(inputBuffer.ToString(), typeof(T));
    }

    public static T[] ReadArray<T>(int count)
        where T : IConvertible
    {
        if (count < 0)
        {
            throw new ArgumentOutOfRangeException(nameof(count), $"'{nameof(count)}' must be >= 0");
        }

        var result = new T[count];

        for (var i = 0; i < count; i++)
        {
            result[i] = Read<T>();
        }

        return result;
    }
}

Measured memory_bytes: 41476
#include<bits/stdc++.h>
#define pb push_back
#define in insert
#define ff first
#define ss second
#define mp make_pair
#define int long long
#define uint unsigned long long
#define rep(i,x,m) for(int i=x;i<m;i++)
#define repr(i,x,m) for(int i=x;i>=m;i--)
#define MOD 1000000007
#define endl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi vector<int>
#define vs vector<string>
#define print(v) for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
using namespace std;
#define noob ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

void ram5564()
{
    int a,b,c;
    cin>>a>>b>>c;
    uint sum1=4*a*b;
    uint sum2=(c-a-b)*(c-a-b);
    if(sum2>sum1&&(c>(a+b)))
    {
        cout<<"Yes";return;
    }
    cout<<"No";
}

signed main()
{
        noob
   

        
        int t=1;
       // cin>>t;
        while(t--)
        ram5564();
        return 0;
}

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

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

  for (int i = 0; i < s.length(); i++) {
    s[i] = 'x';
  }
  cout << s << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main(void){
  int a,b;
  int x;
  scanf("%d",&x);
  for(a=0;a<1000;a++){
    for(b=-1000;b<a;b++){
      if((pow((double)a,5)-pow((double)b,5))==(double)x){
	goto END;
      }
    }
  }
 END:
  printf("%d %d",a,b);
  return 0;
}


Measured memory_bytes: 2600
n, k = map(int,input().split())
v = list(map(int,input().split()))

ans = 0

for l in range(n):
    for r in range(n+1)[::-1]:
        if l <= r and 0 <= (l+n-r) <= k: # l+n-r個拾う
            q = v[:l] + v[r:n]
            q.sort(reverse = True)
            
            for i in range(k-(l+n-r)):
                if q == []:
                    break
                if q[-1] < 0:
                    q.pop()
                else:
                    break

            ans = max(ans, sum(q))
        else:
            continue

print(ans)

Measured memory_bytes: 71324
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int main(){
	while(1){
		int n,m,p;
		cin>>n>>m>>p;
		if(n==0)break;
		int ret, M=0,S=0;
		REP(i,n){
			int tmp;
			cin>>tmp;
			S+=tmp;
			if(i==m-1)M=tmp;
		}
		if(M==0)ret=0;
		else ret = ((100*S*(100-p))/M)/100;
		cout << ret << endl;
	}
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#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)

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout<<setprecision(10)<<fixed;
	int n;
	double a;
	cin>>n;
	double ans=0;
	REP(i, n){
		cin>>a;
		ans+=1/a;
	}
	cout<<1/ans<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  

#pragma warning(disable:4996)  
#pragma comment(linker, "/STACK:336777216")  
using namespace std;

#define mp make_pair  
#define Fi first  
#define Se second  
#define pb(x) push_back(x)  
#define szz(x) ((int)(x).size())  
#define rep(i, n) for(int i=0;i<n;i++)  
#define all(x) (x).begin(), (x).end()  
#define ldb ldouble  

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 19;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;

int A[100050];
int B[100050];

int u1[100050];
int u2[100050];

map <int, int> Mx;
int ch(int x) {
	if (Mx.count(x)) return Mx[x];
	int t = Mx.size() + 1;
	Mx[x] = t;
	return t;
}

int r[100050];
bool chk[100050];
int root(int x) {
	return (x == r[x]) ? x : (r[x] = root(r[x]));
}
int main() {
	int N, i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &A[i]);
	for (i = 1; i <= N; i++) scanf("%d", &B[i]);
	for (i = 1; i <= N; i++) A[N + 1] ^= A[i], B[N + 1] ^= B[i];

	for (i = 1; i <= N + 1; i++) u1[i] = A[i], u2[i] = B[i];
	sort(u1 + 1, u1 + N + 2);
	sort(u2 + 1, u2 + N + 2);
	for (i = 1; i <= N + 1; i++) if (u1[i] != u2[i]) return !printf("-1\n");

	for (i = 1; i <= N + 1; i++) A[i] = ch(A[i]), B[i] = ch(B[i]);

	int c = 0;
	
	for (i = 1; i <= Mx.size(); i++) r[i] = i;
	for (i = 1; i <= N + 1; i++) {
		if (A[i] == B[i]) continue;
		r[root(A[i])] = root(B[i]);
		c++;
	}
	if (c == 0) return !printf("0\n");
	for (i = 1; i <= N + 1; i++) if (A[i] != B[i]) chk[root(A[i])] = true;

	for (i = 1; i <= Mx.size(); i++) if (r[i] == i && chk[i]) c++;
	if (A[N+1] != B[N+1]) c -= 2;
	else if (chk[root(A[N+1])]) c--;
	return !printf("%d\n", c);
}

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

using namespace std;


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

	long long answer = 0;

	vector<pair<int, int>> apple;
	//vector<int> AppleR(a);
	//vector<int> AppleG(b);
	//vector<int> AppleZ(c);

	int mokuhyou = x + y;


	for (int i = 0; i < a; i++) {
		int k; cin >> k;
		apple.push_back(pair<int, int>(k, 0));
	}
	for (int i = 0; i < b; i++) {
		int k; cin >> k;
		apple.push_back(pair<int, int>(k, 1));
	}
	for (int i = 0; i < c; i++) {
		int k; cin >> k;
		apple.push_back(pair<int, int>(k, 2));
	}

	sort(apple.begin(), apple.end(), greater<pair<int, int>>());
	/*sort(AppleG.begin(), AppleG.end());
	sort(AppleR.begin(), AppleR.end());
	sort(AppleZ.begin(), AppleZ.end());*/

	for (int i = 0; i < mokuhyou; i++) {
		
		switch (apple[i].second) {
		case 0:
			if (x > 0) {
				x--;
				answer += apple[i].first;
			}
			else {
				mokuhyou++;
			}
			break;
		case 1:
			if (y > 0) {
				y--;
				answer += apple[i].first;
			}
			else {
				mokuhyou++;
			}
			break;
		default:
			answer += apple[i].first;
		}

	}


	cout << answer << endl;

}

Measured memory_bytes: 6384
n=int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
c=0
for i in make_divisors(n):
    if i!=1 and n//(i-1)==n%(i-1):
        c+=(i-1)
print(c)


Measured memory_bytes: 3268
#include <bits/stdc++.h>
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
const ll INF = 99999999999999;
const ll MOD = 1000000007;
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
using namespace std;
template <class T>
bool contain(const std::string &s, const T &v)
{
    // contain(to_string(N), '3')
    return s.find(v) != std::string::npos;
}

ll n;

int dfs(ll N)
{
    if (N > n)
    {
        return 0;
    }

    int res = 0;
    if (contain(to_string(N), '3') && contain(to_string(N), '5') && contain(to_string(N), '7'))
    {
        res++;
    }

    for (int i = 0; i <= 2; i++)
    {
        res += dfs(N * 10 + 3 + i * 2);
    }
    return res;
}

int main()
{
    cin >> n;

    cout << dfs(0) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,k,n)     for (ll i = k; i < n; ++i)
#define repr(i,k,n)    for (ll i = k; i >= n; --i)
#define repp(p,a)      for (p=a.begin();p!=a.end();++p)
#define all(a)         a.begin(),a.end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define reppn(p,a,n)    for (p=a.begin();(p+n)!=a.end();++p)
#define F              first
#define S              second
#define ll             long long
#define hell           1000000007
#define god            LLONG_MAX
#define lb             lower_bound
#define ub             upper_bound
#define pb             push_back
#define ct             continue
#define endl           '\n'
#define setprecision(n) sp(n)
#define srt(a)         sort(all(a))
#define srtd(a)        sort(a.rbegin(),a.rend())
#define sz(a)          ll((a).size())
#define sum(a)         accumulate(all(a),(ll) 0)
#define pdt(a)         accumulate(all(a),double(1),multiplies<double> ())
#define dotpdt(a,b)    inner_product(all(a),b.begin(),0)
#define mkp(a,b)       make_pair(a,b)
#define REP(x,s)       for (auto x : s)
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll t=1;
  //cin>>t;
  while(t--)
  {
      char c;
      cin>>c;
      cout<<(char)(c+1);
  }


 return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))
#define INF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007

typedef long long int lli;

void swap(int* a, int* b)
{
    int tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}

void ll_swap(lli* a, lli* b)
{
    lli tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}

int gcd(int a, int b)
{
    if (a < b)
        swap(&a, &b);

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

int lcm(int a, int b)
{
    return a * b / gcd(a, b);
}

long power(long x, int n) {
    long ans = 1;
    while (n > 0) {
        if ((n & 1) == 1) {
            ans = ans * x;
        }
        x = x * x;
        n >>= 1;
    }
    return ans;
}

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
		printf("res:%lld a:%lld\n", res,a);
	}
	return res;
}


lli comb(lli n, lli r)
{
    if (n == 0)
        return 0;

    if (r == 0 || r == n)
        return (1);
    else if (r == 1)
        return (n);
    return (comb(n - 1, r - 1) + comb(n - 1, r));
}

/*
#define MAX 100000
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
*/

int d(long long int N)
{
    int count = 0;

    while (N > 0)
    {
        N /= 10;
        count++;
    }

    return count;
}

int main()
{
    long long int A, B, C, K;

    scanf("%lld%lld%lld%lld", &A, &B, &C, &K);

    long long int ans = 0;

    if (A >= K)
        ans += K;
    else
    {
        ans += A;
        K -= A;
        if (K > B)
        {
            ans -= K - B;
        }
    }
    printf("%lld", ans);
  
}

Measured memory_bytes: 3784
// seabreeeze //

#include<bits/stdc++.h>
 
using namespace std;
 
#define lli long long
lli MOD=1e9+7;
 
#define MAXN 2000006 

// Template function //
lli powermod(lli x, lli y)  
{  
    lli res = 1;  
    x = x % MOD;
    if (x == 0) return 0;  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % MOD;  
        y = y>>1;   
        x = (x*x) % MOD;  
    }  
    return res;  
}
lli modinv(lli x)
{
    return powermod(x,MOD-2);
}
// Template functions end //

// Custom funtions //
lli tree[MAXN];

void buildTree(vector<lli> a, int n)
{
    for(int i=0;i<n;i++)
        tree[n+i] = a[i];
    for(int i=n-1;i>0;i--)
    {
        tree[i] = min(tree[i<<1] , tree[i<<1|1]);
    }
}

void updateTree(int n, int p, lli value)
{
    tree[p+n] = value;
    p+=n;
    for(int i=p; i>1;i >>= 1)
        tree[i>>1] = min(tree[i], tree[i^1]);
}

lli queryTree(int n, int l, int r)
{
    lli res = INT_MAX;
    for(l+=n,r+=n;l<r;l>>=1, r>>=1)
    {
        if(l&1)
            res = min(res, tree[l++]);
        if(r&1)
            res = min(res,tree[--r]);
    }
    return res;
}

// Custom functions end //

int main()
{
    lli q=1;
    // cin>>q;
    time_t start, end;
    time(&start);
    for(lli tc=1;tc<=q;tc++)
    {
        // Start solution //
        string s,t;
        cin>>s>>t;
        int n = s.length(),ans=0;
        for(int i=0;i<n;i++)
        {
            if(s[i]!=t[i])
            ans++;
        }
        cout<<ans<<endl;
        end:;
        // End Solution //
    }
    
    time(&end);
    // cout<<fixed<<double(end - start)<<setprecision(10)<<endl;
    return 0;
}

Measured memory_bytes: 3904
n, x, y = map(int, input().split())
x -= 1
y -= 1

dists = [0] * n
for i in range(n - 1):
    for j in range(i + 1, n):
        dists[min(j - i, abs(x - i) + abs(y - j) + 1)] += 1
[print(dist) for dist in dists[1:]]


Measured memory_bytes: 3444
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int cnt = 0;
		for( ; a<=b; a++){
			if(c%a==0) cnt++;
		}
		System.out.println(cnt);
	}
}

Measured memory_bytes: 17356
#include <bits/stdc++.h>
using namespace std;
struct Dice{
	int x[6];
	void input(){
		for(int i=0;i<6;i++){
			cin>>x[i];
		}
	}
	void rollforward(){
		int tmp=x[0];
		x[0]=x[1];
		x[1]=x[5];
		x[5]=x[4];
		x[4]=tmp;
	}
	void rollside(){
		int tmp=x[1];
		x[1]=x[3];
		x[3]=x[4];
		x[4]=x[2];
		x[2]=tmp;
	}
	bool operator==(Dice a){
		for(int i=0;i<6;i++){
			if(x[i]!=a.x[i])	return false;
		}
		return true;
	}
};
bool check(Dice a,Dice b){
	for(int i=0;i<4;i++){
		for(int j=0;j<4;j++){
			if(a==b)	return true;
			a.rollside();
		}
		a.rollforward();
	}
	a.rollside();
	a.rollforward();
	for(int i=0;i<4;i++){
		if(a==b)	return true;
		a.rollside();
	}
	a.rollforward();
	a.rollforward();
	for(int i=0;i<4;i++){
		if(a==b)	return true;
		a.rollside();
	}
	return false;
}
int main(){
	Dice a,b;
	a.input();	b.input();
	cout<<(check(a,b)?"Yes":"No")<<endl;
	return 0;
}

Measured memory_bytes: 1160
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split(' ');
		int H = int.Parse(str[0]);
		int W = int.Parse(str[1]);
		int [,] S = new int[H,W];
		for(var i=0;i<H;i++){
			string t = Console.ReadLine();
			for(var j=0;j<W;j++){
				if(t.Substring(j,1) == "#"){
					S[i,j] = 1;
				} else {
					S[i,j] = 0;
				}
			}
		}
		int x = 1;
		for(var i=0;i<H;i++){
			for(var j=0;j<W;j++){
				int f = 0;
				if(S[i,j] == 1){
					if(i<H-1 && S[i+1,j] == 1){
						f = 1;
					} else if(i>0 && S[i-1,j] == 1){
						f = 1;
					} else if(j<W-1 && S[i,j+1] == 1){
						f = 1;
					} else if(j>0 && S[i,j-1] == 1){
						f = 1;
					}
					if(f==0){
						x = 0;
						break;
					}
				}
			}
			if(x==0){
				break;
			}
		}
		string A = "No";
		if(x == 1){
			A = "Yes";
		}
		Console.WriteLine(A);
	}
}

Measured memory_bytes: 11092
/**
	Language: C++
	Author  : 21
**/

#include <bits/stdc++.h>

using namespace std;

#define FastIO() ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define Debug(v) cerr << '\n' << #v << ":\t" << v << '\n'

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;

int main() {
	FastIO();
	int n, m;
	cin >> n >> m;
	vi a(m);
	for (int &x: a) cin >> x;
	int s =0;
	for (int &x: a) s+=x;
	if (s > n) cout << "-1\n";
	else cout << n - s << '\n';
}


Measured memory_bytes: 3660
<?php
$N = trim(fgets(STDIN));
for($i=0; $i<$N; $i++){
    $arr[] = trim(fgets(STDIN));
}
rsort($arr);

$sum = $arr[0] / 2;

for($i=1; $i<$N; $i++){
    $sum += $arr[$i];
}
echo $sum;
?>

Measured memory_bytes: 5368
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
using namespace std;
typedef long long ll;
#define rep(i,a,n)	for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=(a-1);i>=n;i--)
 
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll lcm(ll a,ll b){
	ll g=gcd(a,b);
	return a/g*b;
}
 
ll digitsum(ll a){
	ll x=0;
	while(a>0){
		x+=a%10;
		a/=10;
	}
	return x;
}
int main(){
	string s,t;
	cin>>s>>t;
	if(s[0]==t[2]&&s[1]==t[1]&&s[2]==t[0])cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
}

Measured memory_bytes: 256