akhauriyash/Code-Regression huggingface dataset:
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from collections import Counter
import sys
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))
# WideIntPoint


def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  # SingleInt


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  # HeightString


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  # MatrixInt


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  # NumberGrid


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def f(x):
    cnt = 0
    while x % 2 == 0:
        x //= 2
        cnt += 1
    return cnt


def main():
    N, M = wi()
    a = wi()

    for i in range(len(a)):
        if a[i] % 2 != 0:
            print('0')
            sys.exit()
        else:
            a[i] //= 2

    t = f(a[0])
    for i in range(N):
        if f(a[i]) != t:
            print(0)
            sys.exit()
        else:
            a[i] //= 2**t
    M //= 2**t

    l = 1
    for i in range(N):
        l = lcm(l, a[i])
        if l > M:
            print('0')
            sys.exit()

    M //= l
    ans = (M+1)//2
    print(int(ans))


if __name__ == '__main__':
    main()


Measured memory_bytes: 59632
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <cmath>
#include <cstdio>

using namespace std;

typedef long long ll;

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

int main(int argc, char **argv)
{
    int D;
    cin >> D;
    switch (D) {
        case 22:
            cout << "Christmas Eve Eve Eve" << endl;
            break;
        case 23:
            cout << "Christmas Eve Eve" << endl;
            break;
        case 24:
            cout << "Christmas Eve" << endl;
            break;
        case 25:
            cout << "Christmas" << endl;
            break;
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };



int main() {
	int N, D, X, A[108];
	scanf("%d%d%d", &N, &D, &X);
	for (int i = 0; i < N; i++) {
		scanf("%d", &A[i]);
	}

	for (int i = 0; i < N; i++) {
		X += (D - 1) / A[i] + 1;
	}

	printf("%d", X);

}





/*         提出前の確認事項

・デバッグ用の関数は＜＜コメント化＞＞しているか？
・すべての＜＜入力例＞＞は試したか？
・＜＜限界値分析＞＞はしたか？
・＜＜出力の改行＞＞の有無は確認したか？
・文字列の＜＜スペル＞＞は確認したか？
　　　　　　　　↓
	 ＜＜提出先＞＞に注意して提出！！
*/

Measured memory_bytes: 128
#include<stdio.h>

int main(viod)
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a > b){
		printf("a > b\n");
	}
	if(a < b){
		printf("a < b\n");
	}
	if(a == b){
		printf("a == b\n");
	}
	
	return 0;
 } 


Measured memory_bytes: 2068
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
a = [0] * (N+1)
b = [0] * (M+1)
for i in range(N):
    a[i+1] = a[i] + A[i]
for i in range(M):
    b[i+1] = b[i] + B[i]
ans = 0
j = M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

Measured memory_bytes: 47060
a=input()
x=abs(int(a[0])*100+int(a[1])*10+int(a[2])-753)
for i in range(len(a)-2):
    if abs(int(a[i])*100+int(a[i+1])*10+int(a[i+2])-753)<=x:
        x=abs(int(a[i])*100+int(a[i+1])*10+int(a[i+2])-753)
print(x)


Measured memory_bytes: 3060
#include "bits/stdc++.h"

using namespace std;

#define int long long
#define ll long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl



signed main() {

	int P, Q, R;
	cin >> P >> Q >> R;
	cout << min(min(P + Q, Q+R), R+P) << endl;

	return 0;
}


Measured memory_bytes: 256
import java.io.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int[] ans={};
        
        while(true){
            String str=buf.readLine();
            if(str.length()==1 && str.charAt(0)=='0'){break;}
            
            int sum=0;
            for(int i=0;i<str.length();i++){
                sum +=str.charAt(i)-'0';
            }
            System.out.println(sum);
        }
    }            
}

Measured memory_bytes: 24560
import numpy as np


def split_digits(n):
  digits = []
  while n > 0:
    digits.append(n % 10)
    n = int(n / 10)
  return digits


a, b = map(int, input().split())
c = 0

for i in range(a, b + 1):
  digits = np.array(split_digits(i))
  if (digits == digits[::-1]).all():
    c += 1
    
print(c)


