akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace __gnu_pbds;
using namespace std;
#define testing 1
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >= (ll)(ee); --ii)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << endl
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<endl
#define dbv(v) cerr << #v << ":"; for (auto it : v) cerr << it << ' '; cerr << endl
#define dbvp(v) cerr << #v << ":"; for (auto it : v) cerr << "{"  << it.f << ',' << it.s << "} "; cerr << endl
#define dba(a,ss,ee) cerr << #a << ":"; FOR(i,ss,ee) cerr << a[i] << ' '; cerr << endl
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define inf (int)1e9+500
#define oo (ll)1e18
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "hi\n";
typedef pair <int, int> pi;
typedef pair <ll,ll> pl;
typedef pair <pi, int> pii;
typedef tuple<int,int,int> ti3;
string cts(char x) {string s(1,x); return s;}
const int MOD = 1e9 + 7;
template <typename T> void maxself(T& a, T b) {
	a = max(a, b);
}
template <typename T> void minself(T& a, T b) {
	a = min(a, b);
}
#define MAXN
#if !testing
#define cerr if(0)cout
#endif
int32_t main() {
	IAMSPEED
	// set testing to 0 when submitting to judge
	map<int,int> mp;
	int a,b,c;cin>>a>>b>>c;
	mp[a]++;
	mp[b]++;
	mp[c]++;
	if(mp[a]==2||mp[b]==2||mp[c]==2)cout<<"Yes";
	else cout << "No";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
int main(void){
   int N,X,m;
   cin>>N>>X;
   
   int minD=1001;
   rep(i,N){
       cin>>m;
       X-=m;
       minD=min(minD,m);
   }
   int ans=N+X/minD;
   cout<<ans<<endl;
}

Measured memory_bytes: 3524
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
bool ju(ll x){
    return 0<x && x<13;
}
int main(void){
    // Your code here!
    string s;
    cin>>s;
    ll a,b;
    a=atoi(s.substr(0,2).c_str());
    b=atoi(s.substr(2,2).c_str());
    if(ju(a)){
        if(ju(b))cout<<"AMBIGUOUS"<<endl;
        else cout<<"MMYY"<<endl;
    }else{
        if(ju(b))cout<<"YYMM"<<endl;
        else cout<<"NA"<<endl;
    }
    
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

typedef unsigned long long ULLONG;
typedef long long LLONG;

template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void getint(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}
static const long long MOD_NUM = 1000000007LL;

static void A_task();

int main()
{
	A_task();
	fflush(stdout);
	return 0;
}

template <class _Ty> class PermComb
{
protected:

	_Ty _maxNum = 0;
	_Ty _use_mod = 0;
	_Ty* _fact = 0;
	_Ty* _inv = 0;
	_Ty* _finv = 0;

	PermComb() {}

public:
	PermComb(_Ty maxNum, _Ty use_mod = 0) {
		_maxNum = maxNum;
		_use_mod = use_mod;
		_fact = new _Ty[(unsigned int)maxNum + 1];
		_fact[0] = _fact[1] = 1;

		if (_use_mod) {
			_inv = new _Ty[(unsigned int)maxNum + 1];
			_finv = new _Ty[(unsigned int)maxNum + 1];
			_inv[0] = _inv[1] = 1;
			_finv[0] = _finv[1] = 1;
		}

		for (_Ty i = 2; i <= maxNum; i++) {
			_fact[i] = _fact[i - 1] * i;
			if (_use_mod) {
				_fact[i] %= _use_mod;
				_inv[i] = _use_mod - _inv[_use_mod % i] * (_use_mod / i) % _use_mod;
				_finv[i] = _finv[i - 1] * _inv[i] % _use_mod;
			}
		}
	}

	//	get permutation value
	virtual _Ty nPk(int n, int k) {
		if ((k > _maxNum) || (n > _maxNum) || (k > n) || (k < 0) || (n < 0)) {
			return 0;
		}
		return(_fact[n] / _fact[n - k]);
	}

	//	get combination value
	virtual _Ty nCk(int n, int k) {
		_Ty ans = 0;
		if ((k > _maxNum) || (n > _maxNum) || (k > n) || (k < 0) || (n < 0)) {
			ans = 0;
		}
		else if (_use_mod == 0) {
			ans = nPk(n, k);
			ans /= _fact[k];
		}
		else {
			ans = _fact[n] * (_finv[k] * _finv[n - k] % _use_mod) % _use_mod;
		}
		return ans;
	}

	//	destructor
	~PermComb() {
		delete[] _fact;
		delete[] _inv;
		delete[] _finv;
	}
};

static void A_task()
{
	int N, M;
	getint(N, M);

	PermComb<LLONG> pc(101, MOD_NUM);

	printf("%d\n", pc.nCk(N, 2) + pc.nCk(M, 2));
}


Measured memory_bytes: 256
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(N, M, C, inputs1, inputs2):
    B = string_to_int(inputs1)
    A = list(map(lambda i: string_to_int(i), inputs2))

    num = 0
    for a in A:
        score = 0
        for i in range(0, M):
            score += a[i] * B[i]
        score += C

        if score > 0:
            num += 1

    return num


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    [N, M, C] = string_to_int(input())
    ret = solve(N, M, C, input(), inputs(N))
    print(ret)


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

int n;
int i;

int main() {
  cin >> i;
  int b = 0;
  int a[i];
  for (; b < i; ++b) {
    cin >> a[b];
  }
  sort(a,a+i);
  long long int d = 0;
  int e;
  for (int c = 0; c < i; ++c) {
    d = d + a[c];
    e = c;
  }
  cout << a[0] << " " <<  a[e] << " " << d << endl;
}

Measured memory_bytes: 3156
from collections import defaultdict
from itertools import combinations


def func(i, d, now, use, st):
    if i >= d:
        st.append(now)
        return

    for x in use:
        func(i + 1, d, now + str(x), use, st)


def solve():
    n, k = map(int, input().split())
    d = list(map(int, input().split()))

    use = []
    for i in range(10):
        if i not in d:
            use.append(i)

    for i in range(len(str(n)), len(str(n)) + 2):
        st = []
        func(0, i, "", use, st)
        for x in sorted(st):
            if int(x) >= n:
                return x


def main():
    print(solve())


if __name__ == '__main__':
    main()


Measured memory_bytes: 3820
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0113
{
    public class Program

    {
        public static void Main(string[] args)
        {
            while (true)
            {
                string line = Console.ReadLine();
                if (string.IsNullOrEmpty(line)) return;

                int[] items = Array.ConvertAll(line.Trim().Split(' '), e => int.Parse(e));
                int p = items[0];
                int q = items[1];

                List<int> quotient = new List<int>(80);
                List<int> remainder = new List<int>(80);

                int cur = p; int cnt = 0;
                while (true)
                {
                    int div = cur / q;
                    int mod = cur % q;

                    quotient.Add(div);

                    if (mod == 0)
                    {
                        Console.WriteLine(WAr(quotient.Skip(1), ""));
                        break;
                    }

                    int idxMod = remainder.IndexOf(mod);
                    if (idxMod > -1)
                    {
                        Console.WriteLine(WAr(quotient.Skip(1), ""));
                        Console.WriteLine(String.Join("", Enumerable.Repeat(' ', idxMod).ToArray()).PadRight(quotient.Count() - 1, '^'));
                        break;
                    }

                    remainder.Add(mod);
                    cur = mod;
                    cur *= 10;
                    cnt++;
                }
            }

        }

        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RStAr(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }

}



Measured memory_bytes: 16324
//----------------------------------------------------------------------
#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(void) {
    string s;cin >> s;

    string b1;
    string f1;

    int n; cin >> n;
    int reverseflag = 0;
    bool flag;

    for(int i = 0; i < n; ++i){
        int q; cin >> q;
        if(q == 1) {
            if(i != 0)
            reverseflag++;
        }else {
            int f;
            if(reverseflag%2== 0) {
                flag = false;
            }else {
                flag = true;
            }
            string c;
            cin >> f >> c;
            if(f==2 && !(flag)){
                //s = s+c;
                b1 = b1+c;
            }else if(f==1 && !(flag)){
                //s = c+s;
                f1 = c+f1;
            }else if(f==2 && (flag)) {
                //s = c+s;
                f1 = c+f1;
            }else if(f==1 && (flag)){
                //s = s+c;
                b1 = b1+c;
            }
        }
    }

    s = f1+s+b1;

    if(reverseflag%2== 0) {
        flag = false;
    }else {
        flag = true;
    }

    if(flag){
        for(int i = (int)s.size()-1; i >= 0 ; --i) {
            cout << s[i];
        }
        cout << endl;
    }else {
        cout << s << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1512
#include<iostream>
using namespace std;
#define max 100000

int A[max];

int patition(int p, int r){
	int x = A[r];
	int j = p - 1;
	for(int i = p; i < r; i++){
		if(A[i] <= x){
			j++;
			swap(A[j], A[i]);
		}
	}
	swap(A[j+1], A[r]);
	return j+1;
}

int main(void){
	int x, r, n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> A[i];
	}
	r = n-1;
	x = patition(0, r);
	for(int i = 0; i < n; i++){
		if(i == x){
			cout << '[' << A[i] << ']' << ' ';
		}
		else if(i == r){
			cout << A[i] << endl;
		}
		else{
			cout << A[i] << ' ';
		}
	}
	return 0;
}


Measured memory_bytes: 3408
def solve(total, idx):
    if total > 2000:
        return
    can_make[total] = True
    if idx == n:
        return
    solve(total + A[idx], idx + 1)
    solve(total, idx + 1)


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

can_make = [False] * (2000 + 1)
solve(0, 0)

M = int(input())
Q = [int(x) for x in input().split()]
for q in Q:
    print('yes' if can_make[q] else 'no')



Measured memory_bytes: 5636
#include<stdio.h>
int main()
{
   int a,b,i;
   scanf("%d %d",&a,&b);
   for(i=a-1;i>0;i--)
   {
       printf("%d ",b-i);
   }
   printf("%d ",b);
   for(i=1;i<a;i++)
   {
       printf("%d ",b+i);
   }
}


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

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

int main()
{
  int R; cin >> R;
  cout << 2.0*R*3.141592;
}

Measured memory_bytes: 3788
#include<iostream>
#include<cstdio>
#include<queue>
#include<vector>
#include<string.h>
#include<algorithm>
#include <cmath>

using namespace std;


char S[100];

int i,j,k;

int main()
{
  cin>>S;
  
  if(S[2]==S[3] && S[4]==S[5])
  {
    cout <<"Yes";
  }
  else
  {
    cout <<"No";
  }
  
  
  
  
}

Measured memory_bytes: 256
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

//macro
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define EPS (1e-8)
#define equals(a,b)(fabs((a)-(b))<EPS)

using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vvll = vector<vll>;
//func
template<typename A, typename T>void assign2d(A&arr, ll H, ll W, T t) { arr.resize(H); REP(i, H) arr[i].assign(W, t); }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); REP(i, n)os << v[i] << (i == n - 1 ? "" : " "); return os; }
template <class T = int> inline T IN() { T x; cin >> x; return x; }
template<class T> inline void OUT(const T &x) { cout << x << "\n"; }
void YESNO(bool c) { OUT(c ? "YES" : "NO"); };
void YesNo(bool c) { OUT(c ? "Yes" : "No"); };
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); /*cout << fixed << setprecision(6);*/ } } pre__;

