akhauriyash/Code-Regression huggingface dataset:
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        v: [usize; 5]
    }
    let min = v.iter().min().unwrap();
    println!("{}", (n - 1) / min + 5);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define N 1000005
#define LL long long
using namespace std;
const int mo=1e9+7;
int n; LL f[N],S,ans;
LL G(int t,int n)
{
	return (1LL*(t+1)*n+1LL*(n-t-2)*(n-1))%mo;
}
int main()
{
	int i;
	cin>>n;
	if(n==1){ printf("1"); return 0;}
	f[0]=S=1,ans=G(0,n);
	for(i=1;i<=n;i++){
		f[i]=S;
		if(i>1) f[i]=(f[i]+mo-f[i-2])%mo;
		if(i<n-1) ans=(ans+f[i]*G(i,n))%mo;
		else if(i==n-1) ans=(ans+f[i]*(n-1))%mo;
		else ans=(ans+f[i])%mo;
		S=(S+f[i])%mo;
	  }
	cout<<ans;
	return 0;
}


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

#define FI(i,a,b) for(int i=(a);i<=(b);i++)
#define FD(i,a,b) for(int i=(a);i>=(b);i--)

#define LL long long
#define Ldouble long double
#define PI 3.14159265358979323846264338327950288419

#define PII pair<int,int>
#define PLL pair<LL,LL>
#define mp make_pair
#define fi first
#define se second

using namespace std;

char s[200005], stk[200005];
int len, p;

int main(){
	cin.getline(s, 200005);
	len = strlen(s);
	FI(i, 0, len - 1){
		if(s[i] == 'S') stk[++p] = 'S';
		else if(p > 0 && stk[p] == 'S') p--;
		else stk[++p] = 'T';
	}
	printf("%d\n", p);
	return 0;
}


Measured memory_bytes: 640
#include<algorithm>
#include<functional>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

typedef pair<int ,int > P;

double a,b,c,d,e,f;


int main()
{

	while(cin>>a>>b>>c>>d>>e>>f)
	{
		double y=(f*a-d*c)/(a*e-b*d);

		double x=(c-b*y)/a;
		/*
		if(x==0.0)
			x=0.0;
		if(y==0.0)
			y=0.0;
			*/
		printf("%.3lf %.3lf\n",x,y);

	}
	


	return 0;
}

Measured memory_bytes: 1236
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

vector<int> heights;
vector<int> values;

long long int choose()
{
    int size = heights.size();
    map<int, int> candidates;

    vector<long long int> records(size);

    for(int interval = 0; interval < size; interval++){

        map<int,int>::iterator it = candidates.lower_bound(heights[interval]);
        if(it != candidates.begin()) 
        {
            it--;
            records[interval] = records[it->second]+values[interval];
            it++;
        }
        else
            records[interval] = values[interval];

        while((it != candidates.end()) && (records[it->second] <= records[interval]))
        {
            it = candidates.erase(it);
        }

        candidates[heights[interval]] = interval; 
    }

    return *max_element(records.begin(), records.end());
}

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

    heights = vector<int>(n);
    values = vector<int>(n);

    for(int i = 0; i < n; i++)
        cin >> heights[i];
    for(int i = 0; i < n; i++)
        cin >> values[i];

    long long int result = choose();
    cout << result << "\n";

    return 0;
}


Measured memory_bytes: 12800
#include <stdio.h>

int main(void)
{
    enum { S = 50, SS = S + 1, RS = S * 2 + 1 };
    char o[SS], e[SS];
    scanf("%s %s", o, e);
    char r[RS] = "";
    char *p = r;
    for (size_t i = 0; i < SS; ++i) {
        if (o[i] != '\0') {
            *p++ = o[i];
        } else {
            break;
        }
        *p++ = e[i];
    }
    *p = '\0';
    printf("%s\n", r);
    return 0;
}


Measured memory_bytes: 128
n = input()

a = n[::-1] + "0"

prev_a = int(a[0])
prev_b = 10 - int(a[0])

# dp[下の桁から][繰り上げるかどうか]
for i in range(1, len(a)):
    x = int(a[i])
    y = x + 1
    aa = min([x + prev_a, y + prev_b])
    bb = min([(10 - x) + prev_a, (10 - y) + prev_b])
    prev_a = aa
    prev_b = bb

print(min(aa, bb))

Measured memory_bytes: 5492
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>
#include <numeric>

#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define PI 3.14159265358979

using namespace std;

//================================================

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	string S, from  = "apple", from2 = "peach";
	getline(cin, S);

	string::size_type pos = S.find(from);
	
	REP(i, S.size() - 4) {
		if (S.substr(i, 5) == from) S.replace(i, 5, from2);
		else if (S.substr(i, 5) == from2) S.replace(i, 5, from);	
	}
	cout << S << "\n";
	return 0;
}

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

const int mod=998244353;
#define ll long long
#define ld long double
#define pb push_back
#define Dracarys ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) x.begin(),x.end()

ll po(ll x,ll y,ll md=mod){
	ll res=1;
	x%=md;
	
	while(y){
		if (y&1){
			res=(res*x)%md;
		}
		y>>=1;
		x=(x*x)%md;
	}
	return res;
}

void solve(){
	ll a,b;
	cin>>a>>b;
	cout<<a*b<<"\n";
}

int main(){
	
	Dracarys

	ll t=1;
	//cin>>t;
	while(t--){
		solve();
	}
	return 0;
}



