akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


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

    ll D;
    cin >> D;
    cout << "Christmas";
    D = 25 - D;

    rep(i, D){
        cout << " " << "Eve";
    }
    cout << endl;



    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
#define INF 0x3f3f3f3f
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)


int main()
{
    #ifdef __LOCAL__
        freopen("1.in","r",stdin);
        freopen("1.out","w",stdout);
    #endif
    char c;
    cin>>c;
    cout<<char(c+1)<<endl;    
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define FOR(i, j, limit) for(int i=j; i< limit; ++i)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ECHO(x) cout<<x<<endl;
#define MEMSET(a, n, x) REP(i, n) a[i]=x;
#define ARRIN(a, n) REP(i, n) cin>>a[i];
#define LL long long
int INF = 2147483647;
LL LINF = 9223372036854775807;
LL MOD = 1000000007;
typedef pair<int, int>P;
typedef pair<LL, LL>PL;
typedef vector<int> vi;
typedef vector<LL> vl;

class COMB{
private:
  LL n;
  vector<LL> fac;
  vector<LL> finv;
  vector<LL> inv;

public:
  COMB(LL N)
  : fac(vector<LL>(N+1, 1)), finv(vector<LL>(N+1, 1)),
    inv(vector<LL>(N+1, 1)), n(N)
  {
    COMB::init();
  }

  // テーブルを作る前処理
  void init() {
    for (int i = 2; i < n+1; i++){
        COMB::fac[i] = COMB::fac[i - 1] * i % MOD;
        COMB::inv[i] = MOD - COMB::inv[MOD%i] * (MOD / i) % MOD;
        COMB::finv[i] = COMB::finv[i - 1] * COMB::inv[i] % MOD;
    }
  }

  // 二項係数計算
  //1<= k <= n <=10^7くらいまで
  LL com(int n, int k){
      if (n < k) return 0;
      if (n < 0 || k < 0) return 0;
      return COMB::fac[n] * (COMB::finv[k] * COMB::finv[n - k] % MOD) % MOD;
  }
};

int main(){
  LL n, k, ans;
  cin>>n>>k;
  COMB c(n);


  for(int i=1; i<=k; ++i){

    if(n-k+1<i){
      cout<<0<<endl;
      continue;
    }
    ans=1;
    ans*=c.com(n-k+1, i);
    ans%=MOD;
    ans*=c.com(k-1, i-1);
    ans%=MOD;
    cout<<ans<<endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> pll;
const int INF=1e9;
const ll MOD=1e9+7;

ll gcd(ll x,ll y){
    if(y==0) return 0;
    return gcd(y,x%y);
}

int dis2(int x1,int y1,int x2,int y2){
    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
ll se=0;
ll sume(vector<int> a,int n){

}
int main(){
    int n,a,b;cin>>n>>a>>b;
    string s;cin>>s;
    int abr=0,all=0;
    for(int i=0;i<n;i++){
        if(s[i]=='a'&&all<a+b){
            cout<<"Yes"<<endl;
            all++;
        }else if(s[i]=='b'&&all<a+b&&abr<b){
            cout<<"Yes"<<endl;
            all++;abr++;
        }else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <stdio.h>
using namespace std;

int main(void)
{

	long a,b,ax,bx;

	while(scanf("%d %d", &a,&b) != EOF){

	if(a < b)
		swap(a,b);

	ax = a,bx = b;


	long c;
	while(ax % bx != 0){
		c = bx;
		bx = ax%bx;
		ax = c;
	}

	int ans;

	if(a % b == 0)
		ans = a;
	else
		ans = (a/bx)*(b/bx)*bx;

	cout << bx << ' ' << ans << endl;

	}

	return 0;
}

Measured memory_bytes: 1208
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()
   



Measured memory_bytes: 22168
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    s = input()
    t = input()
    l_s = list(s)
    l_t = list(t)
    str_key = {}
    str_key_t = {}
    for i,moji in enumerate(s):
        if not moji in str_key:
            str_key[moji] = t[i]
        l_s[i] = str_key[moji]
    for i,moji in enumerate(t):
        if not moji in str_key_t:
            str_key_t[moji] = s[i]
        l_t[i] = str_key_t[moji]
    if "".join(l_s) == t and "".join(l_t) == s:
        print('Yes')
    else:
        print('No')


Measured memory_bytes: 6948
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

int main() {
#ifdef DEBUG
//    freopen("input.txt", "r", stdin);
#else
    //    freopen("zalupa.in","r",stdin);
    //    freopen("zalupa.out","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(20);
    cout << fixed;
    int n;
    cin >> n;
    vector<int> ans(2 * n, 0);
    string prev_ans;
    random_device rd;
    vector<int> perm(2 * n);
    for (int i = 0; i < 2 * n; ++i) {
        perm[i] = i + 1;
    }
    mt19937 gen(228);
    shuffle(perm.begin(), perm.end(), gen);

    cout << "? ";
    vector<int> q(n);
    for (int j = 0; j < n; ++j) {
        cout << perm[j] << " ";
    }
    cout << endl;
    cin >> prev_ans;
    int prev_j;
    prev_j = 0;
    int mx = n;
    while (prev_j + 1 < mx) {
        int i = (prev_j + mx) / 2;
        cout << "? ";
        for (int j = i; j < i + n; ++j) {
            cout << perm[j] << " ";
        }
        cout << endl;
        string new_ans;
        cin >> new_ans;
        if (prev_ans != new_ans) {
            mx =i;
        }
        else {
            prev_j = i;
            prev_ans = new_ans;
        }
    }
    if (prev_ans == "Blue") {
        ans[prev_j] = -1;
        ans[prev_j + n] = 1;
    } else {
        ans[prev_j] = 1;
        ans[prev_j + n] = -1;
    }
    int x = 0;
    int y = 0;
    for (int i = 0; i < prev_j; ++i) {
        cout << "? " << perm[i] << " ";
        for (int j = prev_j + 1; j < prev_j + n; j++) {
            cout << perm[j] << " ";
        }
        cout << endl;
        string det;
        cin >> det;
        if (det == "Blue") {
            ans[i] = -1;
            x = i;
        } else {
            ans[i] = 1;
            y = i;
        }
    }

    for (int i = prev_j + n + 1; i < 2 * n; ++i) {
        cout << "? " << perm[i] << " ";
        for (int j = prev_j + 1; j < prev_j + n; j++) {
            cout << perm[j] << " ";
        }
        cout << endl;
        string det;
        cin >> det;
        if (det == "Blue") {
            ans[i] = -1;
            x = i;
        } else {
            ans[i] = 1;
            y = i;
        }
    }

    for (int i = prev_j + 1; i < prev_j + n; ++i) {
        cout << "? " << perm[i] << " ";
        for (int j = 0; j < prev_j; j++) {
            cout << perm[j] << " ";
        }
        for (int j = prev_j + n + 1; j < 2 * n; ++j) {
            cout << perm[j] << " ";
        }
        cout << endl;
        string det;
        cin >> det;
        if (det == "Blue") {
            ans[i] = -1;
            x = i;
        } else {
            ans[i] = 1;
            y = i;
        }
    }
    vector<int> res(2 * n);
    for (int i = 0; i < 2 * n; ++i) {
        res[perm[i] - 1] = ans[i];
    }
    cout << "! ";
    for (int cur : res) {
        if (cur == -1) {
            cout << "B";
        } else {
            cout << "R";
        }
    }
    return 0;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define log_2(a) (log((a)) / log(2))
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int N, A, B;
    cin >> N >> A >> B;
    cout << min(A, B) << " " << abs(min(N - A - B, 0)) << endl;
    return 0;
}



Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+10;
int n,m,p[N],pos[N],a[N];
struct segment_tree{
	int Min[N];
	#define lc x<<1
	#define rc x<<1|1
	void init(int x,int l,int r){
		if (l==r) return void(Min[x]=a[l]);
		int mid=(l+r)>>1;
		init(lc,l,mid);
		init(rc,mid+1,r);
		Min[x]=min(Min[lc],Min[rc]);
	}
	int query(int x,int l,int r,int L,int R){
		if (l>=L&&r<=R) return Min[x];
		int mid=(l+r)>>1,ans=1e9;
		if (L<=mid) ans=min(ans,query(lc,l,mid,L,R));
		if (R>mid) ans=min(ans,query(rc,mid+1,r,L,R));
		return ans;
	}
}T[2];
struct sit{
	int l,r,v;
	sit(int L,int R){l=L;r=R;v=T[l&1].query(1,1,m,(l+1)/2,(l+1)/2+(r-l)/2);}
};
struct cmp{bool operator () (sit x,sit y){return x.v>y.v;}};
priority_queue<sit,vector<sit>,cmp> Q;
int main()
{
	scanf("%d",&n);m=n>>1;
	for (int i=1;i<=n;i++) scanf("%d",&p[i]),pos[p[i]]=i;
	for (int i=1;i<=m;i++) a[i]=p[2*i-1];
	T[1].init(1,1,m);
	for (int i=1;i<=m;i++) a[i]=p[2*i];
	T[0].init(1,1,m);
	Q.push(sit(1,n));
	while (!Q.empty()){
		sit now=Q.top();Q.pop();
		int l=now.l,r=now.r,p1=now.v;
		int p2=T[r&1].query(1,1,m,(pos[p1]+2)>>1,(r+1)>>1);
		printf("%d %d ",p1,p2);
		p1=pos[p1];p2=pos[p2];
		if (l<p1) Q.push(sit(l,p1-1));
		if (p1+1<p2) Q.push(sit(p1+1,p2-1));
		if (p2<r) Q.push(sit(p2+1,r));
	}
	return 0;
}

Measured memory_bytes: 19576
import math

N = int(input())
A = list(map(int,input()))
B = []

for i in range(N):
  if N-1 == (i|N-1-i):
    B.append(1)
  else:
    B.append(0)
    
b = 0
for i in range(N):
  b += B[i]*A[i]
if b % 2 == 1:
  print(1)
else:
  for i in range(N):
    if A[i] == 2:
      print(0)
      break
  else:
    c = 0
    for i in range(N):
      A[i] = (A[i]-1)//2
      c += B[i]*A[i]
    if c % 2 == 1:
      print(2)
    else:
      print(0)

Measured memory_bytes: 20452
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int h=sc.nextInt();
  int w=sc.nextInt();
  String [][]po=new String[h+2][w+2]; 
  for(int i=0;i<w+2;i++){
  po[0][i]=".";
    po[h+1][i]=".";
  }
  for(int i=1;i<h+1;i++){
  	String s[]=sc.next().split("",0);
    for(int j=0;j<w+2;j++){
    	if(j==0||j==w+1){
          po[i][j]=".";
        }
      else{
      po[i][j]=s[j-1];
      }
    }
  }
  boolean b=true;
  for(int i=1;i<h+1;i++){
  for(int j=1;j<w+1;j++){
  	if(!b)break;
    if(po[i][j].equals("#")){
    	if(po[i-1][j].equals(".")&&po[i+1][j].equals(".")&&po[i][j+1].equals(".")&&po[i][j-1].equals("."))
          b=false;
    }
  }
  }
    System.out.println((b?"Yes":"No"));

}
}

Measured memory_bytes: 23636
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#define rip(i,n) for(int i=0;i<n;i++)
#define ll long long
#define lb long double
#define vec vector<int>
using namespace std;
int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if ((((((c - 1) / b) + 1) * 2) - 1) > (((a - 1) / d) + 1) * 2)cout << "No" << endl;
	else cout << "Yes" << endl;
}

Measured memory_bytes: 3636
#054_B
n,m=map(int,input().split())
a=[input() for _ in range(n)]
b=[input() for _ in range(m)]

flg=False
for i in range(n-m+1):
    for j in range(n-m+1):
        if all([b[l]==a[i+l][j:(j+m)] for l in range(m)]):
            flg=True
            break

print('Yes' if flg else 'No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;cin >>n;
  int a[n];
  bool color[8];
  for(int i = 0; 8 > i; i++) color[i] = false;
  for(int i = 0; n > i; i++){
    cin >> a[i];
    a[i] /= 400;
  }
  int nini = 0;
  for(int i = 0; n > i; i++){
    if(a[i] <= 7){
      color[a[i]] = true;
    } else nini++;
  }
  int kekka = 0;
  for(int i = 0; 8 > i; i++){
    if(color[i])kekka++;
  }
  cout << max(kekka,1) << " " << kekka+nini << endl;
}

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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	int N;
	cin >>N;
	int NN=N*100/108;
	while (NN*108/100<N)
		NN++;
	if (N==NN*108/100)
		cout <<NN <<endl;
	else
		cout <<":(" << endl;
	return 0;
}



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

int n,t;
inline int read(){
	int ret=0,pos=1;char c=getchar();
	while(!isdigit(c) && c!='-' ) c=getchar();
	if(c=='-')	pos=-1,c=getchar();
	while(isdigit(c))ret=(ret<<3)+(ret<<1)+(c&15),c=getchar();
	return pos*ret;
}
signed main(){
	n=read();
	while(n--){
		t=read();
		if(!(t&1)){
			if(t%3!=0 && t%5!=0){
				puts("DENIED");
				return 0;
			}
		}
	}
	puts("APPROVED");
}

Measured memory_bytes: 256
macro_rules! input {
    ($ttype:ty) => {
        {
            let mut input = String::new();
            let _= std::io::stdin().read_line(&mut input);
            input.trim().parse::<$ttype>().unwrap()
        }
    };

    ($($ttype:ty),*) => {
        {
            use std::io::BufRead;
            let mut input = String::new();
            let stdin = std::io::stdin();
            let _ = stdin.lock().read_line(&mut input);
            let mut iter = input.trim().split_whitespace();
            (
                $(iter.next().unwrap().parse::<$ttype>().unwrap(),)*
            )
        }
    };

    ($ttype:ty; $x:expr) => {
        {
            use std::io::BufRead;
            let mut input = String::new();
            let stdin = std::io::stdin();
            let _ = stdin.lock().read_line(&mut input);
            let v: Vec<$ttype> = input
                .trim()
                .split_whitespace()
                .map(|x| x.parse().unwrap())
                .collect();
            v
        }
    };

    ($ttype:ty; $x:expr; $y:expr) => {
        {
            use std::io::BufRead;
            let mut matrix = Vec::with_capacity($y);
            for _ in 0..$y {
                let mut input = String::new();
                let stdin = std::io::stdin();
                let _ = stdin.lock().read_line(&mut input);
                let v: Vec<$ttype> = input
                    .trim()
                    .split_whitespace()
                    .map(|x| x.parse().unwrap())
                    .collect();
                matrix.push(v);
            }
            matrix
        }
    };
}

fn main() {
    let n = input!(usize);
    let mut f: Vec<Vec<i64>> = Vec::with_capacity(n);
    let mut p: Vec<Vec<i64>> = Vec::with_capacity(n);

    for _ in 0..n {
        f.push(input!(i64; n));
    }
    for _ in 0..n {
        p.push(input!(i64; n));
    }

    let mut max_benefit: i64 = i64::min_value();
    for i in 1..2_i32.pow(10) {    // 少なくとも1つ出店しないするため1~
        let mut benefit: i64 = 0;
        let mut counter: Vec<i64> = vec![0; n];
        // println!("i = {}", i);
        for j in 0..10 {
            if i & (1 << j) > 0 {   // joisinoがjに出店しているとき
                for k in 0..n {
                    if f[k][j] == 1 {    // 店kがjにも出店していたら
                        counter[k] += 1;    // 店kとの重複出店舗数を+1
                    }
                }
            }
        }
        // println!("{:?}", counter);
        for (k, &cnt) in counter.iter().enumerate() {
            benefit += p[k][cnt as usize];    // 店kとcnt店舗重複しているときの利益
            // println!("benefit = {}", benefit);
        }
        if benefit > max_benefit {
            max_benefit = benefit;
        }
    }
    println!("{}", max_benefit);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define in(e,l) (std::find(l.begin(), l.end(), e) != l.end())
#define asort(l) (std::sort(l.begin(), l.end()))
#define dsort(l) (std::sort(l.rbegin(), l.rend()))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;

int main() {
  long long X;
  cin >> X;
  int year = 0;
  long long money = 100;
  while(money < X) {
    money = money * 1.01;
    ++year;
  }
  cout << year << endl;
  return 0;
}



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

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

int main(){
	int n;
	cin >> n;
	int cnt[10001] = {0};
	while(n--){
		int x;
		cin >> x;
		cnt[x]++;
	}
	bool first = true;
	rep(i,10001){
		rep(j,cnt[i]){
			if(first)	first = false;
			else		cout << " ";
			cout << i;
		}
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 1208
#include <stdio.h>

int main(void){
  char c[5][5] = {};
  int i, j, k;
  for(i = 0; i < 3; i++){
    scanf("%s", &c[i][0]);
  }
  printf("%c%c%c\n", c[0][0], c[1][1], c[2][2]);
  return 0;
}


Measured memory_bytes: 128
import sys
# input = sys.stdin.readline
N, K = map(int, input().split())
td = [list(map(int, input().split())) for _ in range(N)]

table = [[] for _ in range(N)]
for i, (ti, di) in enumerate(td):
    table[ti - 1].append((i, ti, di))

tops = []
others = []
for row in table:
    if len(row) > 0:
        for i, item in enumerate(sorted(row, key=lambda x: -x[2])):
            if i == 0: tops.append(item)
            else: others.append(item)

tops.sort(key=lambda x: -x[2])
others.sort(key=lambda x: -x[2])
x_max = len(tops)

tops_sumtab = [0]
tmp = 0
for i, ti, di in tops:
    tmp += di
    tops_sumtab.append(tmp)
    
others_sumtab = [0]
tmp = 0
for i, ti, di in others:
    tmp += di
    others_sumtab.append(tmp)

# print("#", tops)
# print("#", others)
ans = 0
for i in range(K + 1):
    if K - i > len(others): continue
    elif i > len(tops): break
    # print("##", tops_sumtab[i], others_sumtab[K - i], i ** 2)
    ans_tmp = tops_sumtab[i] + others_sumtab[K - i] + i ** 2
    if ans < ans_tmp: ans = ans_tmp

print(ans)

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

using namespace std;
using ll = long long;

const int mx = 2e5 + 9;

int a[mx];

int main() {
    int n; scanf("%d", &n);
    
    int s = 0;
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
        s ^= a[i];
    }

    for (int i = 0; i < n; i++) a[i] = s ^ a[i];
    for (int i = 0; i < n; i++) printf("%d ", a[i]);
    puts("");
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A+B > C+D) {
    cout << "Left" << endl;
  }
  else if (A+B == C+D) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        double t = sc.nextInt();
        double x = sc.nextInt();
        pw.println(t/x);
        pw.flush();
    }

    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
 
        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
 
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}


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

using namespace std;
#define ll long long 
#define lf long double
typedef vector <ll> vi;
int main() 
{
	ll n,k;
	cin>>n>>k;
	//cut<<fixed<<setprecision(7);
	ll ans;
	for(ll i=0;i<n;i++)
	{
		ll x;
		cin>>x;
		if(x>=k)
			ans++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
import fractions

def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)

A,B,C,D = map(int,input().split())

AtoB =  B - (A-1)

div_C = (B//C) - ((A-1)//C)
div_D = (B//D) - ((A-1)//D)
div_CD = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print(AtoB - div_C - div_D + div_CD)

Measured memory_bytes: 5048
n, a, b = map(int, input().split())
mod = 10**9+7
ans = pow(2, n, mod) - 1

up = 1
bo = 1
for i in range(b):
    up = up*(n-i)%mod
    bo = bo*(i+1)%mod
    if i == a-1:
        acombs = up*pow(bo, mod-2, mod)%mod

bcombs = up*pow(bo, mod-2, mod)%mod

print((ans - acombs - bcombs)%mod)


Measured memory_bytes: 9100
#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define dump(x) cout<<" "<<#x<<"="<<x
#define pdump(p) cout<<" "<<#p<<"=("<<p.fst<<","<<p.snd<<")"
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std; using lint = long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<lint, lint>;

// ユニオンファインドツリー
// find(i) = iの親, size(i) = iの属する集合の要素数
struct uf_tree {
    vector<int> parent;
    int internal_size;
    uf_tree(int size_) : parent(size_, -1), internal_size(size_) {}
    void unite(int x, int y) {
        if ((x = find(x)) != (y = find(y))) {
            if (parent[y] < parent[x]) swap(x, y);
            parent[x] += parent[y];
            parent[y] = x;
            internal_size--;
        }
    }
    bool is_same(int x, int y) { return find(x) == find(y); }
    int find(int x) { return parent[x] < 0 ? x : parent[x] = find(parent[x]); }
    int size(int x) { return -parent[find(x)]; }
    int size() { return internal_size; }
};

int main(void) {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> bs(m);
    repeat (i, m) {
        cin >> bs[i].fst >> bs[i].snd;
        --bs[i].fst;
        --bs[i].snd;
    }
    reverse(bs.begin(), bs.end());
    
    vector<int> v(n, 1);
    uf_tree uf(n);
    
    auto f = [](lint n) -> lint {return n * (n-1) / 2;};
    lint ans = f(n);
    vector<lint> show;
    show.push_back(ans);
    
    repeat (i, m) {
        int a, b;
        a = bs[i].fst;
        b = bs[i].snd;
        if (uf.is_same(a, b)) {
            show.push_back(ans);
            continue;
        }
        ans += f(uf.size(a));
        ans += f(uf.size(b));
        //dump(uf.size(a)); dump(uf.size(b)); dump(ans);
        uf.unite(a, b);
        ans -= f(uf.size(a));
        //dump(uf.size(a)); dump(ans); el;
        show.push_back(ans);
    }
    reverse(show.begin(), show.end());
    repeat_from (i, 1, show.size()) {
        cout << show[i] << endl;
    }
}

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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using namespace std;

using ll=long long;
using pii=pair<int, int>;
using vi=vector<int>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const int MOD=2019;

int N, D, A;
vector<ll> X, H;
vi ids;

int bin_search(int i){
    int left=i, right=N;
    while(right-left > 1){
        int mid=left+(right-left)/2;
        if(X[ids[mid]]-X[ids[i]] <= 2*D) left=mid;
        else right=mid;
    }
    return left;
}

int main(){
    cin >> N >> D >> A;
    X.resize(N), H.resize(N);
    for(int i=0; i<N; i++){
        cin >> X[i] >> H[i];
    }
    ids.resize(N);
    for(int i=0; i<N; i++) ids[i]=i;
    sort(all(ids), [&](int i, int j){return X[i]<X[j];});
    vector<ll> s(N+1, 0);
    ll ans=0;
    for(int i=0; i<N; i++){
        if(s[i] < H[ids[i]]){
            int dmg=(H[ids[i]]-s[i]+A-1)/A*A;
            int pos=bin_search(i);
            s[i]+=dmg;
            s[pos+1]-=dmg;
            ans+=dmg/A;
        }
        s[i+1]+=s[i];
    }
    cout << ans << endl;
    return 0;
}

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


long long N, L, a[100000];


int main(){
    cin >> N >> L;
    int center = -1;
    for(int i = 0; i < N; i++){
        cin >> a[i];
        if(i && a[i-1] + a[i] >= L){
            center = i;
        }
    }

    if(center == -1){
        cout << "Impossible" << endl;
        return 0;
    }

    cout << "Possible" << endl;
    for(int i = 1; i < center; i++){
        cout << i << endl;;
    }
    for(int i = N - 1; i > center; i--){
        cout << i << endl;;
    }
    cout << center << endl;
    
    
}

Measured memory_bytes: 1536
#include<bits/stdc++.h>
#define sqr(x) ((x)*(x))
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define vi vector<int>
#define HEAP(...) priority_queue<__VA_ARGS__ >
#define heap(...) priority_queue<__VA_ARGS__,vector<__VA_ARGS__ >,greater<__VA_ARGS__ > > 
#define pii pair<int,int> 
#define pb push_back
#define mp make_pair
#define debuge cerr<<"isok"<<endl
#define debug(x) cerr<<#x<<"="<<x<<endl
#define dprintf(...) fprintf(stderr,__VA_ARGS__)
#define SS second
#define FF first
#define ls (k<<1)
#define rs (k<<1|1)
#define clr(a,x) memset(a,x,sizeof(a))
#define cpy(a,x) memcpy(a,x,sizeof(a))
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
#define SZ(x) ((int)x.size())
using namespace std;
template<class T> inline void gmin(T &x,const T &y){if(x>y) x=y;}
template<class T> inline void gmax(T &x,const T &y){if(x<y) x=y;}
const int BufferSize=1<<16;
char buffer[BufferSize],*Bufferhead,*Buffertail;
bool Terminal;
inline char Getchar(){
	if(Bufferhead==Buffertail){
		int l=fread(buffer,1,BufferSize,stdin);
		if(!l){Terminal=1;return 0;}
		Buffertail=(Bufferhead=buffer)+l;
	}
	return *Bufferhead++;
}
template<class T>inline bool read(T &x){
	x=0;char c=Getchar(),rev=0;
	while(c<'0'||c>'9'){c=Getchar();rev|=c=='-';if(Terminal)return 0;}
	while(c>='0'&&c<='9') x=x*10+c-'0',c=Getchar();
	if(c=='.'){
		c=Getchar();double t=0.1;
		while(c>='0'&&c<='9') x=x+(c-'0')*t,c=Getchar(),t=t/10;
	}
	x=rev?-x:x;
	return 1;
}
template<class T1,class T2> inline bool read(T1 &x,T2 &y){return read(x)&read(y);}
template<class T1,class T2,class T3> inline bool read(T1 &x,T2 &y,T3 &z){return read(x)&read(y)&read(z);}
template<class T1,class T2,class T3,class T4> inline bool read(T1 &x,T2 &y,T3 &z,T4 &w){return read(x)&read(y)&read(z)&read(w);}
inline bool reads(char *x){
	char c=Getchar();
	while(c<33||c>126){c=Getchar();if(Terminal)return 0;}
	while(c>=33&&c<=126) (*x++)=c,c=Getchar();
	*x=0;return 1;
}
template<class T>inline void print(T x,const char c='\n'){
	if(!x){putchar('0');putchar(c);return;}
	if(x<0) putchar('-'),x=-x;
	int m=0,a[20];
	while(x) a[m++]=x%10,x/=10;
	while(m--) putchar(a[m]+'0');
	putchar(c);
}
//--------------------------------head---------------------------------------------

const int inf=0x3f3f3f3f;
const int N=105,M=100005,mod=1e9+7;
template<class T,class S> inline void ch(T &x,const S y){x=(x+y)%mod;}
inline int exp(int x,int y,const int mod=::mod){
	int ans=1;
	while(y){
		if(y&1) ans=(ll)ans*x%mod;
		x=(ll)x*x%mod;y>>=1;
	}return ans;
}

int n,d,a[N],cnt[N];

#define NO {puts("Impossible");return 0;}

int main(){
#ifdef rqgao2014
	freopen("input.txt","r",stdin);
#endif
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]),cnt[a[i]]++,gmax(d,a[i]);
	for(int i=1;i<(d+1)/2;i++)
		if(cnt[i]) NO;
	if(d%2==0&&cnt[d/2]!=1) NO;
	if(d%2==1&&cnt[d/2+1]!=2) NO;
	for(int i=d/2+1;i<=d;i++)
		if(cnt[i]<2) NO;
	puts("Possible");
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	a := scanInts(n + 1)

	memo := make([]int, n+1)
	t := 1
	for i := 0; i < n+1; i++ {
		t -= a[i]
		if t < 0 {
			fmt.Fprintln(wr, -1)
			return
		}
		memo[i] = a[i] + t
		t = min(t*2, 1e15)
	}

	ans := 0
	for i := n; i > 0; i-- {
		ans += a[i]
		if a[i-1]+(a[i]+1)/2 > memo[i-1] {
			fmt.Fprintln(wr, -1)
			return
		}
		a[i-1] = min(a[i-1]+a[i], memo[i-1])
	}

	if a[0] != 1 {
		fmt.Fprintln(wr, -1)
	} else {
		ans++
		fmt.Fprintln(wr, ans)
	}
}


Measured memory_bytes: 4220
import itertools


n, m = map(int, input().split())
ab = []
for _ in range(m):
    ab.append(list(map(int, input().split())))

ans = 0
for p in itertools.permutations(range(1, n + 1)):
    if p[0] != 1:
        break

    for i in range(n - 1):
        for ai, bi in ab:
            if (p[i] == ai and p[i + 1] == bi
                    or p[i] == bi and p[i + 1] == ai):
                break
        else:
            break
    else:
        ans += 1

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,k;
ll dp[55][55][2705];
int main(){
	cin >> n >> k;
	dp[0][0][0] = 1;
	for(int i=0;i<n;i++){
		for(int j=0;j<=n;j++){
			for(int k=0;k<2705;k++){
				if(dp[i][j][k] == 0) continue;
				//same
				dp[i+1][j][k+i+1] += dp[i][j][k];
				//down
				dp[i+1][j][k+i+1] += dp[i][j][k]*1LL*j%mod;
				//down & up
				if(j){
					dp[i+1][j-1][k+2*(i+1)] += dp[i][j][k]*1LL*j%mod*j%mod;
				}
				//up
				dp[i+1][j+1][k] += dp[i][j][k];
				//up & up
				dp[i+1][j][k+(i+1)] += dp[i][j][k]*1LL*j%mod;
			}
		}
		rep(k,55)rep(j,2705) dp[i+1][k][j]%=mod;
	}
	ll ans = 0;
	rep(j,2705){
		int x = 2*j-n*(n+1);
		if(x == k) ans += dp[n][0][j];
	}
	cout << (ans%mod+mod)%mod << endl;
}


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

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

using Graph = vector<vector<int>>;

int main() {
	int n, m; cin >> n >> m;
	Graph G(n);
	rep(i, m) {
		int a, b; cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	vector<int> dist(n, -1);
	queue<int> que;
	dist[0] = 0;
	que.push(0);
	while (!que.empty())
	{
		int v = que.front();
		que.pop();
		for(int nv : G[v]) {
			if(dist[nv] != -1) continue;
			dist[nv] = dist[v] + 1;
			que.push(nv);
		}
	}

	if(dist[n-1] == 2) cout << "POSSIBLE" << endl;
	else cout << "IMPOSSIBLE" << endl;
	return 0;
}


Measured memory_bytes: 15920
#include <stdio.h>
int main(void)
{
    char s[100001];
    char *p;
    scanf("%s", s);
    p = s;
    while (*p != 0) {
        if ((p - s) % 2 == 0) {
            printf("%c", *p);
        }
        p++;
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int dp(int sum);
int n;
int memo[100009];

int main(){
  memset(memo,-1,sizeof(memo));
  cin>>n;
  cout<<dp(0)<<endl;
  return(0);
}

int dp(int sum){
  int t;
  if(memo[sum]!=-1)return memo[sum];
  if(sum==n)return 0;
  int rec=dp(sum+1)+1;
  t=6;
  while(sum+t<=n){
    rec=min(rec,dp(sum+t)+1);
    t*=6;
  }
  t=9;
  while(sum+t<=n){
    rec=min(rec,dp(sum+t)+1);
    t*=9;
  }
  return memo[sum]=rec;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::unordered_set;
using std::map;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }


void solve(void)
{
  ui N{}; cin >> N;

  using MSet = std::multiset<ll>;
  MSet S{};
  for(ui tmp = 0; tmp < 1U << N; ++tmp)
  {
    ll s; cin >> s;
    S.emplace(s);
  }

  MSet tree{};
  auto last = S.end(); --last;

  tree.emplace(*last);
  S.erase(last);

  while(!S.empty())
  {
    MSet work{};
    for(auto itr = tree.rbegin(); itr != tree.rend(); ++itr)
    {
      auto it = S.lower_bound(*itr);
      if(it == S.begin())
      {
        cout << "No" << CRLF;
        return;
      }
      else
      {
        --it;
        work.emplace(*itr);
        work.emplace(*it);
        S.erase(it);
      }
    }

    tree = std::move(work);
  }
  cout << "Yes" << CRLF;

  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 18816
#include<bits/stdc++.h>
		using namespace std;
		#define sz(x) (int)(x).size()
		//#define int long long int
		#define loop(i,a,b) for(int i=a;i<b;i++)
		#define scan(arr,n) for (int i = 0; i < n; ++i) cin >> arr[i]
		#define vi vector<int>
		#define si set<int>
		#define pii pair <int, int>
		#define sii set<pii>
		#define vii vector<pii>
		#define mii map <int, int>
		#define pb push_back
		#define all(aa) aa.begin(), aa.end()
		#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
		//Constants
		const int mod = 1000000007; /* 1e9 + 7*/
		const int MAXN = 1000005; /*1e6 +5 */
		
		int spf[1000009]; // stores the smallest prime factor of a number
		const int siz=200001;
		vi adj[siz];
			
			int colr[siz];
		
		void print(vi v)
		{
			for(auto x:v)
			cout<<x+1<<" ";
			cout<<endl;
		}
		 const int maxx=2E5+1;
		

		  
		int findMaxGCD(int arr[], int n) 
		{ 
			// Calculating MAX in array 
			int high = 0; 
			for (int i = 0; i < n; i++) 
				high = max(high, arr[i]); 
		  
			// Maintaining count array 
			int count[high + 1] = {0}; 
			for (int i = 0; i < n; i++) 
				count[arr[i]]++; 
		  
			// Variable to store the 
			// multiples of a number 
			int counter = 0; 
		  
			// Iterating from MAX to 1 
			// GCD is always between 
			// MAX and 1. The first 
			// GCD found will be the 
			// highest as we are  
			// decrementing the potential 
			// GCD 
			for (int i = high; i >= 1; i--) 
			{ 
				int j = i; 
			   counter = 0; 
			
				// Iterating from current 
				// potential GCD 
				// till it is less than 
				// MAX 
				while (j <= high) 
				{ 
					// A multiple found 
		  
					if(count[j] >=2) 
					   return j; 
		  
				   else if (count[j] == 1)          
						counter++;          
		  
					// Incrementing potential 
					// GCD by itself 
					// To check i, 2i, 3i.... 
					j += i; 
		  
					// 2 multiples found, 
					// max GCD found 
					if (counter == 2)          
						return i; 
				} 
			} 
		} 
  
		
		 
		 
		 
		
		
		void solve()
		{
			int n;
			cin>>n;
			int arr[n];
			scan(arr,n);
			int gcdtotal=arr[0];
			loop(i,1,n)
			{
				gcdtotal=__gcd(gcdtotal,arr[i]);
			}
			int req=  findMaxGCD(arr, n); 
			if(req==1)
			cout<<"pairwise coprime";
			else if(req>1 && gcdtotal==1)
			cout <<"setwise coprime";
			else
			cout<<"not coprime";
			
		}

		 
		int32_t main()
		{
			faster;int t=1;//cin>>t;
			while(t--)
				solve();		 
			return 0;
		}


Measured memory_bytes: 16140
# include <iostream>


using namespace std;


int main() {
    long long h, w; cin >> h >> w;

    long long h1 = (h+1.0)/2;
    long long w1 = (w+1.0)/2;
    long long h2 = h/2;
    long long w2 = w/2;

    if (h == 1 or w == 1) cout << 1 << endl;
    else cout << h1*w1 + h2*w2 << 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++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;

int main(){
    ll n;
    cin >> n;
    cout << n*(n-1)/2 << endl;
    return 0;
}

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

using namespace std;

string s;
int cnt[30];

int main() {
  cin >> s;
  for (int i = 0; s[i]; ++i) {
    ++cnt[s[i] - 'a'];
  }
  int good = 1;
  for (int i = 0; i < 26; ++i) {
    if (cnt[i] & 1) {
      good = 0;
      break;
    }
  }
  puts(good ? "Yes" : "No");
  return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a < b) ? a : b
const int inf = 1000000000; // 10^9

int main(){
   int n;scanf("%d",&n);
   int t[100];for(int i = 0;i < n;i++)scanf("%d",&t[i]);
   int total=0;for(int i = 0;i < n;i++)total += t[i];
   //printf("total:%d\n",total);
   int m;scanf("%d",&m);
   int p[100],x[100];for(int i = 0;i < m;i++)scanf("%d %d",&p[i],&x[i]);
   
   for(int i = 0;i < m;i++){
      int _total = total;
      //printf("%d %d\n",t[p[i]-1],x[i]);
      _total -= t[p[i]-1];
      _total += x[i];
      printf("%d\n",_total);
   }
   return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::unordered_map;using std::unordered_set;using std::bitset;using std::pair;using std::set;using std::string;using std::vector;using std::sort;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _dbg(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _dbg(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_dbg(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define sz(a) ((int)a.size())
#define forn(i,n) for(int i=0;i<(n);++i)
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}

const int N=111;
vector<int> solve(vector<int> a){
    if(a.empty()){
        return {};
    }
    int mx=-1;
    for(int i=0;i<a.size();++i){
        if(a[i]==i+1)mx=i;
    }
    if(mx==-1){
        cout<<"-1\n";
        exit(0);
    }
    a.erase(a.begin()+mx);
    vector<int>res=solve(a);
    res.pb(mx+1);
    return res;
}

int32_t main() {

    int n;
    cin>>n;
    vector<int> a(n);
    for(int &i:a)cin>>i;
    vector<int> res=solve(a);
    for(int i:res)cout<<i<<'\n';


    return 0;
}


Measured memory_bytes: 256
import scala.io.StdIn
 
object Main {
  def main(args: Array[String]){
    val input = StdIn.readLine().split(" ").map(_.toInt)
    val x = input(0)
    val y = input(1)
    println(s"${x * y} ${2 * x + 2 * y}")
  }
}


Measured memory_bytes: 43632
#include<stdio.h>
int main()
{
	int k,ans;
	scanf("%d",&k);
	if(k>=2&&k<=200)
	{
		if(k%2==0)
			ans=(k/2)*(k/2);
		else
			ans=((k+1)/2)*((k-1)/2);
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>

struct Node{
  int key;
  struct Node *right;
  struct Node *left;
  struct Node *parent;
};
typedef struct Node * node;
#define NIL NULL

node root;

void insert(int k){
  node y = NIL;
  node x = root;
  node z;

  z = malloc(sizeof(struct Node));
  z->key=k;
  z->left=NIL;
  z->right=NIL;

  while(x!=NIL){
    y=x;
    if(z->key < x->key){
      x=x->left;
    }else {
      x = x->right;
    }
  }
  z->parent = y;
  if(y == NIL){
    root = z;
  }else if(z->key<y->key){
      y->left=z;
  }else(y->right = z);
}

void inorder(node u){
  if(u==NIL) return;
  
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(node u){
  if(u==NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}

int main(){
  int n,i,x;
  char com[30];

  scanf("%d", &n);

  for(i=0;i<n;i++){
    scanf("%s",com);
    
    if(com[0] == 'i'){
      scanf("%d",&x);
      insert(x);
    }
    else if(com[0] == 'p'){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}



Measured memory_bytes: 25144
#include<cstdio>
int n;
int main(){
	scanf("%d",&n);
	int mn=1919810,y=0;
	for(int i=1;i<=n;++i){
		int x;
		scanf("%d",&x);
		if(x<mn)++y,mn=x;
	}
	printf("%d",y);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define pb push_back
#define mp make_pair
#define ll long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define testcase ll T; cin >> T; for (ll tc = 1; tc <= T; tc++)
#define M 1000000007
#define MM 2000000000000000000
#define eps 1e-8
#define eq(x,y) (fabs((x)-(y)) < eps)
#define r2 1.41421356237
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

int main()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  //testcase {
  ll n;
  cin>>n;
  ll a=1,b=1,c=2;
  for(int i=0;i<n;i++) {
  	a=(a*10)%M;
  	b=(b*8)%M;
  	c=(c*9)%M;
  }
  ll ans=(a+b-c+M)%M;
  cout<<ans;
  //}
  return 0;
}

Measured memory_bytes: 3648
x=input()


for i in range(2**3):
    op=[]
    for j in range(3):
        if (i>>j)&1:
            op.append("+")
        else:
            op.append("-")

    formula=""
    for k in range(3):
        formula += x[k]+op[k]

    formula+=x[3]
    if eval(formula) == 7:
        print(formula+"=7")
        exit()


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

#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

#ifdef __WIN32
#define LLFORMAT "I64"
#define Rand() ((rand() << 15) + rand())
#else
#define LLFORMAT "ll"
#define Rand() (rand())
#endif

using namespace std;

const int maxn = 1e5 + 10, maxm = (1 << 16) | 10;

int n, ans;
int dp[maxm], cnt[20], a[maxn];

void upd(int &x, int y) {
	x = x < y ? x : y;
	return;
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i < n; ++i) {
		int u, v, w;
		scanf("%d%d%d", &u, &v, &w);
		++u;
		++v;
		a[u] ^= w;
		a[v] ^= w;
	}
	for (int i = 1; i <= n; ++i) {
		++cnt[a[i]];
	}
	memset(dp, 0x3f, sizeof dp);
	int s = 0;
	for (int x = 1; x < 16; ++x) {
		debug("cnt[%d] = %d\n", x, cnt[x]);
		ans += cnt[x] >> 1;
		s |= (cnt[x] & 1) << x;
	}
	dp[s] = ans;
	for (int t; s; --s) {
		if((t = dp[s]) <= n) {
			debug("dp[%d] = %d\n", s, t);
			for (int x = 1; x < 16; ++x) {
				if((s >> x) & 1) {
					for (int y = 1; y < x; ++y) {
						if((s >> y) & 1) {
							upd(dp[s ^ ((1 << x) | (1 << y) | (1 << (y ^ x)))], t + 1 + ((s >> (y ^ x)) & 1));
						}
					}
				}
			}
		}
	}
	printf("%d\n", dp[0]);
	return 0;
}



Measured memory_bytes: 1024