int main(void) {
	set<char> S;
	int N = IN();
	REP(i, N) {
		char x;
		cin >> x;
		S.insert(x);
	}
	if (S.size() == 4) {
		OUT("Four");
	}
	else{
		OUT("Three");
	}
	return 0;
}

Measured memory_bytes: 256
n=int(input())
a=[]
x=[[] for _ in range(n)]
y=[[] for _ in range(n)]
for i in range(n):
    m=int(input())
    a.append(m)
    for _ in range(m):
        xbuf,ybuf=map(int,input().split())
        x[i].append(xbuf)
        y[i].append(ybuf)
        
def bitsearch(b,n):
    for j in range(n):
        if ((b >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            for k in range(a[j]):
                if y[j][k]==1 and ((b >> x[j][k]-1)&1)==0:
                    return False
                if y[j][k]==0 and ((b >> x[j][k]-1)&1)==1:
                    return False
        else:
            continue
    return True
        
pmax=0
for i in range(2 ** n):
    #print(bitsearch(i,n))
    if bitsearch(i,n):
        t=0
        for j in range(n):
            if ((i >> j) & 1):
                t+=1
        if pmax<t:
            pmax=t
print(pmax)

     

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

using namespace std;
using ll = long long;

int main() {
    for(int i = 0;i < 3;++i) {
        int a,b,c,d,e,f;
        cin>>a>>b>>c>>d>>e>>f;
        int ans=0;
        ans+=60*60*(d-a);
        ans+=60*(e-b);
        ans+=(f-c);
        int g,h,j;
        j=ans%60;
        ans/=60;
        h=ans%60;
        g=ans/60;
        cout<<g<<" "<<h<<" "<<j<<endl;
    }
    return 0;
}



Measured memory_bytes: 3076
#include <stdio.h>
#define O 1000000007L
typedef unsigned long long int num_t;

static num_t power(num_t m, num_t n, num_t o) {
  num_t p;

  if (n == 0) return 1;
  p = power(m * m % o, n / 2, o);
  if (n % 2) p = p * m % o;
  return p;
}

int main(int argc, char **argv) {
  num_t m, n;

  scanf("%llu %llu", &m, &n);
  printf("%llu\n", power(m, n, O));
}


Measured memory_bytes: 2112
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<string.h>
using namespace std;
#define maxn 100010
typedef long long ll;
#define cle(n) memset(n,0,sizeof(n))

int n,m,k;
int a[10000];
int b[8];
int main()
{
//  int a,b,c;
  while(~scanf("%d",&n))
  {cle(a),cle(b);
   for(int i=0;i<n;i++)
    scanf("%d",&a[i]);
  int ans=0;

int flag=0;
  for(int i=0;i<n;i++)
  {
      if(a[i]>=0&&a[i]<=399)
      {
          b[0]++;
      }

      if(a[i]>=400&&a[i]<=799)
      {
          b[1]++;
      }
      if(a[i]>=800&&a[i]<=1199)
      {
          b[2]++;
      }
      if(a[i]>=1200&&a[i]<=1599)
      {
          b[3]++;
      }
      if(a[i]>=1600&&a[i]<=1999)
      {
          b[4]++;
      }
      if(a[i]>=2000&&a[i]<=2399)
      {
          b[5]++;
      }
      if(a[i]>=2400&&a[i]<=2799)
      {
          b[6]++;
      }
      if(a[i]>=2800&&a[i]<=3199)
      {
          b[7]++;
      }
      if(a[i]>=3200)
      {
         flag++;
      }
  }



  for(int i=0;i<8;i++)
    if(b[i])ans++;

 int ans1=ans;
    if(flag)
    {
       ans+=flag;
    }

    if(ans1==0)ans1++;
 cout<<ans1<<' '<<ans<<endl;
  }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int n;
  R n;
  int a[n+1];
  R a[n];
  rep(i,n) R a[i];
  sort(a,a+n+1);
  int d=a[1]-a[0];
  REP(i,1,n) d=__gcd(d,a[i+1]-a[i]);
  pr(d);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 640
import java.util.Scanner;

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

        int N = sc.nextInt();
        long X = sc.nextLong();

        System.out.println(solve(N, X));

        sc.close();
    }

    static long solve(int N, long X) {
        long[] totalNums = new long[N + 1];
        totalNums[0] = 1;
        for (int i = 1; i < totalNums.length; ++i) {
            totalNums[i] = totalNums[i - 1] * 2 + 3;
        }

        long[] pattyNums = new long[N + 1];
        pattyNums[0] = 1;
        for (int i = 1; i < pattyNums.length; ++i) {
            pattyNums[i] = pattyNums[i - 1] * 2 + 1;
        }

        return search(totalNums, pattyNums, N, X);
    }

    static long search(long[] totalNums, long[] pattyNums, int level, long x) {
        if (level == 0) {
            return 1;
        }

        if (x == 1) {
            return 0;
        } else if (x <= totalNums[level - 1] + 1) {
            return search(totalNums, pattyNums, level - 1, x - 1);
        } else if (x == totalNums[level - 1] + 2) {
            return pattyNums[level - 1] + 1;
        } else if (x <= totalNums[level - 1] * 2 + 2) {
            return pattyNums[level - 1] + 1 + search(totalNums, pattyNums, level - 1, x - (totalNums[level - 1] + 2));
        } else {
            return pattyNums[level];
        }
    }
}

Measured memory_bytes: 35776
#include <stdio.h>
int main(void){
 int x,a,b;
 scanf("%d%d%d",&x,&a,&b);
 int c=x-a,d=x-b;
 if(c<0) c*=-1;
 if(d<0) d*=-1;
 printf(c<d?"A":"B");
 return 0;
}


Measured memory_bytes: 128
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] boy = new int[n+1];
        int cnt = 0;

        for(int i = 0;i<k;i++){
            int d = sc.nextInt();
            for(int j =0;j<d;j++){
                int a = sc.nextInt();
                boy[a-1] =1;
                }
            }

        
        for(int i = 0;i<n;i++){
            if(boy[i]==0){
                cnt++;
                //System.out.println(i+"num");
            }
        }

        System.out.println(cnt);
        
        
    }
}