Measured memory_bytes: 27180
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int n; cin>>n;
    vector<int> b;
    b.emplace_back(inf);
    for(int i=0; i<n-1; i++){
        int x; cin>>x;
        b.emplace_back(x);
    }
    b.emplace_back(inf);

    ll sum = 0;
    for(int i=0; i<n; i++){
        sum += min(b[i], b[i+1]);
    }

    cout << sum << endl;
}

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

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> l(n);
	rep(i, n) cin >> l[i];
	sort(l.rbegin(), l.rend());
	int ans = 0;
	rep(i, k) {
		ans += l[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
def ok(l):
    # 長さlの連続部分列で重ならずに2回以上現れるものがある
    D = {}
    for i in range(n-l+1):
        try:
            if D[S[i:i+l]]+l <= i:
                return True
        except:
            D[S[i:i+l]] = i
    return False


n = int(input())
S = input()
# 二分探索でTrueになる最大のkを求める
l, r = 0, n+1
while r-l > 1:
    c = (l+r)//2
    if ok(c):
        l = c
    else:
        r = c
print(l)


Measured memory_bytes: 155272
#include <stdio.h>

#define INF 111111

int H, W, K;
char S[12][1024];

int wa[12][1024];

int main(void) {
	int i, j;
	int search;
	int answer = INF;
	if (scanf("%d%d%d", &H, &W, &K) != 3) return 1;
	for (i = 1; i <= H; i++) {
		if (scanf("%1022s", S[i] + 1) != 1) return 1;
	}
	for (i = 1; i <= H; i++) {
		for (j = 1; j <= W; j++) {
			wa[i][j] = wa[i][j - 1] + (S[i][j] == '1');
		}
	}
	for (i = 1; i <= H; i++) {
		for (j = 1; j <= W; j++) {
			wa[i][j] += wa[i - 1][j];
		}
	}
	for (search = 0; search < (1 << (H - 1)); search++) {
		int mae_col = 0;
		int score = 0;
		for (i = 0; i < H; i++) score += (search >> i) & 1;
		for (i = 1; i <= W; i++) {
			int mae_row = 0, need = 0;
			int kaunto = 0;
			for (j = 1; j <= H; j++) {
				if (S[j][i] == '1') kaunto++;
				if (((search >> (j - 1)) & 1) || j == H) {
					int howaito = wa[j][i] - wa[j][mae_col] - wa[mae_row][i] + wa[mae_row][mae_col];
					if (howaito > K) need = 1;
					mae_row = j;
					if (kaunto > K) score = INF; /* 1列だけで制限を超える */
					kaunto = 0;
				}
			}
			if (need) {
				score++;
				mae_col = i - 1;
			}
		}
		if (score < answer) answer = score;
	}
	printf("%d\n", answer);
	return 0;
}


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

int main(){
	int a,b;
	for(int i=0;i<7;i++){ scanf("%d%d",&a,&b); printf("%d\n",a-b); }
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const long long INF = 1e18;
# define len(x) ((int)(x).size())
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define foreps(i, m, n) for(int i = m;i < n;i++)
# define ALL(x) (x).begin(), (x).end()
# define rall(x) (x).rbegin(), (x).rend()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    ll L, R; cin >> L >> R;
    if (R - L > 3000) cout << 0 << endl;
    else {
        ll ans = 2018;
        for (ll i = L; i < R; i++) 
            for (ll j = i + 1; j <= R; j++)
                ans = min(ans, (i * j) % 2019);
        cout << ans << endl;
    }
}

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

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

  string taro,hanako;
  int t=0,h=0;
  for(int i=0;i<n;i++){
    cin >> taro >> hanako;
    if(taro == hanako){
      t += 1;
      h += 1;
    }
    int j=0;
    while(j<taro.size() || j<hanako.size()){
      if(taro[j] > hanako[j]){
        t += 3;
        break;
      }else if(taro[j] < hanako[j]){
        h += 3;
        break;
      }
      j++;
    }
  }

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



Measured memory_bytes: 3176
#include<bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int> >
#define ll long long
const int INF = 1e8;
const int MAXN = 3e5 + 200;
const  long double eps = 1e-9;
const long double pi = acos(-1.0);
using namespace std;
const ll MOD = 998244353;

int n;
int a[MAXN];
ll ans = 0;
void solve(){
    cin >> n;
    n *= 2;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);

    for (int i = 0; i < n; i += 2){
        ans += a[i];
    }
    cout << ans << endl;
}

int main(){
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(17);
    //freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout)
    int step;
    step = 1;
    for (int i = 1; i <= step; i++)
        solve();

}

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

int dp[1002][1002];

int main()
{
	for (int i = 0; i < 1002; i++)
	{
		dp[0][i] = 0;
		dp[i][0] = 0;
	}
	int N;
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		string str1, str2;
		cin >> str1 >> str2;
		for (int i = 1; i <= str1.size(); i++)
		{
			for (int j = 1; j <= str2.size(); j++)
			{
				if (str1[i - 1] == str2[j - 1])dp[i][j]=dp[i - 1][j - 1] + 1;
				else dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
		cout << dp[str1.size()][str2.size()] << endl;
	}
	return 0;
}

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

using namespace std;
using namespace std;
#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const ll inf = 1e9+7;
const ll mod = 1e9+7;

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

    rep2(i,a,b){
        if(i%k==0){
            cout<<"OK"<<endl;
            return 0;
        }
    }

    cout<<"NG"<<endl;

}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i <= b; i++)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))

int main()
{
    ll N, M; cin >> N >> M;
    vector<pair<ll, ll>> AB;
    rep (i, 0, N) {
        ll a, b; cin >> a >> b;
        AB.emplace_back(a, b);
    }

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

    ll ans = 0;
    rep (i, 0, N) {
        if (M >= AB.at(i).second) {
            M -= AB.at(i).second;
            ans += AB.at(i).first * AB.at(i).second;
        }
        else {
            ans += AB.at(i).first * M;
            M = 0;
        }
        if (M == 0) break;
    }

    cout << ans << endl;
}