Measured memory_bytes: 3648
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextInt();
        long ok = n;
        long ng = 0;
        while(1 < ok - ng){
            long mid = (ok + ng) /2;
            if(n <= mid * (mid + 1) / 2) ok = mid;
            else ng = mid;
        }
        long diff = ok * (ok + 1) / 2 - n;
        StringBuilder sb = new StringBuilder();
        for (long i = 1; i <= ok; i++) {
            if(i != diff) sb.append(i).append("\n");
            if(i % 1000 == 0){
                System.out.print(sb.toString());
                sb = new StringBuilder();
            }
        }
        if(0 < sb.length()) System.out.print(sb.toString());
        sc.close();
    }

}


Measured memory_bytes: 23764
#include <stdio.h>
#include <string.h>

int main()
{
    char s[BUFSIZ];
    int len;
    int width = 'A' - 'a';
    int i;

    fgets(s, BUFSIZ, stdin);
    len = strlen(s);

    for (i = 0; i < len; i++) {
        if ('a' <= s[i] && s[i] <= 'z') s[i] += width;
    }

    fputs(s, stdout);

    return 0;
}

Measured memory_bytes: 524
#include <iostream>
#include <algorithm>

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

using namespace std;

int main(){
	
	int n;
	cin >> n;
	
	int bucket[100005];
	REP(i,100005) bucket[i]=0;
	REP(i,n){
		int input;
		cin >> input;
		bucket[input] +=1;
	}
	
	int ans=0;
	ans = max(ans,bucket[0]+bucket[1]);
	ans = max(ans,bucket[99998]+bucket[99999]);
	for(int i=1; i<99999; i++){
		ans = max(ans,bucket[i-1]+bucket[i]+bucket[i+1]);
	}
	
	cout << ans << endl;
	
	
	
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 1000000007;
const ll INF = 10000000000000;
#define all(v) v.begin(), v.end()

int main(){
  ll N,a=0,m=0,n=0;
  cin >> N;
  vector<ll> A(N),B(N);
  rep(i,N){
    cin >> A.at(i);
  }
  rep(i,N){
    cin >> B.at(i);
    a+=A.at(i)-B.at(i);
    if(A.at(i)>B.at(i)){
      m+=A.at(i)-B.at(i);
    }else{
      n+=(B.at(i)-A.at(i)+1)/2;
    }
  }
  if(a>0||m>-a||n>-a){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 3752
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

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

// container util
#define all(x) (x).begin(), (x).end()

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                         \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
       << " " << __FILE__ << endl;

// typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

// constant
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

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

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

  int n;
  while (cin >> n, n) {
    string w[44];
    rep(i, n) cin >> w[i];

    int c[6] = {5, 7, 5, 7, 7};
    int cnt = 0, len = 0, ans = -1;
    bool flag = false;
    rep(j, n) {
      cnt = 0, len = 0;
      FOR(i, j, n) {
        len += (int)w[i].size();
        if (len == c[cnt]) {
          cnt++;
          len = 0;
        } else if (c[cnt] < len) {
          break;
        }

        if (cnt == 5) {
          ans = j + 1;
          flag = true;
          break;
        }
      }
      if (flag) break;
    }
    cout << ans << "\n";
  }

  return 0;
}


Measured memory_bytes: 3120
#include <stdio.h>

int main(void)
{
    int a,b,c,d,e,k;
    scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&k);
    if (e-a<=k) 
    printf("Yay!\n",d);
    else 
    printf(":(\n",c); 
    return 0;
}



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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n+1);
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	
	vector<int> box(n+1);
	for(int i = n; i > 0; i--) {
		int sum = 0;
		for(int j = i; j <= n; j += i) {
			sum ^= box[j];
		}
		if(sum == a[i]) continue;
		bool found = false;
		for(int j = i; j <= n; j += i) {
			if(box[j] == 0) {
				box[j] = 1;
				found = true;
				break;
			}
		}
		if(!found) {
			cout << -1 << endl;
			exit(0);
		}
	}
	
	for(int i = 1; i <= n; i++) {
		int sum = 0;
		for(int j = i; j <= n; j += i) {
			sum ^= box[j];
		}
		if(sum != a[i]) {
			cout << -1 << endl;
			exit(0);
		}
	}
	
	vector<int> balls;
	for(int i = 1; i <= n; i++) {
		if(box[i]) {
			balls.push_back(i);
		}
	}
	cout << balls.size() << endl;
	if(balls.size()) {
		for(int i = 0; i < (int) balls.size(); i++) {
			cout << balls[i] << ' ';
		}
		cout << endl;
	}
}


Measured memory_bytes: 3192
import sys
from itertools import accumulate
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


class BIT:
    def __init__(self,init_value):
        self.n = len(init_value)
        self.tree = [0]*(self.n+1)
        for i in range(1,self.n+1):
            x = init_value[i-1]
            while i <= self.n:
                self.tree[i] += x
                i += i & (-i)

    def update(self,i,x):  # i(1-index)番目の値を+x
        while i <= self.n:
            self.tree[i] += x
            i += i & (-i)
        return

    def query(self,i):  # 1番目からi(1-index)番目までの和を返す
        res = 0
        while i > 0:
            res += self.tree[i]
            i -= i & (-i)
        return res


N = I()
A = LI()


def f(x):  # A[l:r+1] の中央値が x 以上になる (l,r) の個数が、全体の半分以上あるか
    B = [0] + [1 if A[i] >= x else -1 for i in range(N)]
    B = list(accumulate(B))
    B = [b+N for b in B]
    # Bi <= Bj たる (i,j) の個数を数える
    bit = BIT([0]*(2*N+2))
    count = 0
    for i in range(N+1):
        b = B[i]
        count += bit.query(b+1)
        bit.update(b+1,1)
    return True if count >= (N*(N+1)+3)//4 else False


ok = 1
ng = 10**9+1
while ok+1 < ng:
    mid = (ok+ng)//2
    if f(mid):
        ok = mid
    else:
        ng = mid

print(ok)