Measured memory_bytes: 46560
N, Q = map(int, input().split())

ab = []
for i in range(N-1):
    a, b = map(int, input().split())
    ab.append((a, b))
ab = sorted(ab, key=lambda x: x[0])

P = [0 for _ in range(N)]  # 0-indexed
for i in range(Q):
    p, x = map(int, input().split())
    P[p-1] += x

for i in range(N-1):
    a, b = ab[i]
    P[b-1] += P[a-1]

print(*P)


Measured memory_bytes: 91528
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n,m,k;
    while(cin>>n>>m>>k){
        bool t=0;
        for(int i=0;i<=n;i++){
            int now=0;
            now+=i*m;
            for(int j=0;j<=m;j++){
                int tmp=now+(n-i*2)*j;
                if(tmp==k){
                    t=1;break;
                }
            }
        }
        if(t)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    string s;
    cin>>s;
    string ans="";
  	
    for(int i=0;i<s.size();i++){
        if(i%2==0){ans+=s[i];}
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int k,n;
int s[505][505];
int main()
{
	scanf("%d",&k);
	if(k<=500){
		n=k;printf("%d\n",n);
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				printf("%d",i);
				if(j!=n) printf(" ");
				else puts("");
			}
		}
		return 0;
	}
	else{
		n=500;
		for(int i=1;i<=n;i++){
			int tx=1,ty=i;
			while(s[tx][ty]==0){
				s[tx][ty]=i;
				tx++;ty++;
				if(tx==n+1) tx=1;
				if(ty==n+1) ty=1;
			}
		}
		for(int i=1;i<=k-n;i++){
			int tx=1,ty=i;
			while(s[tx][ty]!=n+i){
				s[tx][ty]=n+i;
				tx++;ty++;
				if(tx==n+1) tx=1;
				if(ty==n+1) ty=1;
				tx++;ty++;
				if(tx==n+1) tx=1;
				if(ty==n+1) ty=1;
			}
		}
		printf("%d\n",n);
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				printf("%d",s[i][j]);
				if(j!=n) printf(" ");
				else puts("");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 2176
class Caesar
 
  def initialize
@result = []
    while(string = $stdin.gets) do
    data = string.chomp.split(' ')
    val = 0
    data.each do |str|
      case str.size()
      when 3
        val = checker3(str)
      when 4
        val = checker4(str)
      end
      break if val
    end
 
    s = ''
    string.each_byte do |ch|
      if ch != 32 && ch != 46 && ch != 10 && ch != 0 && val
        s += convert(ch, val).chr
      else
	s += ch.chr
      end
    end
@result.push(s)
	end
@result.each do |s|
puts s
end
  end
 
  def convert(ch, shift)
    val = ch + shift
    s = val%123

    if s < 97
      97+s
    else
      s
    end
  end
 
  def checker4(string)
    list4 = ["this","that"]
    list4.each do |list|
      1.upto(25) do |k|
	count = 0
        index = 0
        string.each_byte do |ch|
	  s = list[count]
	  m = convert(ch, k)	
	  count += 1
          next if s-m != 0
          index += 1
        end
        return k if index == 4
      end
    end
    return false
  end
 
  def checker3(string)
    list3 = ["the"]
    list3.each do |list|
      1.upto(25) do |k|
	count = 0
        index = 0
        string.each_byte do |ch|
	  s = list[count]
	  m = convert(ch, k)	
	  count += 1
          next if s-m != 0
          index += 1
        end
        return k if index == 3
      end
    end
    return false
  end
end
 
c = Caesar.new

Measured memory_bytes: 2372
n, m = map(int, input().split())
dp = [-1] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = 0
    a.append(aa)
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == 0:
        continue
    dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])