Measured memory_bytes: 2420
//defines e includes
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define rep1(i, n) for(int i=0;i<(int)n;i++)
#define rep2(i, a, b) for(int i=(int)a;i<(int)b;i++)
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define p_b pop_back
#define p_f pop_front
#define mp make_pair
#define MAX 200010
#define oo INT_MAX
using namespace std;
//tipagem de pares
typedef pair<int, int> ii;
typedef pair<char, char> cc;
typedef pair<int, char> ic;
typedef pair<char, int> ci;
typedef pair<int, string> istr;
//tipagem de vetores
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vii;
typedef vector<istr> vistr;
typedef vector<bool> vb;
//tipagem de outras estruturas
typedef queue<int> qi;
typedef deque<int> dqi;
//tipagem de tipos primitivos
typedef long long int ll;
typedef unsigned long long int ull;

int main()
{
	
	fastio;
	int count[110] = {0};
	int n, j=0; cin >> n;
	vi dz = {1};
	rep2(i, 1, n+1){
		if(i%10 == 0){
			if(i/10 == dz[j]){
				dz.pb(i);
				j++;
			}
		}else{
			if(i < 10)
				//cout << i << '\n';
				count[i]++;
			else
				//cout << i%10 + (i/dz[j])*10 << '\n';
				count[i%10 + (i/dz[j])*10]++;
		}
	}
	ll ans = 0;
	rep2(i, 1, 100){
		rep2(j, 1, 100){
			if(i == j && (i < 10 && j < 10)){
				ans+=count[i];
			}else{
				if(i < 10 && j > 10){
					int a = j/10;
					int b = j%10;
					if(i == a && i == b){
						ans += count[i]*count[j];
					}
				}else if(i > 10 && j < 10){
					int a = i/10;
					int b = i%10;
					if(j == a && j == b){
						ans += count[i]*count[j];
					}
				}else if(i > 10 && j > 10){
					int a = i/10;
					int b = i%10;
					int c = j/10;
					int d = j%10;
					if(b == c && a == d){
						ans += count[i]*count[j];
					}
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import collections
a = []
while True:
    try:
        n = int(input())
    except EOFError:
        break
    a.append(n)
    
if len(a) != 0:
    b = collections.Counter(a)
    c = b.most_common()
    x = c[0][1]
    d = []
    for elem in c:
        if elem[1] == x:
            d.append(elem[0])
        else:
            break
    d.sort()
    [print(k) for k in d]


Measured memory_bytes: 6008
#include<iostream>
#include<string>
#include<stdio.h>
#include<cctype>
#include<algorithm>
#include<climits>
#include<cmath>
#include<map>
#include<vector>
#define INF INT_MAX
using namespace std;

int N;
int mod = 1000000007;
long long sum;
long ans;

int main(){
	cin >> N;
	vector<int> A(N);
	for (int i = 0; i < N; i++){
		cin >> A[i];
		sum += A[i];
		sum %= mod;
	}
	
	for (int i = 0; i < N; i++){
		sum -= A[i];
		if (sum < 0)sum += mod;
		ans += A[i] * sum;
		ans %= mod;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4044
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...)
#endif

#define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC)
#define TIMESTAMPf(x,...) eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, clock()*1.0/CLOCKS_PER_SEC)

using namespace std;

#ifdef LOCAL
static struct __timestamper {
  string what;
  __timestamper(const char* what) : what(what){};
  __timestamper(const string& what) : what(what){};
  ~__timestamper(){
    TIMESTAMPf("%s", what.data());
	}
} __TIMESTAMPER("end");
#else 
struct __timestamper {};
#endif

typedef long long ll;
typedef long double ld;

void solve(int n) {
  vector<int> a(n);
  for (int& x : a) {
    scanf("%d", &x);
  }
  ll l = 2, r = 2;
  for (int i = n - 1; i >= 0; i--) {
    l = (l + a[i] - 1) / a[i] * a[i];
    r = r / a[i] * a[i];
    if (l > r) {
      printf("-1\n");
      return;
    }
    r = r + a[i] - 1;
  }
  printf("%lld %lld\n", l, r);
}

int main() {
#ifdef LOCAL
  freopen("b.in", "r", stdin);
  freopen("b.out", "w", stdout);
#endif

  int n;
  while (scanf("%d", &n) == 1) {
    solve(n);
  }

  return 0;
}


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

#define mk make_pair
#define sc second
#define fr first
#define pb emplace_back
#define all(s) s.begin(), s.end()
#define sz(s) ( (int)s.size() )
#define Scan(a) scanf ("%I64d", &a)
#define scan(a) scanf ("%d", &a)

using namespace std;

const int inf = (int)1e9 + 7;
const int N = (int)2e6 + 7;

int n;
int a[N];
int v,c,o;

main () {
      cin >> n;

      for (int i = 1; i <= n; i ++) {
            cin >> a[i];

            if (a[i] % 4 == 0) v++;
            else if (a[i] % 2 == 0) c ++;
            else o ++;
      }
      if (c > 0 && v + 1 <= o) {
            puts("No");
            return 0;
      }
      if (c == 0 && v + 1 < o) {
            puts("No");
            return 0;
      }
      puts("Yes");
}


Measured memory_bytes: 640
#include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int n;
  int i,j;
  int x;
  int order[200000]={};

  cin>>n>>x;

  if(x==1 || x==2*n-1)
    cout<<"No"<<endl;

  else if(n==x){
    cout<<"Yes"<<endl;
    rep(i,2*n-1)
      cout<<i+1<<endl;

  }else{
    cout<<"Yes"<<endl;
    if(x==2){
      order[n-2]=4;
      order[n-1]=1;
      order[n]=2;
      order[n+1]=3;
      order[n+2]=5;
      int num=6;
      for(i=3;i<n;i++){
	order[n+i]=num;
	num++;
	order[n-i]=num;
	num++;
      }
    }else{//x>=3
      bool used[200000]={};
      order[n-2]=x-1; used[x-1]=true;
      order[n-1]=x;   used[x]=true;
      order[n]=x+1;   used[x+1]=true;
      order[n+1]=x-2; used[x-2]=true;
      if(x>3)
	order[n+2]=x-3, used[x-3]=true; 
      else//x=3
	order[n+2]=x+2, used[x+2]=true;
      int num=1;
      for(i=3;i<n;i++){
	while(used[num])num++;//search 'false'
	order[n+i]=num;
	num++;
	while(used[num])num++;//search 'false'
	order[n-i]=num;
	num++;
      }
    }
    for(i=1;i<2*n;i++)
      cout<<order[i]<<endl;

  }

}


Measured memory_bytes: 2560
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
 
#define sl(x) scanf("%ld", &x)
#define ss(x) scanf("%s", x)
#define pl(x) printf("%ld\n", x)
#define pd(x) printf("%lf\n", x)
#define ps(x) printf("%s\n", x)
 
#define INF 1000000000000000000
#define MOD 1000000007

#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

int compare_long(const void *a, const void *b) {
	return *(long*)b - *(long*)a;
}

int main() {
	long N, A, B;
	long ans = 0;
	long i, j;
	long len;
	
	sl(N); sl(A); sl(B);
	
	if(N == 1 && A != B) {
		pl((long)0);
		return 0;
	}
	
	if(N == 1 && A == B) {
		pl((long)1);
		return 0;
	}
	
	if(A > B) {
		pl((long)0);
		return 0;
	}
	
	ans = (B - A) * (N - 2) + 1;
	
	pl(ans);
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
using namespace std;
long long n,m,i,j,cnt[1000005],x,y;
int main()
{
	cin>>n>>m;
	for (i=1;i<=n;i++)
	{
		cin>>x>>y;
		cnt[x]+=y;
	}
	i=0;
	while (m>0)
	{
		i++;
		m-=cnt[i];
	}
	cout<<i;
	return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"

using namespace std;

void solve()
{
    int n, k;
    cin >> n >> k;
    vector<long> as(n), xs;
    for (int i = 0; i < n; i++)
    {
        cin >> as[i];
    }
    for (int l = 0; l < n; l++)
    {
        long x = 0;
        for (int r = l; r < n; r++)
        {
            x += as[r];
            xs.push_back(x);
        }
    }
    long ans = 0;
    for (int i = 50; i >= 0; i--)
    {
        int cnt = 0;
        vector<long> ys;
        for (long x : xs)
        {
            if (x >> i & 1)
            {
                cnt++;
                ys.push_back(x);
            }
        }
        if (cnt >= k)
        {
            ans |= 1L << i;
            swap(xs, ys);
        }
    }
    cout << ans << endl;
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 6388
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <sstream>
typedef long long ll;
using namespace std;

int sign(int x) {
    return (x>0)-(x<0);
}

int main(int argc, char const *argv[])
{
    int a, b;
    std::cin >> a >> b;
    int A = sign(a);
    int B = sign(b);
    if (A != B || A == 0 || B == 0) {
        std::cout << "Zero" << std::endl;
    } else if (A > 0) {
        std::cout << "Positive" << std::endl;
    } else {
        if ((a+b)%2 == 0) {
            std::cout << "Negative" << std::endl;
        } else {
            std::cout << "Positive" << std::endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
///////////////////////////////////////

int main() {
	int N, M; cin >> N >> M;
	string A[51], B[51];
	for (int i = 0; i < N; ++i)cin >> A[i];
	for (int i = 0; i < M; ++i)cin >> B[i];
	for (int i = 0; i <= N - M; ++i) {
		for (int j = 0; j <= N - M; ++j) {
			bool key = true;
			for (int k = 0; k < M; ++k) {
				for (int l = 0; l < M; ++l) {
					if (A[i+k][j+l] != B[k][l]) {
						key = false;
					}
				}
			}
			if (key) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}


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

int main(){
    long n,a,b,ans=0;
    cin >> n >> a >> b;
    long x[n];
    rep(i,n) cin >> x[i];
    rep(i,n-1) ans += min((x[i+1]-x[i])*a,b);
    cout << ans << endl;
}

Measured memory_bytes: 1024
//Bouquet problem

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define sd second
#define ft first
#define ios                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

const int p = 1e9 + 7;

// Fast Exponentiation

int fast_pow(int a, int n, int p)
{
    int res = 1;
    a %= p;
    if (a == 0)
        return 0;
    while (n > 0)
    {
        if (n & 1)
            res = (res * a) % p;
        n >>= 1;
        a = (a * a) % p;
    }
    return res;
}

// Modular Inverse

int modInverse(int a, int p)
{
    return fast_pow(a, p - 2, p);
}

// Fermat's Little Method ncr calculation

int ncrfermat(int n, int r, int p)
{
    if (r == 0)
        return 1;

    if (r > (n - r))
        r = n - r;

    int x = 1, y = 1;

    for (int i = 0; i < r; i++)
    {
        x = (x * (n - i)) % p;
        y = (y * (i + 1)) % p;
    }
    return (x * (modInverse(y, p) % p)) % p;
}

int32_t main()
{
    ios;
    int n, a, b;
    cin >> n >> a >> b;
    int sum = fast_pow(2, n, p) - 1;
    sum = (sum - (ncrfermat(n, a, p) + ncrfermat(n, b, p)) + p) % p;
    cout << (sum + p) % p << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

int main()
{
  FAST/**/
   
   ll n;
   cin>>n;
   
   map<ll,ll> ma;
   ll sum = 0;
   rep(n)
   {
       ll temp;
       cin>>temp;
       sum+=temp;
       ma[temp]++;
   }
   
   ll q;
   cin>>q;
   
   while(q--)
   {
       ll b,c;
       cin>>b>>c;
       ll fr = ma[b];
       ma.erase(ma.find(b));
       ma[c]+=fr;
       sum+=(fr*(c-b));
       cout<<sum<<"\n";
   }
   
   
   return 0;        
}  
  
          
   


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

int a[410];
long long f[410][410], sum[410];

long long dfs(int l, int r){
	if (l == r) return 0;
	if (f[l][r]) return f[l][r];
	f[l][r] = 0x3f3f3f3f3f3f3f3fll;
	for (int i = l; i < r; i++){
		f[l][r] = min(f[l][r], dfs(l, i) + dfs(i + 1, r) + sum[r] - sum[l - 1]);
	}
	return f[l][r];
}

int main(){
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++){
		scanf("%d", &a[i]);
		sum[i] = sum[i - 1] + a[i];
	}
	printf("%lld\n", dfs(1, n));
	return 0;
}


Measured memory_bytes: 1536
a,b,ang_c = gets.chomp.split(" ").map &:to_f
ang_c = Math::PI*ang_c/180

puts "#{a*b*Math.sin(ang_c)/2}"
puts "#{a+b+((a**2+b**2)-2*a*b*Math.cos(ang_c))**0.5}"
puts "#{b*Math.sin(ang_c)}"

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

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

    map<int, int> memo;
    for(int i = 0; i < n; i++){
        if(memo.count(a[i])) memo[a[i]]++;
        else memo[a[i]] = 1;
    }

    int ans = 0;
    for(auto p: memo){
        if(p.first < p.second) ans += p.second-p.first;
        else if(p.first > p.second) ans += p.second;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 8004
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

void _main() {
  string S;
  cin >> S;

  ll ans=0, cnt=0;
  fore(i, S) {
    if ('B'==i) cnt++;
    else ans += cnt;
  }
  cout << ans << "\n";
}

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

int main() {
    int N;
    long long D;
    cin >> N >> D;
    vector<long long> X(N);
    vector<long long> Y(N);
    for(int i=0;i<N;i++) {
        cin >> X.at(i) >> Y.at(i);
    }
    int cnt = 0;
    for(int i=0;i<N;i++) {
        if ((X[i]*X[i] + Y[i]*Y[i]) <= D*D) {
            cnt++;
        }
    }
    cout << cnt << endl;
    /*
    for(auto a: X) {
        cout << a << " ";
    }
    cout << endl;
    */
}

Measured memory_bytes: 6408
def daruma(s):
    ans = 0
    s_stack = [s[0]]
    for i in range(1, len(s)):
        if len(s_stack) != 0:
            if s_stack[-1] + s[i] == "01" or s_stack[-1] + s[i] == "10":
                s_stack.pop()
                ans += 2
            else:
                s_stack.append(s[i])
        else:
            s_stack.append(s[i])
    return ans

def main():
    s = input()
    ans = daruma(s)
    print(ans)

main()

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

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

llong PrimeFact(llong n){
	map<llong, int> ret;
	while(n % 2 == 0){
		ret[2]++;
		n /= 2;
	}

	return ret[2];
}

int main(){
	llong N;
	vector<llong> a;

	cin >> N;
	a.resize(N);
	for(int i = 0; i < N; i++)
		cin >> a[i];

	vector<P> v;
	for(auto x: a)
		v.push_back(P(PrimeFact(x), x));
	sort(BE(v));

	vector<llong> ans;
	int i = 0, j = v.size()-1;
	for(int k = 0; i <= j; k++){
		if(k&1)
			ans.push_back(v[j--].second);
		else
			ans.push_back(v[i++].second);
	}

	bool check = true;
	for(int i = 0; i < ans.size()-1; i++)
		if(ans[i]*ans[i+1]%4 != 0)
			check = false;

	if(check)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 4464
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>

using namespace std;
using lli = long long int;
// #define DEBUG
#ifdef DEBUG
#define debug(var) cout << (#var) << ": " << (var) << endl;
template<class T> void dump_array_impl(const T& a) {
  bool first = true;
  for (auto&& x : a) {
    if (!first) { cout << ", "; first = false; }
    cout << x;
  }
}
#define debug_array(a) cout<<(#a)<<": ";dump_array_impl(a);cout<<endl
#else
#define debug(var) {}
#define debug_array(a) {}
#endif
template<class T> void read_n(vector<T>& v, size_t n) {
  v = vector<T>(n);
  for (lli i=0; i<n; ++i) cin >> v[i];
}

int main() {
  int n;
  cin >> n;
  int i=111;
  for (; i<n; i+=111);
  cout << i << endl;
  return 0;
}


Measured memory_bytes: 256
/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

#include <bits/stdc++.h>
using namespace std;

const bool ready = [](){
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(12);
    return true;
}();

const double PI = acos(-1);
using ll= long long;
#define int ll
#define all(v) (v).begin(), (v).end()
#define fori(n) for(int i=0; i<int(n); i++)

#define cini(i) int i; cin>>i;
#define cins(s) string s; cin>>s;
#define cind(d) double d; cin>>d;
#define cinai(a,n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s,n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a,n) vd a(n); fori(n) { cin>>a[i]; }

using pii= pair<int, int>;
using pdd= pair<double, double>;
using vd= vector<double>;
using vb= vector<bool>;
using vi= vector<int>;
using vvi= vector<vi>;
using vs= vector<string>;

#define endl "\n"

/* 
 * check the distance of the diagonals... somehow :/
 */
void solve() {
    cini(n);
    set<int> ppl;
    set<int> pmi;
    for(int i=0; i<n; i++) {
        cini(x);
        cini(y);
        ppl.insert(x+y);
        pmi.insert(x-y);
    }

    const int mipl=*ppl.begin();
    const int mapl=*ppl.rbegin();
    const int mimi=*pmi.begin();
    const int mami=*pmi.rbegin();

    cout<<max(mapl-mipl, mami-mimi)<<endl;
}


signed main() {
    solve();
}

// FIRST THINK, THEN CODE
// DO NOT JUMP BETWEEN PROBLEMS


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

int main(void) {
    int r, c, i, j;
    cin >> r >> c;
    int m[r+1][c+1];
    
    for (i = 0; i <= c; i++) m[r][i] = 0;
    for (i = 0; i <= r; i++) m[i][c] = 0;

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

    for (i = 0; i <= r; i++) {
        for (j = 0; j <= c; j++) {
            cout << m[i][j];
            if (j == c) cout << endl;
            else cout << " ";
        }
    }
    return 0;
}

Measured memory_bytes: 1200
N, M = map(int, input().split())
A = set()
MOD = 1000000007
for _ in range(M):
    A.add(int(input()))

ans = [0] * (N + 1)
ans[0] = 1

for i in range(N + 1):
    if i + 1 < N + 1 and not i + 1 in A:
        ans[i + 1] += ans[i]
        ans[i + 1] %= MOD
    if i + 2 < N + 1 and not i + 2 in A:
        ans[i + 2] += ans[i]
        ans[i + 2] %= MOD

print(ans[N])




Measured memory_bytes: 11968
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <cassert>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
using VVI = vector<vector<long long int> >;

int main(void) {
    Int n, m;
    cin >> n >> m;
    cout << (n * (n - 1) + m * (m - 1)) / 2 << endl;
    return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>
#include <stdlib.h>
struct Node{
  int depth;
  int height;
  int p;//parent
  int l,r;
  int id;
  int c;
} ;

int getHeight(int);

struct Node *tree;
int main(){
  
  int i,j,n,a,id,c,x,y,x1,x2;
  
  scanf("%d",&n);
  tree = malloc(sizeof(struct Node)*n);
  
  for(i=0;i<n;i++){
    tree[i].p = tree[i].l = tree[i].r = -1;
  }
  for(i=0;i<n;i++){
    scanf("%d",&id);
    tree[id].id = id;
    scanf("%d%d",&tree[id].l,&tree[id].r);
  }


  /*for(j=0;j<2;j++){
    printf("fuck\n");
    if(j==0)c = tree[i].l;
    if(j==1)c = tree[i].r;
    if(j==0){
      tree[tree[i].id].l = c;
      tree[c].p = tree[i].id;
      a = c;
    }else{
      tree[a].r = c;
      tree[c].p = tree[i].id;
      a = c;
    }
    }*/
  
  for(i=0;i<n;i++){//getChildren
    tree[i].c=0;
    if(tree[i].l != -1)tree[i].c++;
    if(tree[i].r != -1)tree[i].c++;
  }
  
  for(i=0;i<n;i++){//findParent
    for(j=0;j<n;j++){
      if(tree[i].id == tree[j].l)tree[i].p = tree[j].id;
      else if(tree[i].id == tree[j].r)tree[i].p = tree[j].id;
    }
  }
  
  for(i=0;i<n;i++){//getDepth
    x=0;
    y=i;
    while(tree[y].p>-1){
      y = tree[y].p;
      x++;
    }
    tree[i].depth = x; 
  }

  for(i=0;i<n;i++){//getHeight
    x1=0;
    y=i;
    while(tree[y].l>-1){
      y = tree[y].l;
      x1++;
    }

    x2=0;
    y=i;
    while(tree[y].r>-1){
      y = tree[y].r;
      x2++;
    }
    
    if(x1>=x2)tree[i].height = x1;
    else if(x1<x2)tree[i].height = x2;
  }

  for(i=0;i<n;i++)tree[i].height = getHeight(i);
  
  
  for(i=0;i<n;i++){
    printf("node %d: parent = %d, ",i,tree[i].p);
    if (tree[i].p == -1)printf("sibling = -1, ");
    else if(tree[tree[i].p].l == i)printf("sibling = %d, ",tree[tree[i].p].r);
    else if(tree[tree[i].p].r == i)printf("sibling = %d, ",tree[tree[i].p].l);
    
    //getChildren;
    c=0;
    if(tree[i].l != -1)c++;
    if(tree[i].r != -1)c++;
    printf("degree = %d, ",c);
    
    printf("depth = %d, ",tree[i].depth);
    printf("height = %d, ",tree[i].height);
    
    
    
    
    if(tree[i].p == -1)printf("root");
    else if(tree[i].l == -1 && tree[i].r == -1)printf("leaf");
    else printf("internal node");
    printf("\n");
    /*printf("[");
    if(tree[i].l != -1){
      printf("%d",tree[i].l);
      a = tree[i].l;
      while(1){
        if(tree[a].r == -1)break;
        printf(", %d",tree[a].r);
        a = tree[a].r;
      }
    }
    printf("]\n"); */
  }
  

  free(tree);
  
  
  return 0;
}

int getHeight(int i){
  int a=0,b=0;

  if(tree[i].l == -1 && tree[i].r == -1)return 0;
  else {
    if(tree[i].l != -1)a += getHeight(tree[i].l)+1;
    if(tree[i].r != -1)b += getHeight(tree[i].r)+1;
    if(a >= b) return a;
    else return b;
  }
}



Measured memory_bytes: 2104
#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
using namespace std;

#define INF 1152921504606846976

typedef pair<long long, int> P;

int N, M, K, S;
int Pcost, Qcost;
vector<int> path[100010];
long long cost[100010];
long long d[100010];
bool ng[100010];
bool dangerous[100010];

long long dijkstra() {
  for (int i=0; i<N; i++) d[i] = INF;
  d[0] = 0;

  priority_queue< P, vector<P>, greater<P> > q;
  q.push(P(0, 0));

  while (!q.empty()) {
    P p = q.top(); q.pop();
    int r = p.first;
    int s = p.second;
    if (d[s] < r) continue;

    for (auto t : path[s]) {
      if (d[t] > d[s] + cost[t]) {
        d[t] = d[s] + cost[t];
        q.push(P(d[t], t));
      }
    }
  }
  return d[N-1];
}
/*
long long dijkstra() {
  vector<bool> used(N, false);
  vector<long long> d(N, INF);
  d[0] = 0;

  while (true) {
    int v = -1;
    for (int u=0; u<N; u++) {
      if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
    }
    if (v == -1) break;
    used[v] = true;

    for (auto u : path[v]) {
      d[u] = min(d[u], d[v] + cost[u]);
    }
  }
  return d[N-1];
}
*/

int main() {
  cin >> N >> M >> K >> S;
  cin >> Pcost >> Qcost;

  queue<int> q;

  for (int i=0; i<K; i++) {
    int c;
    cin >> c;
    dangerous[c-1] = true;
    ng[c-1] = true;
    q.push(c-1);
    q.push(S);
  }
  for (int i=0; i<M; i++) {
    int a, b;
    cin >> a >> b;
    path[a-1].push_back(b-1);
    path[b-1].push_back(a-1);
  }
  // bfs
  vector<int> used(N, -1);
  while (!q.empty()) {
    int x = q.front(); q.pop();
    int r = q.front(); q.pop();
    if (r <= 0) continue;

    for (auto d : path[x]) {
      if (r <= used[d]) continue;
      dangerous[d] = true;
      used[d] = r;
      q.push(d);
      q.push(r-1);
    }
  }
  for (int i=0; i<N; i++) {
    if (ng[i]) cost[i] = INF;
    else {
      if (dangerous[i]) cost[i] = Qcost;
      else              cost[i] = Pcost;
    }
  }
  cost[N-1] = 0;
  cout << dijkstra() << "\n";
  return 0;
}

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

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

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

    if(ABC[0] == 5 && ABC[1] == 5 && ABC[2] == 7)
    {
        cout << "YES" << endl;
    }

    else
    {
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
L = [0, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
A, B = map(int, input().split())
print('Draw') if L[A] == L[B] else print('Alice' if L[A] > L[B] else 'Bob')

Measured memory_bytes: 3060
program main
Implicit None
	integer(8)::n,a=1,p=0
	
	read*,n
	
	do
		if((n/a-1) < a) exit
		if(mod(n,a) == 0)then
			if((n/a-1) > a) p = p + n/a-1
		endif
		a = a+1
	enddo
	print"(i0)",p
end program main

Measured memory_bytes: 768
#include <stdio.h>
#define BLACK 2
#define GRAY 1
#define WHITE 0
#define INF 200000
#define N 100
#define NIL -1

int n,G[N][N],d[N];

void dijkstra(void){
  int color[N],pi[N],mincost,u,i,j,v;

  for(i=0;i<n;i++){
    d[i]=INF;
    pi[i]=NIL;
  }
  d[0]=0;
  
  while(1){
    mincost=INF;
    for(i=0;i<n;i++){
      if(color[i]!=BLACK && d[i]<mincost){
	mincost=d[i];
	u=i;
      }
    }
    if(mincost==INF) break;
    color[u]=BLACK;

    for(v=0;v<n;v++){
      if(color[v]!=BLACK && d[u]+G[u][v] < d[v] && G[u][v]!=NIL){
	pi[v]=u;
	d[v]=d[u]+G[u][v];
      }
    }
  }
} 

int main(){
  int i,j,k,u,v,c;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      G[i][j]=NIL;
    }
  }
  
  for(i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d%d",&v,&c);
      G[u][v]=c;
    }
  }

  dijkstra();
  for(i=0;i<n;i++){
    printf("%d %d\n",i,d[i]);
  }
  return 0;
}



Measured memory_bytes: 2088
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

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

    int N, H, W; cin >> N >> H >> W;
    cout << (N - W + 1) * (N - H + 1) << endl;
    return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define int long long
const int MOD=1e9+7;
const int N=3e5+10;

int32_t main()
{
    IOS;
    string s;
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5])
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;

}


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

//#include <tuple>

//#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long
#define pb push_back

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

  if(N>=10){
    cout << R  << endl;
  } else {
    cout << R + 100*(10-N) << endl;
  }
  
  

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long n,a[1000000],mi=1e9,f[1000000],k;
int main()
{
    cin>>n>>k;
    for (long i=1;i<=n;i++)
    {
        cin>>a[i];
        mi=min(mi,a[i]);
    }
    for (long i=1;i<=k;i++)
    {
        for (long j=1;j<=n;j++)
        {
            if (i-a[j]>=0)
            {
                if (f[i-a[j]] ==0) f[i]=1;
            }
        }
    }

        if (f[k]==1)
        {
            cout<<"First";
            return 0;
        }

    cout<<"Second";


}
/*


*/

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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

void solve() {
    //const i64 mod = 1'000'000'007;

    string S;
    cin >> S;

    cout << (S<="2019/04/30"?"Heisei":"TBD") << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main() {
  int n,a,ans=0;
  cin >> n;
  map<int,int> mp;
  for(int i=0; i<n; i++) {
    cin >> a;
    mp[a]++;
  }
  for(auto p:mp) {
    if(p.first<p.second) {
      ans+=p.second-p.first;
    }
    else if(p.first>p.second) {
      ans+=p.second;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 4736
#include <bits/stdc++.h>
#define int int64_t
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define REPP(i, n) for (int i = 1; (i) < (int)(n+1); ++ (i))
#define REPR(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define SORTR(c) sort((c).begin(),(c).end(),greater<int>());
#define BIT(n) (1LL<<(n))
#define PCNT(x) __builtin_popcountll(x)
#define GCD(x,y) __gcd(x,y)
#define LCM(x,y) x/__gcd(x,y)*y
#define PB push_back
#define MP make_pair
#define endl "\n"
#define pa cout << ans << endl
#define p(x) cout << x << endl
#define pall(x) for(auto iter : x) p(iter)
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define yn(x) cout << (x ? "Yes" : "No") << endl
using namespace std;
using Graph = vector<vector<int> >;
using WeightedGraph = vector<vector<pair<int, int> > >;
typedef long double LD;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
const int INF = 2000000000;
const long double PI = acosl(-1);
const int MOD = 1000000007;
void print() {cout << endl;}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " ";print(forward<Tail>(tail)...);}
template <class T> void print(vector<T> &vec) {for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " ";} cout << endl;}
template <class T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec);}}


signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int ans = 0;
    
    int a;
    cin >> a;

    ans = a*a*a+a*a+a;
    cout << ans << endl;
    
    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/abc172/abc172_a && sh shellscripts/test_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc172/abc172_a && sh shellscripts/etest_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc172/abc172_a && sh shellscripts/submit_cpp.sh
*/


Measured memory_bytes: 3684