Measured memory_bytes: 182956
#include<bits/stdc++.h>
#define de(x) cout<<#x<<"="<<x<<endl
#define dd(x) cout<<#x<<"="<<x<<" "
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define repd(i,a,b) for(int i=a;i>=(b);--i)
#define repp(i,a,b,t) for(int i=a;i<(b);i+=t)
#define mt(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp(u,v) make_pair(u,v)
#define sz(a) (int)a.size()
#define pb push_back
#define PI acos(-1.0)
#define qc std::ios::sync_with_stdio(false)
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;

const ll mod = 1000000007;
const int N = 2e5+6;
const int M = 2e6+6;
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;

bool eq(const db &a, const db &b) { return fabs(a - b) < eps; }
bool ls(const db &a, const db &b) { return a + eps < b; }
bool le(const db &a, const db &b) { return eq(a, b) || ls(a, b); }
ll gcd(ll a,ll b) { return a==0?b:gcd(b%a,a); };
ll lcm(ll a,ll b) { return a/gcd(a,b)*b; }
ll kpow(ll a,ll b) {ll res=1;a%=mod; if(b<0) return 1; for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll read(){
    ll x=0,f=1;char ch=getchar();
    while (ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
//inv[1]=1;
//for(int i=2;i<=n;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
int m, k;
int main() {
	while(~scanf("%d%d", &m,&k)) {
		if(m == 1) {
			if(!k) printf("0 0 1 1");
			else printf("-1\n");
		} else {
			if(k >= (1 << m)) {
				printf("-1\n");
				continue;
			}
			vi ret; ret.clear();
			rep(i, 0, 1 << m) {
				if(i == k) continue;
				ret.pb(i);
			}
			ret.pb(k);
			repd(i, (1 << m) - 1, 0) {
				if(i == k) continue;
				ret.pb(i);
			}
			ret.pb(k);
			rep(i, 0, sz(ret)) printf("%d%c", ret[i], " \n"[i+1==sz(ret)]);
		}
		printf("\n");
	}
    return 0;
}


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

int main(){
  int a, b;
  cin>> a>> b;
  if(a<=9&&b<=9) cout<< a*b<< endl;
  else cout<< "-1"<< endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner scanner = new Scanner(System.in);
    int money = scanner.nextInt();
    int cake = scanner.nextInt();
    int donut = scanner.nextInt();

    money = money - cake;

    int dNum = money / donut;

    money = money - (donut * dNum);

    System.out.println(money);


  }

}

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

int main(void){
  int W, H, xr, yr, r, xr2, yr2;

  cin >> W >> H >> xr >> yr >> r;

  xr2 = xr;
  yr2 = yr;
  xr += r;
  yr += r;
  xr2 -= r;
  yr2 -= r;

  if ( xr <= W && yr <= H && xr2 >= 0 && yr2 >= 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 3108
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    TreeMap<Long, Integer> map = new TreeMap<>();
    for (int i = 0; i < N; i++) {
      long tmp = sc.nextLong();
      if (map.containsKey(tmp)) {
        map.put(tmp, map.get(tmp) + 1);
      } else {
        map.put(tmp, 1);
      }
    }
    ArrayList<Long> r = new ArrayList<>();
    ArrayList<Long> s = new ArrayList<>();
    Set<Long> keySet = map.keySet();
    for (Long key : keySet) {
      if (map.get(key) >= 2) {
        r.add(key);
      }
      if (map.get(key) >= 4) {
        s.add(key);
      }
    }
    long max1 = 0;
    if (r.size() >= 2) {
      max1 = r.get(r.size() - 1) * r.get(r.size() - 2);
    }
    long max2 = 0;
    if (s.size() >= 1) {
      max2 = s.get(s.size() - 1) * s.get(s.size() - 1);
    }
    System.out.println(Long.max(max1, max2));
  }
}

Measured memory_bytes: 62992
#include <bits/stdc++.h>
using namespace std;
int b,c,e;
int main() {
    int n1,n2;
    cin>>n1;
    vector<int> a(n1);
    for(int i=0;i<n1;i++){
        cin>>a[i];
    }
    cin>>n2;
    while(n2--){
        int b,c,e;
        cin>>b>>c>>e;
        rotate(a.begin()+b,a.begin()+c,a.begin()+e);
    }
    for(int i=0;i<n1;i++){
        if(i) cout<<" ";
        cout<<a[i];
    }
    cout<<endl;
}



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

using namespace std;
typedef long long ll;


ll ans,mx,mn=1e8,sum;
int main(){
	ll n;
	cin>>n;
	for(int i=0; i<n; i++){
		ll a;
		cin>>a;
		sum += a-1;
	}
	cout<<sum<<endl;
}


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

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

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

  string s, t; cin >> s >> t;

  if(s.size() < t.size()) {
    cout << "UNRESTORABLE" << '\n';
    return 0;
  }

  for(int i = s.size()-t.size(); i >= 0; i--) {
    string ans = s;
    bool flag = true;
    rep(j, t.size()) {
      if(ans[i+j] == '?') ans[i+j] = t[j];
      if(ans[i+j] != t[j]) {
        flag = false;
        break;
      }
    }
    if(flag) {
      rep(k, ans.size()) {
        if(ans[k] == '?') ans[k] = 'a';
      }
      cout << ans << '\n';
      return 0;
    }
  }

  cout << "UNRESTORABLE" << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
const string nl="\n";
const ll MOD=1000000007;
const int NMAX=304;
double p[NMAX][NMAX][NMAX],ev[NMAX][NMAX][NMAX];	
int main(){
    int n;cin>>n;
    int a[n];int cnt[4]={};
    for(int i=0;i<n;i++){ 
    	cin>>a[i];
    	cnt[a[i]]++;
	}

	// memset(p,0,sizeof(p));memset(ev,0,sizeof(ev));
	p[cnt[1]][cnt[2]][cnt[3]]=1;
	for(int c=n;c>=0;c--){
		for(int b=n;b>=0;b--){
			for(int a=n;a>=0;a--){
				if(a==0 && b==0 && c==0){
					continue;
				}
				if(a+b+c>n){
					continue;
				}
				double p_ws = (double) (n-(a+b+c))/n;
				double ev_ws = p_ws/(1-p_ws) +1;
				// cout<<ev_ws<<endl;
				ev[a][b][c]+=ev_ws*p[a][b][c];
				if(a){
					double p_go = (double) a/(a+b+c);
					p[a-1][b][c] += p[a][b][c]*p_go;
					ev[a-1][b][c] += ev[a][b][c]*p_go;
				}
				if(b){
					double p_go = (double) b/(a+b+c);
					p[a+1][b-1][c] += p[a][b][c]*p_go;
					ev[a+1][b-1][c]+=ev[a][b][c]*p_go;
				}
				if(c){
					double p_go = (double) c/(a+b+c);
					p[a][b+1][c-1] += p[a][b][c]*p_go;
					ev[a][b+1][c-1] += ev[a][b][c]*p_go;
				}
			}
		}
	}
	cout<<fixed<<setprecision(10)<<ev[0][0][0]<<nl;
    return 0;
}

Measured memory_bytes: 434560
import java.util.*;

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

        int K = sc.nextInt();
        int S = sc.nextInt();

        int count = 0;

        for(int i = 0; i <= K ; i++){
            for(int j = 0; j <=K ; j++){
                if((S-i-j)<=K && 0 <=(S-i-j)){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 23636
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,k;
char s[100];
int main()
{
	scanf("%d%d",&n,&k);
	scanf("%s",s+1);
	s[k]+='a'-'A';
	printf("%s",s+1);
	return 0;
}

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

int main(){

  long long A, B, N, suuji;
  cin >> A >> B >> N;
 
 if(N >= B){
    N = B -1;
  }
  
  long long suuji1 = (A * N)/B;
  long long suuji2 = N/B;
  
  

  suuji = suuji1 + A * suuji2;
  cout << suuji << endl;
  return 0;
}


Measured memory_bytes: 3588
#include<iostream>
#include<string>

using namespace std;

int main() {
	int h, w;
	cin >> h >> w;
	
	for (int i = 0; i < h; i++) {
		string str;
		cin >> str;
		cout << str << endl;
		cout << str << endl;
	}


	return 0;
}

Measured memory_bytes: 256
N,M,S = gets.split.map &:to_i
UVAB = M.times.map{ gets.split.map(&:to_i) }
CD = [0] + N.times.map{ gets.split.map(&:to_i) }

class PriorityQueue
  attr_reader :size

  def initialize
    @heap = []
    @size = 0
  end

  def add(n)
    i = @size
    while i > 0 do
      parent_index = (i - 1) / 2
      break if get_priority(n) >= get_priority(@heap[parent_index])

      @heap[i] = @heap[parent_index]
      i = parent_index
    end

    @heap[i] = n
    @size += 1
  end

  def get_priority(n)
    n[2]
  end

  def pop
    return if @size <= 0
    min_n = @heap[0]
    @size -= 1
    n = @heap[@size]
    i = 0
    while i * 2 + 1 < @size do
      child_index1 = i * 2 + 1
      child_index2 = i * 2 + 2
      if child_index2 < @size && get_priority(@heap[child_index2]) < get_priority(@heap[child_index1])
        child_index1 = child_index2
      end
      break if get_priority(@heap[child_index1]) >= get_priority(n)

      @heap[i] = @heap[child_index1]
      i = child_index1
    end
    @heap[i] = n
    min_n
  end

  def min; @heap[0] end
  def values; @heap.first(@size) end
end

routes = Array.new(N+1){[]}
amax = 0
UVAB.each do |u,v,a,b|
    routes[u] << [v,a,b]
    routes[v] << [u,a,b]
    amax = a if amax < a
end

SMAX = amax * (N-1)
s = [S,SMAX].min
times = Array.new(N+1){[10**20]*(SMAX+1)}
times[1][s] = 0

query = PriorityQueue.new
query.add([1,s,0])

while query.size > 0
    city,s,t = query.pop
    time = times[city][s]
    next if time < t

    c,d = CD[city]
    if s < SMAX then
        ns = [s + c, SMAX].min
        ntime = time + d
        if ntime < times[city][ns] then
            times[city][ns] = ntime
            query.add [city,ns,ntime]
        end
    end

    routes[city].each do |ncity,a,b|
        next if s < a
        ns = s - a
        ntime = time + b
        if ntime < times[ncity][ns]  then
            times[ncity][ns] = ntime
            query.add [ncity,ns,ntime]
        end
    end
end

puts times.drop(2).map{ _1.min }

Measured memory_bytes: 21268
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    char b;
    cin>>b;
    if('A'==b){
        cout<<'T';
    }else if('C'==b){
        cout<<'G';
    }else if('G'==b){
        cout<<'C';
    }else{
        cout<<'A';
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
                                                                                                

int main(void){
                                                                                                
   
    int a, b, c, m, k;
   
   
      
    scanf("%d %d %d", &a, &b, &c );
   
   
    m = a;

    if( m < b ) m = b;

    if( m < c ) m = c;


    if( ( a + b + c ) % 2 == ( 3 * m ) % 2 ){

        k = ( 3 * m - ( a + b + c ) ) / 2;

        }

    else{

            m += 1;

            k = ( 3 * m - ( a + b + c ) ) / 2;

            }


    printf("%d\n", k );


    return 0;
                                                          
}

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

template<class T>
class SqrtDecomposition {
private:
    const size_t B, _size;
    T const init;
    vector<T> a, b;

public:
    SqrtDecomposition(const size_t size = 0,
               T const &init_ = numeric_limits<T>::max(),
               const size_t B_ = 310)
        : B(B_), _size(size), init(init_),
          a(size, init), b(size/B + 1, init){}

    SqrtDecomposition(const vector<T> &a, const size_t B = 310)
        : B(B), _size(a.size()), init(numeric_limits<T>::max()),
          a(a), b(_size/B + 1, init){
        for(size_t i = 0; i < a.size(); i++){
            b[i/B] = min(b[i/B], a[i]);
        }
    }

    size_t size() const {
        return _size;
    }

    T get(const size_t &l, const size_t &r) const {
        T res = numeric_limits<T>::max();
        size_t i = l;
        while(i < r){
            if(i%B == 0 && i + B <= r){
                res = min(res, b[i/B]);
                i += B;
            } else {
                res = min(res, a[i]);
                i++;
            }
        }
        return res;
    }

    void set(const size_t &p, const T &x){
        a[p] = x, b[p/B] = init;
        size_t s = p/B, end = min(p - p%B + B, size());
        for(size_t i = p - p%B; i < end; i++){
            b[s] = min(b[s], a[i]);
        }
    }

    vector<T> to_a(int l = -1, int r = -1){
        if(l == -1) l = 0;
        if(r == -1) r = size();
        vector<T> res(r-l);
        for(int i = l; i < r; i++) res[i-l] = get(i,i+1);
        return res;
    }
};

typedef vector<int> vi;
vector<int> solve(int n, int q, const vi &a, const vi &b, const vi &c){
    vector<int> ans;
    SqrtDecomposition<int32_t> rmq(n, (1LL<<31)-1);
    for(int i = 0; i < q; i++){
        if(a[i] == 0){
            rmq.set(b[i],c[i]);
        } else {
            ans.push_back(rmq.get(b[i],c[i]+1));
        }
    }
    return ans;
}

int main(){
    int n,q;
    cin >> n >> q;
    vector<int> a(q), b(q), c(q);
    rep(i,q) cin >> a[i] >> b[i] >> c[i];
    auto ans = solve(n,q,a,b,c);
    rep(i,ans.size()) cout << ans[i] << '\n';
}

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


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> d(n);
	rep(i, n) cin >> d[i];
	int ans = 0;
	for (int i = 0; i < n - 1;++i) {
		for (int j = i + 1; j < n; ++j) {
			ans += d[i] * d[j];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int N;
ll twopow[20], tenpow[1000000], ninepow;

ll mypow(ll a, ll b) {
  ll tmp;
  ll two;
  ll ans = 1;
  while(b>0) {
    two = 1;
    tmp = a;
    while(2*two<b) {
      two *= 2;
      tmp *= tmp;
      tmp %= mod1;
    }
    b -= two;
    ans *= tmp;
    ans %= mod1;
  }
  return ans;
}

struct SegmentTree {
  vector<pair<ll, ll> > Tree[20];

  void init() {
    for(int i=0;i<20;++i) {
      Tree[i].resize((1<<i));
    }
    for(int i=0;i<N;++i) Tree[19][i] = mp(1, 0);
    ll ten=10;
    for(int pos1=18;pos1>=0;--pos1) {
      for(int pos2=0;pos2<Tree[pos1].size();++pos2) {
        Tree[pos1][pos2].fi = (Tree[pos1+1][2*pos2].fi*ten%mod1+Tree[pos1+1][2*pos2+1].fi)%mod1;
      }
      ten *= ten;
      ten %= mod1;
    }
  }

  void eval(int pos1, int pos2) {
    if(Tree[pos1][pos2].se==0) return;
    if(pos1+1<20) {
      Tree[pos1+1][2*pos2].se = Tree[pos1][pos2].se;
      Tree[pos1+1][2*pos2+1].se = Tree[pos1][pos2].se;
    }
    ll len = twopow[19-pos1];
    Tree[pos1][pos2].fi = Tree[pos1][pos2].se*(tenpow[len]-1)%mod1*ninepow%mod1;
    Tree[pos1][pos2].se = 0;
  }

  void update(int ql, int qr, ll D, int pos1=0, int pos2=0, ll sl=0, ll sr=(1<<19)) {
    eval(pos1, pos2);
    if(qr<=sl || sr<=ql) return;
    if(ql<=sl && sr<=qr) {
      Tree[pos1][pos2].se = D;
      eval(pos1, pos2);
      return;
    }
    update(ql, qr, D, pos1+1, 2*pos2, sl, (sl+sr)/2);
    update(ql, qr, D, pos1+1, 2*pos2+1, (sl+sr)/2, sr);
    ll len = twopow[20-pos1-2];
    ll ten = tenpow[len];
    Tree[pos1][pos2].fi = (Tree[pos1+1][2*pos2].fi*ten%mod1+Tree[pos1+1][2*pos2+1].fi)%mod1;
    return;
  }

  ll find(int ql, int qr, int pos1=0, int pos2=0, int sl=0, int sr=(1<<19)) {
    eval(pos1, pos2);
    if(qr<=sl || sr<=ql) return 0;
    if(ql<=sl && sr<=qr) return (Tree[pos1][pos2].fi*tenpow[N-sr])%mod1;
    return (find(ql, qr, pos1+1, 2*pos2, sl, (sl+sr)/2)+find(ql, qr, pos1+1, 2*pos2+1, (sl+sr)/2, sr))%mod1;
  }

  void check() {
    for(int i=16;i<20;++i) {
      for(int j=0;j<(1<<(i-16));++j) {
        cout<<"("<<Tree[i][j].fi<<","<<Tree[i][j].se<<")"<<" ";
      }
      cout<<endl;
    }
  }
};

int main() {
  twopow[0] = 1;
  tenpow[0] = 1;
  for(int i=1;i<20;++i) twopow[i] = twopow[i-1]*2%mod1;
  for(int i=1;i<1000000;++i) tenpow[i] = tenpow[i-1]*10%mod1;
  ninepow = mypow(9, mod1-2);
  int Q;
  cin>>N>>Q;
  SegmentTree tree;
  tree.init();
  ll ans[Q];
  ll L, R, D;
  for(int i=0;i<Q;++i) {
    cin>>L>>R>>D;
    L--;
    tree.update(L, R, D);
    ans[i] = tree.find(0, N);
  }
  for(int i=0;i<Q;++i) cout<<ans[i]<<endl;
}



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

const int MOD = 1000000007;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
    /*A
    int n;
    cin>>n;
    int x = n%10;
    if(x==2||x==4 ||x==5|| x==7|| x==9)
    {
        cout<<"hon"<<endl;
    }
    else if(x==0||x==1||x==6||x==8)
    {
        cout<<"pon"<<endl;
    }
    else
    {
        cout<<"bon"<<endl;
    }
    */
    
    int k;
    string s;
    cin>>k>>s;
    if(s.size()>k)
    {
        for(int i=0;i<k;i++)
        {
            cout<<s[i];
        }
        cout<<"..."<<endl;
    }
    else
    {
        cout<<s<<endl;
    }
    
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define ALL(x) (x).begin(), (x).end()

int bfs(int n, vector<vector<int>> M, int pcol, int N);

vector<int> colors, check;

int main()
{
    int N,M;
    cin >> N >> M;
    vector<int> q(N+1);
    
    int p;
    string S;
    int pen=0,acs=0;
    
    for (int i=0; i<M; i++) {
        cin >> p >> S;
        
        if(S=="WA"){
            if(q[p]>=0) q[p]++;
        } else {
            if(q[p]>=0) {
                pen += q[p];
                acs ++;
                q[p] = -1;
            }
        }
    }
    cout << acs << " " << pen << endl;
    
    
    return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<math.h>
int n;

void compute(int depth,double x1,double y1,double x2,double y2){
  double si60 = sqrt(3.0)/2.0;
  double co60 = 0.5;
  
  double sx = (x1+x1+x2)/3.0;
  double sy = (y1+y1+y2)/3.0;
  double tx = (x1+x2+x2)/3.0;
  double ty = (y1+y2+y2)/3.0;
  
  double vx = tx-sx;
  double vy = ty-sy;
  
  double ux = sx + co60*vx - si60*vy;
  double uy = sy + si60*vx + co60*vy;
  
  if(depth>=n)return;
  
  compute(depth+1,x1,y1,sx,sy);
  printf("%.8f %.8f\n",sx,sy);  
  compute(depth+1,sx,sy,ux,uy);
  printf("%.8f %.8f\n",ux,uy);
  compute(depth+1,ux,uy,tx,ty);
  printf("%.8f %.8f\n",tx,ty);    
  compute(depth+1,tx,ty,x2,y2);

  
}

int main(){
  scanf("%d",&n);
  printf("%.8f %.8f\n",0.0,0.0);
  compute(0,0.0,0.0,100.0,0.0);
  printf("%.8f %.8f\n",100.0,0.0);
  return 0;
}

Measured memory_bytes: 640
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>

/*
#include<boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Real = mp::number<mp::cpp_dec_float<1024>>;
using Bint = mp::cpp_int;
*/

using namespace std;

#define int long long
#define REP(i,s,e) for((i)=(s);(i)<(e);(i)++)
#define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--)
#define FOR(i,n) for((i)=(0);(i)<(n);(i)++)
#define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--)
#define MOD 1000000007


signed main(){
    int A,B,C;
    cin>>A>>B>>C;
    
    if(A==B&&A!=C||A==C&&A!=B||C==B&&A!=C) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int N, X, T;
    cin >> N >> X >> T;
    int ans = 0;
    while (N > 0) {
        ans += T;
        N -= X;
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3628
N, D = map(int, input().split())
xy = list(list(map(int, input().split())) for _ in range(N))
a = []
b = []
ans = 0
cnt = 0
for i, v in enumerate(xy, start=1):
    j = i
    while j < len(xy):
        a = v
        b = xy[j]
        for m in range(len(a)):
            ans += (b[m] - a[m]) ** 2

        ans = ans ** 0.5
        if ans.is_integer():
            cnt += 1
        ans = 0
        j += 1
print(cnt)


Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		
		System.out.println();
		scan.close();
		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				System.out.print(array[k]);
				if ( k == n - 1) break;
				System.out.print(" ");
				
			}
			System.out.println();
		}
		
	}
}



Measured memory_bytes: 34128
const input = require("fs").readFileSync("/dev/stdin", "utf8") 

;(input => {
    const lines = input.split('\n')
    const [N, M, Q] = lines[0].split(' ').map(Number)

    const L = []
    const R = []
    for (let i = 0; i < M; i++) {
        [L[i], R[i]] = lines[i + 1].split(' ').map(Number)
    }

    const p = []
    const q = []
    for (let i = 0; i < Q; i++) {
        [p[i], q[i]] = lines[i + 1 + M].split(' ').map(Number)
    }

    const r = Array(N).fill().map(_ => Array(N).fill(0))
    for (let i = 0; i < M; i++) {
        r[L[i] - 1][R[i] - 1]++
    }
    for (let i = 0; i < N; i++) {
        for (let j = 1; j < N; j++) {
            r[i][j] += r[i][j - 1]
        }
    }

    const ans = []
    for (let i = 0; i < Q; i++) {
        let sum = 0
        for (let j = p[i] - 1; j < N; j++) {
            sum += r[j][q[i] - 1]
        }
        ans.push(sum)
    }
    console.log(ans.join('\n'))

})(input)


Measured memory_bytes: 99744
// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair< int, int > pii;
typedef vector<pii>vip;
typedef pair< pii, int > ppi;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 200005;

void task(){
 	int x; cin >>  x;
 	int ans;
 	if(x>=400 and x<=599)ans = 8;
 	else if(x>=600 and x<=799)ans = 7;
 	else if(x>=800 and x<=999)ans = 6;
 	else if(x>=1000 and x<=1199)ans = 5;
 	else if(x>=1200 and x<=1399)ans = 4;
 	else if(x>=1400 and x<=1599)ans = 3;
 	else if(x>=1600 and x<=1799)ans = 2;
 	else if(x>=1800 and x<=1999)ans = 1;
 	cout << ans << endl;






}

int main(){
        _
        #ifdef OJ
        freopen("inputf.in", "r", stdin);
        freopen("outputf.in", "w", stdout);
        #endif

        int T = 1; //cin >> T;
        while(T--){
            task();
        }
        
return 0;
}




Measured memory_bytes: 3648
D,G=map(int,input().split())
answer=0
Q=[]
for i in range(D):
  p,c=map(int,input().split())
  answer+=p
  Q.append((i+1,p,c))
dp=[-10]*(answer+1)

dp[0]=0
for i,p,c in Q:
  for j in range(answer,-1,-1):
    for k in range(1,p+1):
      if k==p:
        cc=i*100*k+c
      else:
        cc=i*100*k
      if j-k>=0:
        dp[j]=max(dp[j],dp[j-k]+cc)
        
for i in range(answer+1):
  if dp[i]>=G:
    print(i)
    break

'''
from operator import itemgetter
import copy

D,G=map(int,input().split())

score=[]
scoreBonus=[]

answer=0
answerscore=G

for i in range(D):
  score.append(list(map(int,input().split())))
  scoreBonus.append([(i+1)*100,(i+1)*100,score[i][0],score[i][0]*(i+1)*100+score[i][1],0])
  
Bonus=copy.deepcopy(scoreBonus)
print(Bonus)



while(answerscore>0):
  Deletescore=[]
  
  
  
  for i in range(len(scoreBonus)):
    if scoreBonus[i][1]*scoreBonus[i][2]<=answerscore:
      scoreBonus[i][0]=(score[i][0]*(i+1)*100+score[i][1])//(score[i][0])
      scoreBonus[i][4]=1
    if scoreBonus[i][1]*scoreBonus[i][2]>answerscore:
      scoreBonus[i][0]=scoreBonus[i][1]
      scoreBonus[i][4]=0
    answerscore-=scoreBonus[i][3]
    answer+=scoreBonus[i][2]
    Deletescore.append(i)
  scoreBonus.sort(reverse=True)

  print(scoreBonus)
  print(Bonus)

  for i in range(len(scoreBonus)):
    count=scoreBonus[i][2]
    if scoreBonus[i][4]==1:
      answerscore-=scoreBonus[i][3]
      answer+=scoreBonus[i][2]
      count=0
      Deletescore.append(i)
      break;
    while(answerscore>0 and count!=0):
      answerscore-=scoreBonus[i][1]
      print(answerscore)
      answer+=1
      count-=1
    if answerscore<=0:
      print(answer)
      exit() 
  print(Deletescore)
  del scoreBonus[Deletescore[i]]
  print(scoreBonus)

print(answer)
print(scoreBonus)
if answerscore<=0:
  print(answer)
  exit()
  


scoreR=sorted(scoreBonus, key=itemgetter(1),reverse=True)
print(scoreR)
'''


Measured memory_bytes: 3188
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a,b,c = LI()
k = I()
cnt1 = 0
while b <= a:
    b *= 2
    cnt1 += 1
cnt2 = 0
while c <= b:
    c *= 2
    cnt2 += 1
if cnt1 + cnt2 <= k:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 65460
#include <bits/stdc++.h>
using namespace std;
const int maxn = int(4e4) + 7, mod = int(1e9) + 7;
typedef long long ll;
ll fac[maxn], inv[maxn];

ll power_mod(ll p, ll q) {
    ll ret = 1;
    while (q) {
        if (q & 1) ret = ret * p % mod;
        p = p * p % mod;
        q >>= 1;
    }
    return ret;
}

void init() {
    fac[0] = 1;
    for (int i = 1; i <= maxn - 10; ++i) fac[i] = fac[i - 1] * i % mod;
    inv[maxn - 10] = power_mod(fac[maxn - 10], mod - 2);
    for (int i = maxn - 11; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
}

ll C(int x, int y) {
    return fac[x] * inv[y] % mod * inv[x - y] % mod;
}

int n, a[2000007], b[2000007], dp[4007][4007];

int main() {
//    freopen("in.txt", "r", stdin);
    init();
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d%d", a + i, b + i);
        dp[2001 - a[i]][2001 - b[i]]++;
    }
    for (int i = 1; i <= 4001; i++)
        for (int j = 1; j <= 4001; j++) {
            dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
            dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
        }
    ll ans = 0;
    for (int i = 1; i <= n; i++) ans = (ans + dp[2001 + a[i]][2001 + b[i]]) % mod;
    for (int i = 1; i <= n; i++) ans = (ans - C(a[i] + a[i] + b[i] + b[i], a[i] + a[i]) + mod) % mod;
    printf("%lld\n", ans * power_mod(2, mod - 2) % mod);
    return 0;
}

Measured memory_bytes: 68480
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
typedef long long ll;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define forn(i,a,b) for(ll i=a;i<(ll)b;i++)
int main()
{
    ll h,n;
    cin>>h>>n;
    ll x,y;
    ll arr[n+1],brr[n+1];
    for(ll i=1;i<=n;i++)
    {
        cin>>arr[i]>>brr[i];
    }
    ll dp[h+1][n+1];
    ll mn[h+1];
    for(ll i=0;i<=h;i++)
    mn[i]=1000000000;
    mn[0]=0;
    for(ll i=0;i<=h;i++)
    {
        if(i>1)
        for(ll j=1;j<=n;j++)
        {
            if(dp[i-1][j]==-1)
            continue;
            mn[i-1]=min(mn[i-1],dp[i-1][j]);
        }
        for(ll j=0;j<=n;j++)
        {
            if(i==0 || j==0)
            {
                dp[i][j]=-1;
                continue;
            }
            if(i>=arr[j] && mn[i-arr[j]]==1000000000)
            {
                dp[i][j]=-1;
                continue;
            }
            /*if(i<arr[j])
            {
                dp[i][j]=-1;
                continue;
            }*/
            dp[i][j]=brr[j];
            if(i>=arr[j])
            dp[i][j]+=mn[i-arr[j]];
        }
    }
    //cout<<mn[h]<<"\n";
    for(ll i=1;i<=n;i++)
    {
        mn[h]=min(mn[h],dp[h][i]);
        //cout<<dp[h][i]<<" ";
    }
    cout<<mn[h];
    return 0;
}

Measured memory_bytes: 78592
#include <iostream>

using namespace std;

int main(){

	int a,b,c;
  	int count =0;
  	cin >> a;
  
  	count++;
  
  	cin >> b;
  
  	if(a!=b)count++;
  	
  	cin>>c;
  	
  	if(c != a && c != b) count++;
  
  	cout << count  << endl;
  
  	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define si(X) scanf("%d", &(X))
#define sll(X) scanf("%lld",&(X))
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int mod = 1e9+7;
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll expo(ll base,ll pow){ll ans = 1;
   while(pow!=0){if(pow&1==1){ans = ans*base;ans = ans%mod;}
   base *= base;base%=mod;pow/=2;}return ans;}
ll inv(ll x){return expo(x,mod-2);}
ull llrand() {ull r = 0;for(int i = 0; i < 5; ++i){r = (r << 15)|(rand() & 0x7FFF);}return r & 0xFFFFFFFFFFFFFFFFULL;}
int dx[8] = {1 , 0 , -1 , 0 , 1 , -1 , -1 , 1};    // last 4 diagonal
int dy[8] = {0 , 1 , 0 , -1 , 1 , 1 , -1 , -1};
/*---------------------------------------------------------------------------------------------------------------------*/

const int M = 200001;

int arr[M];

int main(){
    //freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);


    int n;
    si(n);

    for(int i = 1 ; i <= n ; i++){
        int le;
        si(le);
        arr[le]++;
    }

    int ans = 0;

    for(int i = 0 ; i < M ; i++){
        ans = max(ans , arr[i] + (i >= 0 ? arr[i - 1] : 0) + arr[i + 1]);
    }
    cout<<ans;














}














Measured memory_bytes: 640
#include <vector>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <algorithm>

const int INF = 1001001000;
const int MOD = (int)1e9 + 7;

using ll = long long;

using namespace std;

int main(){
  string s,t;
  vector<char> tmp;

  cin >> s >> t;

  for( int i = 0; i < s.size(); ++i){
    tmp.push_back(s[i]);
  }
  sort( tmp.begin(), tmp.end());
  for( int i = 0; i < s.size(); ++i){
    s[i] = tmp[i];
  }

  tmp.resize(0);
  for( int i = 0; i < t.size(); ++i){
    tmp.push_back(t[i]);
  }
  sort( tmp.begin(), tmp.end());
  reverse( tmp.begin(), tmp.end());
  for( int i = 0; i < t.size(); ++i){
    t[i] = tmp[i];
  }

  if( s < t){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

}


Measured memory_bytes: 256
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;


template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


void solve(std::vector<long long> a){
    cout << (accumulate(a.begin(), a.end(), 0) >= 22 ? "bust" : "win") << endl;
}


signed main(){
    std::vector<long long> A(3);
    for(int i = 0 ; i < 3 ; i++){
        scanf("%lld",&A[i]);
    }
    solve(std::move(A));
    return 0;
}


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

int main () {
  int A, B;
  string op;
  cin >> A >> op >> B;
  
  if (op == "+") {
    cout << A + B << endl;
  } 
  
  if (op == "-") {
    cout << A - B << endl;
  }
}

Measured memory_bytes: 256
a = [False for i in range(4)]
N = map(int, input().split())
for n in N:
    if n == 1:
        a[0] = True
    elif n == 9:
        a[1] = True
    elif n == 7:
        a[2] = True
    elif n == 4:
        a[3] = True

for i in range(4):
    if a[i] == False:
        print('NO')
        exit()
print('YES')
exit()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <string>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define f first
#define s second
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define eb emplace_back
#define in insert
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define FOR(i, n, x) for(int i = x; i < n; i++)
#define OUT(a, e) FOR(i, e, 0) cout << a[i] << ' '
#define OUTV(a) for(auto i : a) cout << i << ' ';
#define maxim(a, n, mx) FOR(i, n, x)mx = max(mx, a[i]);
using namespace std;
const int N = 1e5 + 5;
map<int, int> nm;

int main() {
    fast;
    int n; cin >> n;
    string s; cin >> s;
    if(n % 2)
    {
        cout << "No";
        return 0;
    }
    int up = n / 2, fl = 0;
    for(int i = 0; i < up; i++)
    {
        if(s[i] != s[i + up])fl = 1;
    }
    if(fl)cout << "No";
    else cout << "Yes";
    return 0;
}



Measured memory_bytes: 256