Measured memory_bytes: 50136
#include <stdio.h>
 
int abs(int n)
{
    if (n > 0) return (n);
     
    return (n * -1);
}
 
int max(int a, int b)
{
    a = abs(a);
    b = abs(b);
     
    if (a > b) return (a);
     
    return (b);
}
 
int main(void)
{
    int i;
    int n;
    int x[3], y[3];
    int t[2];
    int sum;
     
    scanf("%d %d %d", &t[0], &t[1], &n);
     
    x[0] = y[0] = 1;
    sum = 0;
    scanf("%d %d", &x[0], &y[0]);
    for (i = 0; i < n - 1; i++){
        scanf("%d %d", &x[1], &y[1]);
         
        x[2] = x[1] - x[0];
        y[2] = y[1] - y[0];
         
        if ((x[2] > 0 && y[2] > 0) || x[2] < 0 && y[2] < 0){
            sum += max(x[2], y[2]);
        }
        else {
            sum += abs(x[2]) + abs(y[2]);
        }
         
        x[0] = x[1];
        y[0] = y[1];
    }
     
    printf("%d\n", sum);
     
    return 0;
}


Measured memory_bytes: 2144
#include <iostream>

using namespace std;
 
int main(){
  int n;
  while(cin >> n){
    int i = 1;
    bool f = true;
    while(i != 1024){
      if((n&i) != 0){
	if(f) f = false;
	else cout << " ";
	cout << i;
      }
      i <<= 1;
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
class List
  def initialize
    @head = Node.new
    @tail = Node.new(@head)
    @head.nxt = @tail
  end

  def insert(val)
    nxt_old = @head.nxt
    node = Node.new(@head, nxt_old, val)
    @head.nxt = node
    nxt_old.prv = node
  end

  def delete(val)
    node = @head.nxt
    while node.val
      if node.val == val
        node.prv.nxt = node.nxt
        node.nxt.prv = node.prv
        return
      end
      node = node.nxt
    end
  end

  def delete_first
    raise 'List is mpety.' if @head.nxt == @tail
    @head.nxt = @head.nxt.nxt
    @head.nxt.prv = @head
  end

  def delete_last
    raise 'List is mpety.' if @head.nxt == @tail
    @tail.prv = @tail.prv.prv
    @tail.prv.nxt = @tail
  end

  def to_s
    vals = []
    node = @head.nxt
    while node.val
      vals << node.val
      node = node.nxt
    end
    vals.join(' ')
  end

  class Node
    attr_accessor :prv, :nxt, :val
    def initialize(prv = nil, nxt = nil, val = nil)
      @prv = prv
      @nxt = nxt
      @val = val
    end
  end
end

list = List.new

STDIN.read.split(/\n/)[1..-1].each do |line|
  ary = line.split(/\s/)
  command = ary[0]
  #start = Time.now
  case command
  when 'insert' then
    list.insert ary[1].to_i
  when 'delete' then
    list.delete ary[1].to_i
  when 'deleteFirst' then
    list.delete_first
  when 'deleteLast' then
    list.delete_last
  end
end
puts list.to_s

Measured memory_bytes: 409808
#include<bits/stdc++.h>
using namespace std;
typedef double db;
const db PI=acos(-1.0);
int main()
{
    int A,B,H,M;
    scanf("%d%d%d%d",&A,&B,&H,&M);
    db ax=A*cos((60*H+M)*PI/360),ay=A*sin((60*H+M)*PI/360);
    db bx=B*cos(M*PI/30),by=B*sin(M*PI/30);
    return 0*printf("%.12f\n",sqrt(pow(ax-bx,2)+pow(ay-by,2)));
}


Measured memory_bytes: 4216
#include <vector>
#include <iostream>
#include <set>
#include <cmath>

#define FOR(i,n) for(int i=0; i<n; i++)
#define FORI(i,z,n) for(int i=z; i<n; i++)

using namespace std;

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

    set<int> coins;
    vector<int> dyn(n);
    dyn[0] = 1;

    FOR(i, m) {
        int c;
        cin >> c;
        coins.insert(c);
    }

    FORI(i, 1, n) {
        int coinVal = i+1;
        if (coins.find(coinVal) != coins.end()) {
            // There is an exact coin for the value i
            dyn[i] = 1;
        } else {
            // We need to combine previous value e.g: (n-1, 1), (n-2, 2), ...
            int minVal = 0;
            int inf = 0;
            int sup = i-1;
            FOR(j, ceil(i/2) + 1)
            while (sup >= inf) {
                if (minVal == 0 || dyn[inf] + dyn[sup] < minVal)
                    minVal = dyn[inf] + dyn[sup];
                inf++;
                sup--;
            }
            dyn[i] = minVal;
        }
    }

    cout << dyn[n-1] << endl;
}



Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
 
const ULL M = 998244353;

struct RQ {
 using RQV = ULL;
 struct RQRV{ ULL b,c; };
 static RQV Zero(){ return 0; }
 static RQRV RZero(){ return { 1,0 }; }
 // addition
 static RQV f(RQV a,RQV b){ return (a+b) % M; }
 // update function
 static void uf(RQV& a,RQV b){ a = b; }
 // effect of range queries n-sized
 static void ef(RQV& a,RQRV b,int n){ a = (b.b*a + b.c*n) % M; }
 // range query update
 static void ruf(RQRV& a,RQRV b){
  a.b = (a.b * b.b) % M; 
  a.c = (a.c * b.b + b.c) % M;
 }
 // comparation
 static bool cmp(RQV l,RQV r){ return l<=r; }
 struct Node{
  RQV v; RQRV r;
 };
 int N;
 vector<Node> V;

 void init(int n){
  N=1; while (N<n) N*=2;
  V.assign(N*2,{Zero(),RZero()});
 }

 void spread(int i,int z){
  ef(V[i].v,V[i].r,z);
  if (z!=1) {
   ruf(V[i*2].r,V[i].r);
   ruf(V[i*2+1].r,V[i].r);
  }
  V[i].r = RZero();
 }

 void upd(int p,RQV v){
  for(int d=N; d>=1; d/=2) spread(p/d,d);
  p+=N; uf(V[p].v,v);
  int z=1;
  while(p!=1){
   p/=2; z*=2;
   V[p].v = f(V[p*2].v,V[p*2+1].v);
   ef(V[p].v,V[p].r,z);
  }
 }

 void updr(int l,int r,RQRV v,int a=0,int b=0,int i=-1){
  if(i==-1){ a=0; b=N; i=1; }
  if(r<=a || b<=l){ spread(i,b-a); return; }
  else if(l<=a && b<=r){ ruf(V[i].r,v); spread(i,b-a); return; }
  spread(i,b-a);
  updr(l,r,v,a,(a+b)/2,i*2);
  updr(l,r,v,(a+b)/2,b,i*2+1);
  V[i].v = f(V[i*2].v,V[i*2+1].v);
 }

 RQV query(int l,int r,int a=0,int b=0,int i=-1){
  if(i==-1){ a=0; b=N; i=1; }
  if(r<=a || b<=l) return Zero();
  spread(i,b-a);
  if(l<=a && b<=r) return V[i].v;
  RQV q1 = query(l,r,a,(a+b)/2,i*2);
  RQV q2 = query(l,r,(a+b)/2,b,i*2+1);
  q1 = f(q1,q2);
  return q1;
 }

 int find(int l,RQV v,int a=0,int b=0,int i=-1){
  static RQV x;
  if(i==-1){ a=0; b=N; i=1; x=Zero(); }
  spread(i,b-a);
  if(b<=l) return N;
  if(l<=a && !cmp(v,f(x,V[i].v))){ x=f(x,V[i].v); return N; }
  if(b-a==1) return a;
  int q1 = find(l,v,a,(a+b)/2,i*2);
  if(q1!=N) return q1;
  return find(l,v,(a+b)/2,b,i*2+1);
 }
};

int N,Q;
RQ G;
 
int main(){
 scanf("%d%d",&N,&Q);
 G.init(N);
 rep(i,N){
  int a; scanf("%d",&a);
  G.upd(i,a);
 }
 rep(q,Q){
  int c; scanf("%d",&c);
  if(c==0){
   int l,r,b,c; scanf("%d%d%d%d",&l,&r,&b,&c);
   G.updr(l,r,{(ULL)b,(ULL)c});
  }
  if(c==1){
   int l,r; scanf("%d%d",&l,&r);
   printf("%llu\n",G.query(l,r));
  }
 }
 
 return 0;
}

Measured memory_bytes: 27732
/*
Author: Fuadul Hasan(fuadul202@gmail.com)
BSMRSTU,Gopalganj
*/
#include<bits/stdc++.h>
using namespace std;
void    		print(int n)    {printf("%d ", n);}
void    		printl(long long n)     {printf("%I64d ", n);}
long long    	readline(){long long x;scanf("%I64d", &x);return x;}
/*
1.#define  gcd(a,b) __gcd(a,b) 2. #define  lcm(a,b) (a*b)/gcd(a,b) 3. #define  PI acos(-1.0) 4.#define  sqr(x) ((x)*(x))
5.#define  min3(a,b,c) min(a,min(b,c))6.#define  min4(a,b,c,d) min(d,min(a,min(b,c)))7.#define  max3(a,b,c) max(a,max(b,c))
8.#define  max4(a,b,c,d) max(d,max(a,max(b,c)))
*/
//.............ignore it................//
/*....... scanf.......*/
template <typename T> inline void readline(T &n) {
  n = 0; int f = 1; register int ch = getchar();
  for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';n = n * f;}
template <typename T, typename TT> inline void readline(T &n, TT &m) { readline(n); readline(m); }
template <typename T, typename TT, typename TTT> inline void readline(T &n, TT &m, TTT &l) { readline(n, m); readline(l);}
/*..........error........*/
#define error(args...) {vector<string>_v=split(#args,',');err(_v.begin(),args);cout<<endl;}
vector<string> split(const string &s, char c) {
  vector<string>v; stringstream ss(s); string x;
  while (getline(ss, x, c))v.emplace_back(x); return move(v);
} void err(vector<string>::iterator it) {}
template<typename T, typename... Args>void err(vector<string>::iterator it, T a, Args...args) {
cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " "; err(++it, args...);}
//............ignore it..................//
typedef   pair<int, int> ii;
typedef   std::vector<ii> vii;
#define   vi   std::vector<int>
#define   vll  std::vector<ll>
#define   all(n) n.begin(),n.end()
#define  mpsi std::map<string, int>
#define  pb                     push_back
#define  ll                     long long int
#define  nl                     printf("\n");
#define  happy          cin.tie(0);
#define  coding         ios::sync_with_stdio(false);
int dx[8]= {1,0,-1,0,-1,-1,1,1};
int dy[8]= {0,1,0,-1,-1,1,-1,1};
const int mod           = 1e9 + 7;
const int inf           = (int)2e9 + 5;
const ll  Inf           = (ll)2e18 + 5;
const int N             = 500 + 5;
const int N1            = 3e5 + 5;
int visit[N][N];
string s[505];

int solve()
{
	//happy coding
	ll n,a,b;
	//cin>>n>>a>>b;
	while(scanf("%lld%lld%lld",&n,&a,&b)!=EOF){
	
		ll x = n%(a+b);
		cout<<a*(n/(a+b))+min(x,a)<<endl;}
	//error()
	return 0;
}

int main(){
	int test = 1, tc = 0;
	//scanf("%d", &test);//(void)getchar();
	while (test--)solve();
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iomanip>
#include<math.h>
using namespace std;

int  main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    for (int i = 0; i < 1000; i++) {
        c = c - b;
        if (c <= 0) {
            cout << "Yes" << endl;
            break;
        }
        a = a - d;
        if (a <= 0) {
            cout << "No" << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 3632
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

int n2,n,a[100010],ans,dat[400010];

void upd(int k,int lb,int ub)
{
	if(lb!=ub)
	{
		upd(k*2+1,lb,(lb+ub)/2);
		upd(k*2+2,(lb+ub)/2+1,ub);
		if(dat[k*2+1]==dat[k*2+2]&&dat[k*2+1]==-1) dat[k]=-1;else
		if(dat[k*2+2]==-1) dat[k]=dat[k*2+1];else
		dat[k]=__gcd(dat[k*2+1],dat[k*2+2]);
	}
	if(lb>=n2) dat[k]=-1;
}

int main()
{
	cin>>n2;
	n=1;
	while(n<n2) n*=2;
	rep(i,n2) scanf("%d",&a[i]),dat[i+n-1]=a[i];
	upd(0,0,n-1);
	rep(i,n)
	{
		int pos=i+n-1,now=-1,whi,t;
		while(true)
		{
			whi=(pos%2==0 ? 1:2);
			pos=(pos-1)/2;
			if(dat[pos*2+whi]==now&&dat[pos*2+whi]==-1) now=-1;else
			if(dat[pos*2+whi]==-1);else
			if(now==-1) now=dat[pos*2+whi];else
			now=__gcd(dat[pos*2+whi],now);
			if(pos==0) break;
		}
		ans=max(ans,now);
	}
	cout<<ans<<endl;
	rt0;
}

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

int main() {
	string a, b, c;
	cin >> a >> b >> c;
	cout << (unsigned char)(a[0] -32) << (unsigned char)(b[0] -32) << (unsigned char)(c[0] -32) << endl;
	return 0;
}

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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

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

///**************************DONE****************************///

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

    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= n; j++){
            if(i + j <= n && 10000 * i + 5000 * j + (n - i - j) * 1000 == y)
                return cout << i << ' ' << j << ' ' << (n - i - j) << '\n', 0;
        }
    }

    cout << "-1 -1 -1\n";
    return 0;
}


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

int main()
{
	while (1)
	{
		int n, x;
		int count = 0;
		cin >> n >> x;

		if (n == 0 && x == 0)
		{
			break;
		}

		for (int i = 1; i <= n; i++)
		{
			for (int j = 1; j <= n; j++)
			{
				for (int k = 1; k <= n; k++)
				{
					if (i != j && j != k && k != i && i + j + k == x)
					{
						count++;
					}
				}
			}
		}
		cout << count / 6 << "\n"; //1つの組み合わせにつき6通りの足し順がある
	}
	return 0;
}



Measured memory_bytes: 3072
# pragma GCC optimize("O3")
# include <bits/stdc++.h>
std::pair<int,int> DR[] = {{-1,0},{0,1},{1,0},{0,-1},{-1,1},{-1,-1},{1,1},{1,-1}};
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
# define db(x) cerr << #x << " = " << x << '\n'
# define pb push_back
# define mp make_pair
# define all(s) s.begin(),s.end()
# define sz(x) (int)((x).size())
# define int ll
using namespace std;

int n;
int a[1 << 18];
int ans;
int x[1 << 18];
map<int,int>cnt;
int f;

int32_t main(){_
    //freopen("input","r",stdin);
	cin >> n;
	for(int i = 1;i <= n;i++)
	{
		cin >> a[i];
		if(a[i] > i - 1) rc(-1);
		a[i] -= i;
	}
	set<int>s;
	for(int j = n;j >= 1;j--)
	{
		if(sz(s)){
		auto it = s.end();
		it--;
		if(*it > a[j]) rc(-1);
		}
		ans += f;		
		if(cnt[-j]) f--;
		cnt[-j] = 0;
		if(a[j] != -j){cnt[a[j]]++;
		if(cnt[a[j]] == 1) f++;}
		if(a[j] != -j) s.insert(a[j]);
	}
	rc(ans);
}

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

int main()
{
    #ifdef LOCAL_EXEC
    #else
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #endif // LOCAL_EXEC
    long double a,b,product;
    long long int result;
    cin>>a>>b;
    product=a*b;
    result=floor(product);
    cout<<result;
    return 0;
}


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

int main()
{
    int n;
    cin>>n;
    vector<int>a(n);
    int dp[4][100009];
    for(int i=1;i<=n;i++)
    {
        int l,m,n;
        cin>>l>>m>>n;
        dp[1][i]=max(dp[2][i-1],dp[3][i-1])+l;
        dp[2][i]=max(dp[1][i-1],dp[3][i-1])+m;
        dp[3][i]=max(dp[1][i-1],dp[2][i-1])+n;
    }
    cout<<max(max(dp[1][n],dp[2][n]),dp[3][n]);
    return 0;
}

Measured memory_bytes: 1792
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String b = sc.next();
        if (b.compareTo("A") == 0){
            System.out.println("T");
        }else if(b.compareTo("C") == 0){
            System.out.println("G");
        }else if(b.compareTo("G") == 0){
        System.out.println("C");
        }else if(b.compareTo("T") == 0){
            System.out.println("A");
        }
        sc.close();
    }
}

Measured memory_bytes: 22608
x,y=map(int,input().split())
l=[4,6,9,11]
count=0
if x!=2 and y!=2:
    for i in l:
        if x==i or y==i:
            count+=1
        
    if count==2:
        print('Yes')
    elif count==1:
        print('No')
    else:
        print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
def main():
    X = int(input())
    for a in range(X // 100 + 1):
        for b in range((X - a * 100) // 101 + 1):
            for c in range((X - a * 100 - b * 101) // 102 + 1):
                for d in range((X - a * 100 - b * 101 - c * 102) // 103 + 1):
                    for e in range((X - a * 100 - b * 101 - c * 102 - d * 103) // 104 + 1):
                        for f in range((X - a * 100 - b * 101 - c * 102 - d * 103 - e * 104) // 105 + 1):
                            if X - a * 100 - b * 101 - c * 102 - d * 103 - e * 104 - f * 105 == 0:
                                print(1)
                                exit()

    print(0)




if __name__ == "__main__":
    main()

Measured memory_bytes: 41200
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll A,B; cin >> A >> B;
    
    if(A < B) swap(A,B);
    res += A--;
    if(A < B) swap(A,B);
    res += A--;

    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

template<class T, class S>
bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S>
bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}


int main(){
    int n, t = 0; cin >> n;
    int k; cin >> k;
    REP(i, k){
        int b; cin >> b;
        t += (1 << b);
    }
    REP(i, (1 << n)){
        if((t & i) == t){
            cout << i << ":";
            int ii = i, bit = 0;
            while(ii){
                if(ii % 2){
                    cout << " " << bit;
                }
                ++bit; ii /= 2;
            }
            cout << "\n";
        }
    }
    return 0;
}



Measured memory_bytes: 3104
// doot diddly donger cuckerino Hahahahahah

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef unsigned int UINT;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<string, int> PSI;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef tuple<int, int, int> TPL;
typedef priority_queue<int> pqueue;
typedef priority_queue<int, VI, greater<>> pdqueue;

#define sim template<typename T
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define UNIQUE(X) sort(ALL(X)); (X).erase(unique(ALL(X)),(X).end())
#define F first
#define S second
#define SZ(x)           (int)(x).size()
#define ALL(a)         std::begin(a), std::end(a)
#define Fill(n, x)      memset(n,x,sizeof(n))
#define IN_REP         int _t; cin >> _t ; while(_t--)
#define IOS            ios::sync_with_stdio(false);cin.tie(NULL)
#define FOR(i, a, b)    for(int i=(a);i<(b);i++)
#define REP(i, n)       FOR(i,0,n)
#define FORR(i, n)      for(int i=(n);i>=0;i--)
#define EPS (double) 1e-9
#define MOD (LL)(1000*1000*1000 + 7)
#define cerr2(x,y) cerr << (x) << " " << (y) << endl;
#define cout2(x,y) cout << (x) << " " << (y) << endl;
const LD PI = acos(-1);
sim>T gcd(T x, T y) {return (y==0)?x:gcd(y, x % y);}
sim>void mini(T &a, T b) { a = min(a, b); }
sim>void maxi(T &a, T b) { a = max(a, b); }
sim>inline void add(T &x, T y) {x += y;if (x >= MOD) x -= MOD;}
sim>inline void sub(T &x, T y) {x -= y;if (x < 0) x += MOD;}
sim>inline T mul(T a, T b) {LL x = (long long) a * b;x %= MOD;return x;}
sim>inline T power(T base, T exp) {T result = 1; while (exp) {if (exp & 1)result *= base;exp >>= 1;base *= base;}return result;}
sim>inline T power(T a, T b, T mod) {T res = 1;while (b > 0) {if (b & 1) { res = mul(res, a); }a = mul(a, a);b >>= 1;}return res%mod;}
sim>inline T modInverse(T n, T p) { return power(n, p - 2, p)%p; }
sim, typename U>string to_string(pair<T, U> p) {return "" + to_string(p.F) + " " + to_string(p.S) + "";}

int main() {
  IOS;
  int a,b,t;
  cin >> a >> b >> t;
  cout << (t/a)*b << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll    long long int
#define ld    long double
#define pb    push_back
#define mp    make_pair
#define Maxn  1000007
#define ff    first
#define se    second
using namespace std;
 

int main() {
    ll n,d,cnt=0,i;
    cin>>n>>d;
    for(i=1;i<=n;i=i+(2*d+1)){
        cnt++;
    }
    cout<<cnt;
    	
	
}


Measured memory_bytes: 256