akhauriyash/Code-Regression huggingface dataset:
#include <iostream>//bit DP
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>PP;

ll P(ll x){
  ll n=x;
  x*=n;
  x*=n;
  x*=n;
  x*=n;
  return x;
}
int main(){
  ll n;cin>>n;
  
  for(int i=-200;i<=200;i++){
    for(int j=-200;j<=200;j++){
      if((P(i)-P(j))==n){
        cout<<i<<" "<<j<<endl;
        return 0;
      }
    }
  }

}


Measured memory_bytes: 3624
#pragma GCC optimize("O3") 
#include<bits/stdc++.h>
#define ll      				long long int
#define vi      				vector<int>
#define ii      				pair<int,int>
#define iii     				pair<ii,int>
#define iiii    				pair<ii,ii>
#define fi      				first
#define se      				second
#define unord_map				unordered_map
#define nxt_pmt					next_permutation
#define clr							clear
#define ALL(x) 					x.begin(),x.end()


#define pb      				push_back
#define pob     				pop_back

#define all(x)  				x.begin(), x.end()
#define len     				length()

#define db(x)					  cout << "!!!!!! " << #x << " => " << x << "\n"

#define fori(i, s, N)     for (int i = s; i <= N; i++)
#define ford(i, s, N)     for (int i = s; i >= N; i--)
using namespace std;

void init(int precision){
  	ios_base::sync_with_stdio(0);
  	cin.tie(0);
  	cout.tie(0);
  	cout.setf(ios::fixed);
  	cout.setf(ios::showpoint);
  	cout.precision(precision);
}

int t;
void cjam(int z){
	cout<<"Case #"<<z<<": ";
	
}
set<string> mm;
int n;string s;
int main(){
//	init(10);
	cin>>n;
	while(n--){
		cin>>s;
		mm.insert(s);
	}
	cout<<mm.size()<<"\n";
	return 0;
}

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

queue<int> q;
bool visited[2005];
int dist[2005];

vector<int> ans(10000,0);
vector<int> adj[10000];

void bfs(int x){
  visited[x] = true;
  dist[x]=0;
  q.push(x);
  while (!q.empty()) {
  int s = q.front(); q.pop();
  // process node s
  for (auto u : adj[s]) {
  if (visited[u]) continue;
  visited[u] = true;
  dist[u] = dist[s]+1;
  q.push(u);
  }
  }
}




void solve(){
  int main,x,y;

  cin>>main>>x>>y;

  for(int i=0;i<main-1;i++){
    adj[i].push_back(i+1);
    adj[i+1].push_back(i);
  }
  adj[x-1].push_back(y-1);
  adj[y-1].push_back(x-1);

  for(int i=0;i<main;i++){
    bfs(i);
    for(int j=i;j<main-1;j++){
    ans[dist[j+1]-1]++;
    //cout<<0<<' '<<dist[j+1]<<'\n';    
    }
    for(int ii=0;ii<2005;ii++){ visited[ii]=0,dist[ii]=0;}
  }
  for(int i=0;i<main-1;i++) cout<<ans[i]<<'\n';

}
  
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int t=1;
  //cin>>t;
  while(t--) solve();
}


Measured memory_bytes: 3944
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    string s;cin>>s;
    int res=0;
    if(s[0]=='R'||s[1]=='R'||s[2]=='R')res++;
    if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R'))res=2;
    if(s[0]==s[1]&&s[1]==s[2]&&s[0]=='R')res=3;
    cout<<res<<endl;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define INF 1e9
#define int long long
#define Rep(i, n, a) for (int i = a; i < n; i++)
#define Repr(i, n, a) for (int i = n; i >= a; i--)
#define rep(i, n) Rep(i, n, 0)
#define repr(i, n) Repr(i, n, 0)
#define all(a) a.begin(), a.end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

int n;
vector<PP> vp;

double func(double t)
{
    double res = INF;
    rep(i, n + 2)
    {
        double tmp;
        if (t < vp[i].second.first)
            tmp = vp[i].first + vp[i].second.first - t;
        else if (vp[i].second.second < t)
            tmp = vp[i].first + t - vp[i].second.second;
        else
            tmp = vp[i].first;
        res = min(res, tmp);
    }
    return res;
}

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

    cin >> n;
    vector<double> t(n), v(n);
    rep(i, n) cin >> t[i];
    rep(i, n) cin >> v[i];
    int T = 0;
    rep(i, n) T += t[i];
    vp.push_back(PP{0, P{0, 0}});
    vp.push_back(PP{0, P{T, T}});
    int sumt = 0;
    rep(i, n)
    {
        vp.push_back(PP{v[i], P{sumt, sumt + t[i]}});
        sumt += t[i];
    }
    double ans = 0;
    rep(i, 2 * T) ans += (func(i / 2.0) + func(i / 2.0 + 0.5)) * 0.25;
    printf("%10lf\n", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

int main() {
    
    ll n,a,b,c;
    cin >> n >> a >> b >> c;
    vector <ll> v;
    for (ll i=0;i<n;i++){
        ll p;
        cin >> p;
        v.push_back(p);
    }
    for (ll i=0;i<3;i++) {
        v.push_back(0);
    }
    sort(v.begin(), v.end());
    ll ans = mop;
    do{
        ll reg[4] = {};
        int flag = 0;
        ll itr_ans = 0;
        int flag_b = 0;
        for (ll i=0;i<n+3;i++){
            if(reg[flag] != 0 and flag != 3 and v[i] != 0){
                itr_ans += 10;
            }
            reg[flag] += v[i];
            if(v[i] == 0){
                if(reg[flag] == 0){
                    flag_b = 1;
                }
                flag++;
            }
        }
        if(flag_b){
            continue;
        }
        sort(reg, reg+3);
//        cout << reg[0] << endl;
        itr_ans += abs(reg[0] - c) + abs(reg[1] - b) + abs(reg[2] - a);
//        cout << abs(reg[0] - c) << " " << abs(reg[1] - b) << " " << abs(reg[2] - a) << " " << itr_ans << endl;
        if(ans > itr_ans){
            ans = itr_ans;
        }
//        cout << printf("%lld", ans) << endl;
    }while(next_permutation(v.begin(), v.end()));
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define debug(x) cerr << #x " = " << (x) << endl;
#define P(x) cerr << #x << endl;    
typedef long long ll;
//#define int long long
//#define int unsigned long long
const int mod = 1000000007;


int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; ++ i)
    {
        cin >> a[i];
    }
    
    cout << fixed << setprecision(9);
    double ans = 0;
    
    for(int i = 0; i < n; ++ i)
    {
        ans += (1.0 / a[i]);
    }
    
    ans = 1 / ans;
    
    cout << ans << endl;
    
    return 0;
}






Measured memory_bytes: 256
#include <stdio.h>
#include<iostream>
using namespace std;
int main()
{
    int a,b,c,d;
    while(cin>>a>>b>>c>>d)
        {
            int ans=0;
            for(int i=0; i<=100; i++)
                {
                    if((i>=a && i<=b)&&(i>=c&&i<=d))
                        ans++;
                }
            printf("%d\n",ans-1>=0?ans-1:0);
        }
    return 0;
}


Measured memory_bytes: 256
from bisect import bisect_left

N=int(input())
L=list(map(int,input().split()))
M=sorted(L)
#print(M)
ans=0
for i in range(N):
	for j in range(i+1,N):
		k=bisect_left(M,M[i]+M[j])
		#print(k,max(0,k-(j+1)))
		ans+=max(0,k-(j+1))
print(ans)

Measured memory_bytes: 3188
#![allow(non_snake_case, unused_imports)]

// Input
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)*} };}
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, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,HashMap,BTreeMap,VecDeque};

// Functions

// Main
fn main(){
    input!{
        N: usize,
        TXY: [(i64,i64,i64); N],
    }
    let mut ans = "Yes";
    let (mut x0, mut y0, mut t0) = (0,0,0);
    for i in 0..N{
        let (t,x,y) = TXY[i];
        let dx = (x-x0).abs();
        let dy = (y-y0).abs();
        let dt = t-t0;
        if dx+dy<=dt && (dx+dy-dt)%2==0{
            x0=x; y0=y; t0=t;
        }else {
            ans = "No";
            break;
        }
    }
    println!("{}", ans);
}

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

int main() {
    int n;
    cin >> n;
    int A[200005];
    int B[200005] = {};
    vector<int> V;

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

    for (int i = n; i >= 1; i--) {
        int cnt = 0;
        for (int j = i * 2; j <= n; j += i) {
            if (B[j] == 1) {
                cnt++;
            }
        }
        if (A[i] == 1 && (cnt % 2) == 0) {
            B[i] = 1;
            V.push_back(i);
        }
        else if (A[i] == 0 && (cnt % 2) == 1) {
            B[i] = 1;
            V.push_back(i);
        }
    }

    cout << V.size() << endl;
    if (V.size() != 0) {
        for (int i = 0; i < V.size(); i++) {
            if (i != 0) {
                cout << " ";
            }
            cout << V[i];
        }
        cout << endl;
    }


    return 0;
}


Measured memory_bytes: 3192
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,n;
  cin>>x>>n;
  unordered_map<int,int>m;
  for(int i=0;i<n;i++){
        int d;
        cin>>d;
        m[d]++;
  }
  if(m.count(x)==0){
    cout<<x<<endl;
    return 0;
  }
  int pos1=x-1,pos2=x+1;
  while(true){
    if(m.count(pos1)==0){
        cout<<pos1<<endl;
        return 0;
    }
    pos1--;
    if(m.count(pos2)==0){
        cout<<pos2<<endl;
        return 0;
    }
    pos2++;
  }
  return 0;
}


Measured memory_bytes: 3624
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
typedef long long ll;
const int N=105;const double Pi=acos(-1.0);
struct pt{
	int x,y;double ang;
	inline pt(){}
	inline pt(R int xx,R int yy):x(xx),y(yy){}
	inline pt operator -(const pt &b)const{return pt(x-b.x,y-b.y);}
	inline void calc(){ang=atan2(y,x);}
}p[N],st[N];
double ans[N],pw;int n;
void solve(R int id){
	R int top=0;
	fp(i,1,n)if(i!=id)st[++top]=p[i]-p[id],st[top].calc();
	sort(st+1,st+1+top,[](const pt &a,const pt &b){return a.ang<b.ang;});
	R double mx=0;
	st[top+1].ang=st[1].ang+2*Pi;
	fp(i,1,top)cmax(mx,st[i+1].ang-st[i].ang);
	if(mx<=Pi)return;
	ans[id]=mx-Pi;
}
int main(){
//	freopen("testdata.in","r",stdin);
	scanf("%d",&n);
	if(n==2)return printf("0.5\n0.5\n"),0;
	fp(i,1,n)scanf("%d%d",&p[i].x,&p[i].y);
	fp(i,1,n)solve(i);
	pw=1.0/(2*Pi);
	fp(i,1,n)printf("%.10lf\n",ans[i]*pw);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

typedef struct {
	int id;
	long double key;
} data;
 
typedef struct {
	data obj[1000001];
	int size;
} min_heap;
 
void push(data x, min_heap* h)
{
	int i = h->size;
	data tmp;
	h->obj[(h->size)++] = x;
	while (1) {
		if (i == 0) break;
		else if (h->obj[i].key < h->obj[(i-1)/2].key) {
			tmp = h->obj[(i-1)/2];
			h->obj[(i-1)/2] = h->obj[i];
			h->obj[i] = tmp;
			i = (i - 1) / 2;
		} else break;
	}
}
 
data pop(min_heap* h)
{
	int i = 0, j;
	data output = h->obj[0], tmp;
	h->obj[0] = h->obj[--(h->size)];
	while (1) {
		if (i * 2 + 1 >= h->size) break;
		else if (i * 2 + 2 >= h->size) j = i * 2 + 1;
		else if (h->obj[i*2+1].key < h->obj[i*2+2].key) j = i * 2 + 1;
		else j = i * 2 + 2;
		if (h->obj[j].key < h->obj[i].key) {
			tmp = h->obj[j];
			h->obj[j] = h->obj[i];
			h->obj[i] = tmp;
			i = j;
		} else break;
	}
	return output;
}

int main()
{
	int i, N, s[2], t[2], x[1001], y[1001], r[1002];
	scanf("%d %d %d %d", &(s[0]), &(s[1]), &(t[0]), &(t[1]));
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d %d %d", &(x[i]), &(y[i]), &(r[i]));
	
	int j;
	long double tmp, time[1002][1002] = {};
	for (i = 1; i < N; i++) {
		for (j = i + 1; j <= N; j++) {
			tmp = sqrt((long double)(x[i] - x[j]) * (x[i] - x[j]) + (long double)(y[i] - y[j]) * (y[i] - y[j]));
			if (tmp < (long double)(r[i] + r[j])) tmp = 0.0;
			else tmp -= (long double)(r[i] + r[j]);
			time[i][j] = tmp;
			time[j][i] = tmp;
		}
	}
	for (i = 1; i <= N; i++) {
		tmp = sqrt((long double)(x[i] - s[0]) * (x[i] - s[0]) + (long double)(y[i] - s[1]) * (y[i] - s[1]));
		if (tmp < (long double)r[i]) tmp = 0.0;
		else tmp -= (long double)r[i];
		time[i][0] = tmp;
		time[0][i] = tmp;
		tmp = sqrt((long double)(x[i] - t[0]) * (x[i] - t[0]) + (long double)(y[i] - t[1]) * (y[i] - t[1]));
		if (tmp < (long double)r[i]) tmp = 0.0;
		else tmp -= (long double)r[i];
		time[i][N+1] = tmp;
		time[N+1][i] = tmp;
	}
	time[0][N+1] = sqrt((long double)(s[0] - t[0]) * (s[0] - t[0]) + (long double)(s[1] - t[1]) * (s[1] - t[1]));
	time[N+1][0] = time[0][N+1];
	
	int u, w, flag[1002] = {};
	long double min[1002];
	for (i = 1; i <= N + 1; i++) min[i] = 1e+100;
	data d;
	min_heap h;
	h.size = 0;
	d.key = 0.0;
	d.id = 0;
	push(d, &h);
	while (h.size > 0) {
		u = pop(&h).id;
		if (flag[u] != 0) continue;
		else if (u == N + 1) break;
		flag[u] = 1;
		for (w = 1; w <= N + 1; w++) {
			if (min[u] + time[u][w] < min[w]) {
				min[w] = min[u] + time[u][w];
				d.key = min[w];
				d.id = w;
				push(d, &h);
			}
		}
	}
	
	printf("%.10Lf\n", min[N+1]);
	fflush(stdout);
	return 0;
}

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

typedef long long ll;
typedef unsigned int ui;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;

const int inf = 1e9;

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

    int n, k;
    cin >> n >> k;
    vi h(n), dp(n);
    for (int i = 0; i < n; ++i) {
        cin >> h[i];
    }
    for (int i = 1; i < n; ++i) {
        int mn = inf;
        for (int j = max(0, i - k); j < i; ++j) {
            mn = min(mn, dp[j] + abs(h[i] - h[j]));
        }
        dp[i] = mn;
    }
    cout << dp[n - 1] << '\n';

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, k, i;
  cin >> a >> b >> k;
  
  for(i=min(a,b); k>0; i--){
    if(a%i==0 && b%i==0) k--;
  }

  cout << i+1;
  return 0;
}

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

struct Card{
	char suit, value;
};
void bubbleSort(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		for (int j = N - 1; j > i; j--) {
			if (A[j-1].value > A[j].value) {
				swap(A[j - 1], A[j]);
			}
		}
	}
}
void selectSort(struct Card A[], int N) {
	int minj;
	for (int i = 0; i < N; i++) {
		minj = i;
		for (int j = i; j < N; j++) {
			if (A[j].value < A[minj].value) {
				minj = j;
			}
		}
		swap(A[minj], A[i]);
	}
}

void print(Card A[], int N) {
	for (int i = 0; i < N; i++) {
		if (i != 0) cout << " ";
		cout << A[i].suit << A[i].value ;
	}
	cout << endl;
}
int isstable(Card C1[], Card C2[], int N) {
	int tag = 1;
	for (int i = 0; i < N; i++) {
		if (C1[i].suit != C2[i].suit||C1[i].value!=C2[i].value) {
			tag = false;
		}
	}
	return tag;
}
int main() {
	Card C1[100],C2[100];
	int N;
	char ch;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> C1[i].suit >> C1[i].value;
	}
	for (int i = 0; i < N; i++) {
		C2[i] = C1[i];
	}
	bubbleSort(C1, N);
	selectSort(C2, N);

	print(C1, N);
	cout << "Stable" << endl;
	print(C2, N);
	if (isstable(C1,C2,N)){
		cout << "Stable" << endl;
	}
	else {
		cout << "Not stable" << endl;
	}
	
	return 0;
}


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

int INF = 100100101;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int t[n];
  rep(i,n) cin >> t[i];
  int m;
  cin>>m;
  int p[m],x[m];
  rep(i,m) {
    cin >> p[i] >> x[i];
  }
  int cpy[n];
  rep(i,m){ 
    rep(j,n){
      cpy[j] = t[j];
    }
    cpy[p[i]-1] = x[i];
    int ans = 0;
    rep(j,n){
      ans += cpy[j];
    }
    cout << ans << endl;    
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B;
  cin >> A >> B;
  int X = B / 4;
  int D = B % 2;
  int E = B / 2;
  if ( D == 1 ) {
    cout << "No" <<endl;
  }
  else if ( A > E ) {
    cout << "No" <<endl;
  }
  else if ( A * 4 >= B ) {
    cout << "Yes" <<endl;
  }
  
  else {
    cout << "No" <<endl;
  }
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main()
{
    map<int , int>cnt;
    int t;
    cin>>t;
    for (int i=1; i<=t; i++)
    {
        int a;
        cin>>a;
        cnt[a]++;
    }

   int ans=0;
   for(auto u:cnt)
   {
       if (u.first<=u.second)
       {
           ans+=(u.second-u.first);
       }
       else
       {
           ans+=u.second;
       }
   }
   cout<<ans<<endl;

}


Measured memory_bytes: 8004
#include <iostream>
#include <math.h>
#include <string>
using namespace std;

int main()
{
    string s ;
    cin >> s ;
    if (((s[0] != s[1]) & (s[0] != s[2]) & (s[0] != s[3])) || ((s[1] != s[0]) & (s[1] != s[2]) & (s[1] != s[3])) || ((s[2] != s[0]) & (s[2] != s[1]) & (s[2] != s[3])) || ((s[3] != s[0]) & (s[3] != s[1]) & (s[3] != s[2])) || ((s[1] == s[0]) & (s[1] == s[2]) & (s[1] == s[3]))) {
        cout << "No" ;
    }
    else {
        cout << "Yes" ;
    }
    return 0;
}


Measured memory_bytes: 3620
#include <iostream>

using namespace std;

int main(){
	while(1){
		int n,t,amt,max=0,min=500;
		cin >> n;
		if(n==0){break;}
		for(int i=0;i<n;i++){
			amt=0;
			for(int j=0;j<5;j++){
				cin >> t;
				amt+=t;
			}
			if(amt>max){max=amt;}
			if(amt<min){min=amt;}
		}
		cout << max << " " << min << endl;
	}
}

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

int main(void){
    char str[10];
    char *tok;
    int N, i;
    
    fgets(str, sizeof(str), stdin);
    tok = strtok(str, " ");
    N = atoi(tok);
    tok = strtok(NULL, " ");
    i = atoi(tok);

    printf("%d\n", (N+1-i));
    return 0;
    
}





Measured memory_bytes: 128
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define S second
#define F first
#define ll long long
#define ld long double

using namespace std;

const int N = 2e5 + 5, mod = 1e9 + 7;

pair<ll, ll> p[N];

int main()
{
    ll n, sum = 0;
    bool valid = 1;
    cin>>n;
    for(int i = 0 ; i < n ; i++) cin>>p[i].S>>p[i].F;
    sort(p, p+n);
    for(int i = 0 ; i < n ; i++)
    {
        sum += p[i].S;
        if(sum > p[i].F) valid = 0;
    }
    valid ? cout<<"Yes" : cout<<"No";
}


Measured memory_bytes: 3328
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

int main()
{
    int n;
    cin >> n;
    cout << (n * n * n) << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	
	int n,a[10000],i,max,min;
	long long sum=0;
	scanf("%d",&n);
		for(i = 0; i < n; i++){
		scanf("%d", &a[i]);
		sum += a[i];
	}
	max = min = a[0];
		for(i = 1; i < n; i++){
		if(a[i] > max)max = a[i];
			if(a[i] < min)min = a[i];
	}
		printf("%d %d %lld\n", min, max, sum);

	return 0;
}

Measured memory_bytes: 2760
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pint;

bool solve(const string S) {
  const	string K = "keyence";
  int Slen = S.length();
  int Klen = K.length();
  int d	= Slen - Klen;
  if(d < 0) return false;
  for(int i = 0; i <= S.length() - d; i++) {
    string S1 =	S.substr(0, i);
    string S2 =	S.substr(i+d);
    string s3 =	S1+S2;
    //    cout << i << " " << s3 << endl;                                              
    if(s3 == K) return true;
  }
  return false;
}

int main() {
  string  S; cin>>S;
  bool ans = solve(S);
  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}



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

vector<int> r[100001];
int ans[100001];

int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> h(n);
  rep(i, n) cin >> h[i];
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    r[a].push_back(b);
    r[b].push_back(a);
    ans[i] = -1;
  }

  rep(i, n) {
    ans[i] = 1;
    for (int next : r[i]) {
      if (h[i] <= h[next]) ans[i] = 0;
    }
    // if (ans[i] != -1) continue;
    // queue<int> q;
    // q.push(i);
    // // ans[0] = 0;
    // while (!q.empty()) {
    //   int now = q.front();
    //   q.pop();
    //   ans[now] = 1;
    //   for (int next : r[now]) {
    //     if (h[now] <= h[next]) ans[now] = 0;
    //     // ans[next] = ans[now] + 1;
    //     if (ans[next] == -1) q.push(next);
    //   }
    // }
  }

  int a = 0;
  rep(i, n) {
    // printf("%2d\n", ans[i]);
    if (ans[i] == 1) a++;
  }
  // cout << endl;
  cout << a << endl;
  return 0;
}

Measured memory_bytes: 9596
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>

using namespace std;

int main()
{
	int n, t, ans=0;
	long long int a[100000], amax[100000], max;
	scanf("%d %d", &n, &t);
	for(int i=0; i<n; i++){
		scanf("%lld\n", &a[i]);
	}
	for(int i=n-1; i>=0; i--){
		if(i==n-1){
			amax[n-1]=a[n-1];
		}else{
			if(amax[i+1]<a[i]){
				amax[i]=a[i];
			}else{
				amax[i]=amax[i+1];
			}
		}
	}
	for(int i=0; i<n-1; i++){
		if(i==0){
			max=amax[1]-a[0];
			ans=1;
		}else if(max<amax[i+1]-a[i]){
			max=amax[i+1]-a[i];
			ans=1;
		}else if(max==amax[i+1]-a[i]){
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;

int main() {
  ll n;
  cin >> n;
  if (n >= 30)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 3632
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>

using namespace std;

int main(){
    int N, R; 
    cin >> N >> R;
    if (N >= 10) {
        cout << R << endl;
        return 0;
    }
    cout << R + 100 * (10 - N) << endl;
    return 0;
}

Measured memory_bytes: 256
from collections import Counter

n = int(input())
A = list(map(int, input().split()))

maxA = max(A)
C = Counter(A)

D = {a: 0 for a in A}
for a in A:
  t = 2
  while a * t <= maxA:
      D[a * t] = 1
      t += 1

ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1

print(ans)

Measured memory_bytes: 105064
#include<iostream>
using namespace std;
int main(){
	int a,b,c;
	int i,j,k;
	int n,s;
	cin>>n>>a>>b;
	s=n;
	for(i=0;i<n;i++){
		cin>>c;
		if(a<=c && c<b)s--;
	}
	cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <stdlib.h>
#include <stack>
#include <queue>
using namespace std;
char A[810][810] = {}; 
int D[810][810] = {}; 
int INF = 1145141919; 
int H, W, K; 
int Sx, Sy; 
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; 
void bfs(){
	queue<pair<int, int>> que;
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			D[i][j] = INF;
		}
	}
	que.push(pair<int, int>(Sx, Sy)); 
	D[Sx][Sy] = 0; 
	while(que.size()){
		pair<int, int> p = que.front(); que.pop(); 
		for(int i = 0; i < 4; i++){
			int nx = p.first + dx[i], ny = p.second + dy[i]; 
			if(nx >= 0 && nx < H && ny >= 0 && ny < W && 
				A[nx][ny] != '#' && D[nx][ny] == INF){
				que.push(pair<int, int>(nx, ny)); 
				D[nx][ny] = D[p.first][p.second] + 1; 
			}
		}
	}
}
int main(){
	cin >> H >> W >> K; 
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			cin >> A[i][j]; 
			if(A[i][j] == 'S'){
				Sx = i, Sy = j; 
			}
		}
	}
  	bfs(); 
	int ans = 700000; 
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			if(D[i][j] == INF) continue; 
			int a = max((D[i][j] + K - 1) / K, 1); 
			int b = min({i, H - 1 - i, j, W - 1 - j}); 
			int c = a + (b + K - 1) / K; 
			ans = min(ans, c);
		}
	}
	cout << ans << endl; 
}

Measured memory_bytes: 3584
#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;
const int INF = 1e9;
const int MOD = 1000000007;

int main(){
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int s = 0;
    rep(i,n)  s += a[i];
    sort(a.begin(),a.end(),greater<int>());
    bool ok = true;
    rep(i,m){
        if(a[i]*4*m < s) ok = false;
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
     int a,b;

     cin >> a >> b;
     cout << a/b << " ";
     cout << a%b << " ";

     double a1,b1;
     a1 = static_cast<double>(a);
     b1 = static_cast<double>(b);
     cout << fixed << a1/b1 << endl;

     return 0;
}

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

int cost[100][100];
int main() {
	int n; scanf("%d", &n);
	memset(cost, 0x3f, sizeof(cost));
	rep(i, n) {
		int r, k; scanf("%d%d", &r, &k);
		r--;
		rep(j, k) {
			int t; scanf("%d", &t);
			cost[r][--t] = 1;
		}
	}
	for (int k = 0; k < n; k++)
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
	int p; scanf("%d", &p);
	rep(i, p) {
		int s, d, v; scanf("%d%d%d", &s, &d, &v);
		s--; d--;
		if (cost[s][d] >= v)puts("NA");
		else printf("%d\n", cost[s][d] + 1);
	}
}

Measured memory_bytes: 3216
#include<stdio.h>

int main()
{
    char s[101],t[101],std[202];int n,i,j;

    scanf("%d",&n);

    getchar();
    scanf("%s",s);
    scanf("%s",t);

    for(i=0,j=0;i<n;i++){
        std[j++]=s[i];
        std[j++]=t[i];
    }
    std[j]='\0';
    printf("%s",std);
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    int[] a = new int[n];
    int[] a_sort = new int[n];
    for(int i=0; i<n; i++) {
      a[i] = Integer.parseInt(in.readLine());
      a_sort[i] = a[i];
    }
    
    Arrays.sort(a_sort);
    
    if(n==1) {
      System.out.println(a_sort[0]);
      return;
    }
    
    for(int i=0; i<n; i++) {
      System.out.println(a_sort[n-1]!=a[i]?a_sort[n-1]:a_sort[n-2]);
    }
  }
}

Measured memory_bytes: 59344
#include <iostream>
#include <string>
#include <algorithm>

inline int32_t count_flip(std::string& S){
    int32_t cnt = 0;
    int32_t idx;
    char prev = S[0];
    for(idx = 0; idx < int32_t(S.size()); idx++){
        if(prev != S[idx]){
            cnt++;
            prev = S[idx];
        }
    }
    return cnt;
}

int32_t main(){
    int32_t N, K;
    std::cin >> N >> K;
    std::string S;
    std::cin >> S;

    // score(len, num_flip) = max(len-1-num_flip, 0)
    // 1 change -> -2 flip
    int32_t flip,score;
    flip = count_flip(S);
    flip = std::max(flip - 2 * K, 0);
    score = std::max(N - 1 - flip, 0);
    std::cout << score;

}



Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		//??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		//??????????????????????????±???StringBuilder?????????????????????
		StringBuilder sb = new StringBuilder();
		
		sb.append(line);
		line = br.readLine();
		int meireiSousu = Integer.parseInt(line);
		String nukitoriStr = "";	//
		
		for (int i = 0; i < meireiSousu; i++) {
			String line2 = br.readLine();
			String[] meirei = line2.split("[\\s]+");
			String meireiStr = meirei[0];
			int meirei_kazu1 = Integer.parseInt(meirei[1]);
			int meirei_kazu2 = Integer.parseInt(meirei[2]) + 1;

			if (meireiStr.equals("replace")) {
				sb.replace(meirei_kazu1, meirei_kazu2, meirei[3]);
			} else if (meireiStr.equals("reverse")) {
				nukitoriStr = sb.substring(meirei_kazu1, meirei_kazu2);
				StringBuilder sb1 = new StringBuilder(nukitoriStr);
				sb1.reverse();
				nukitoriStr = sb1.toString();
				sb.replace(meirei_kazu1, meirei_kazu2, nukitoriStr);
			} else {
				String hyoujiStr = sb.substring(meirei_kazu1, meirei_kazu2);
				System.out.println(hyoujiStr);
			}
		}
	}
}

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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

struct RLE{
  char c;
  LL n;
  RLE(char c_,LL n_):c(c_),n(n_){}
  RLE(){}
};

vector<RLE> normal(const vector<RLE>& xs){
  vector<RLE> res;
  for(auto& x: xs){
	if(x.n <= 0) continue;
	if(!res.empty() && res.back().c == x.c)
	  res.back().n += x.n;
	else
	  res.EB(x);
  }
  return res;
}

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

  vector<vector<RLE>> S(3);
  REP(i,3){
	while(true){
	  char c; cin >> c;
	  if(c == '$') break;
	  LL n; cin >> n;
	  S[i].EB(c,n);
	}
  }

  vector<RLE> ans;
  if(SZ(S[1]) == 1){
	bool done = false;
	for(auto& x: S[0]){
	  if(!done && x.c == S[1][0].c && x.n >= S[1][0].n){
		ans.insert(end(ans), ALL(S[2]));
		ans.EB(x.c, x.n - S[1][0].n);
		done = true;
	  }
	  else
		ans.EB(x);
	}
  }
  else{
	bool done = false;
	for(int i=0;i<SZ(S[0]);++i){
	  bool ok = (i+SZ(S[1]) <= SZ(S[0])) && !done;
	  for(int j=0;ok&&j<SZ(S[1]);++j){
		if(j==0 || j+1 == SZ(S[1])){
		  if(S[0][i+j].c != S[1][j].c || S[0][i+j].n < S[1][j].n)
			ok = false;
		}
		else if(S[0][i+j].c != S[1][j].c || S[0][i+j].n != S[1][j].n)
		  ok = false;
	  }
	  if(ok){
		done = true;
		ans.EB(S[0][i].c, S[0][i].n - S[1][0].n);
		ans.insert(end(ans), ALL(S[2]));
		ans.EB(S[0][i+SZ(S[1])-1].c, S[0][i+SZ(S[1])-1].n - S[1].back().n);
		i += SZ(S[1]) - 1;
	  }
	  else{
		ans.EB(S[0][i]);
	  }
	}
  }

  ans = normal(ans);
  REP(i,SZ(ans)) cout << ans[i].c << " " << ans[i].n << " ";
  cout << "$" << endl;
  
  return 0;
}

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


int main() {
  double d, t, s;
  cin >> d >> t >> s;
  double tm = d / s;
  //cout << tm << endl;
  
  if (tm > t) cout << "No" << endl;
  else cout << "Yes" << endl;
  
  return 0;
}

Measured memory_bytes: 3716
h,w = map(int,input().split())
A = [input() for _ in range(h)]
D  = ((0,1), (1,0))

from collections import deque
queue = deque([((0,0), [])])

cand = []
while queue:
  p, path = queue.popleft()
  x, y = p
  path = path + [p]
  for dx,dy in D:
    nx,ny = x+dx, y+dy
    if not (0<=nx < h and 0<= ny < w):
      continue
    if A[nx][ny] != '#':
      continue
    if nx == h-1 and ny == w-1:
      cand.append(path+[(nx,ny)])
      continue
    queue.append(((nx,ny),path))

for c in cand:
  for i in range(h):
    for j in range(w):
      if A[i][j] == '.':
        continue
      elif (i,j) not in c:
        break
    else:
      continue
    break
  else:
    print('Possible')
    break
else:
  print('Impossible')
    

Measured memory_bytes: 4980
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<stdio.h>
using namespace std;
int main() {
	int a, b;
	cin >> a >> b;
	cout << a / b << " " << a % b << " ";// << setprecision(20) << a / 1.0 / b << endl;
	printf("%.10f", a/1.0 /b);
	//cin >> a;
	return 0;
}


Measured memory_bytes: 3228
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}

int main(){
    int N;
    cin >> N;
    int s[N];
    REP(i,N) cin >> s[i];
    sort(s,s+N);
    int t[N]={0};
    int tmp=0;
    int sum=0;
    for(int i=0;i<N;++i){
       sum+=s[i];
    }
    if(sum%10==0){
    for(int i=0;i<N;++i){
        if(s[i]%10!=0){
            sum-=s[i];
            break;
        }
    }   
    }
    if(sum%10==0){
        sum=0;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
	int a, b;
	char op;
	while(1){
		int c;
		scanf("%d %c %d", &a, &op, &b);
		if(op == '?'){
			break;
		} else if(op == '+'){
			c = a + b;
		} else if(op == '-'){
			c = a - b;
		} else if(op == '*'){
			c = a * b;
		} else {
			c = a / b;
		}
		printf("%d\n", c);
	}
	return 0;
}

Measured memory_bytes: 600
#![allow(unused_imports)]
#![allow(unused_macros)]
use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, Read};

#[allow(unused_macros)]
macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, $var:ident $($r:tt)*) => {
        let $var = parse_val!($it, usize);
        parse!($it $($r)*);
    };
}

#[allow(unused_macros)]
macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: tt),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, u1) => {
        $it.next().unwrap().parse::<usize>().unwrap() -1
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

#[cfg(debug_assertions)]
macro_rules! debug {
    ($( $args:expr ),*) => { eprintln!( $( $args ),* ); }
}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($( $args:expr ),*) => {
        ()
    };
}

fn abs(a: i64) -> i64 {
    if a < 0 {
        -a
    } else {
        a
    }
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, mut x: i64, mut k: i64, d: i64);
    if x >= 0 {
        let s = x / d;
        if s > k {
            println!("{}", x - d * k);
            return;
        }
        let a = x - s * d;
        let b = a - d;
        if (k - s) % 2 == 1 {
            println!("{}", abs(b));
        } else {
            println!("{}", abs(a));
        }
    } else {
        let s = -x / d;
        if s >= k {
            println!("{}", abs(x + d * k));
            return;
        }
        let a = x + s * d;
        let b = a + d;
        if (k - s) % 2 == 1 {
            println!("{}", abs(b));
        } else {
            println!("{}", abs(a));
        }
    }
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 2164
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <set>
#include <cmath>

// x^2+y^2+ax+by+c=0

int main(int,char**){
	std::cout<< std::setprecision(3) << std::setiosflags(std::ios::fixed);
	int n;
	std::cin >> n;
	while(n--){
		double x1,y1,x2,y2,x3,y3,a,b,c;
		std::cin >>  x1 >> y1 >> x2 >> y2 >> x3 >>y3;
		double vec[]={ -x1*x1-y1*y1, -x2*x2-y2*y2, -x3*x3-y3*y3};
		double det(x1*y1+x2*y3+x3*y1-x1*y3-x2*y1-x3*y2);
		double inv[3][3] = { 
			{ y2-y3, -(y1-y3), y1-y2 },
			{ -(x2-x3), x1-x3, -(x1-x2) },
			{ x2*y3-x3*y2, -(x1*y3-x3*y1), x1*y2-x2*y1}
		};
		a= (inv[0][0]*vec[0] +inv[0][1]*vec[1] +inv[0][2]*vec[2])/det;
		b= (inv[1][0]*vec[0] +inv[1][1]*vec[1] +inv[1][2]*vec[2])/det;
		c= (inv[2][0]*vec[0] +inv[2][1]*vec[1] +inv[2][2]*vec[2])/det;
		std::cout<< 0-a/2 << ' ' << 0-b/2<<' ' << std::sqrt((a*a+b*b)/4-c)<<std::endl;
	}
	return 0;
}

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

int main(){
  int n;
  int a[31]={1,1,2};
  for(int i=3;i<=30;i++ ){
    a[i]=a[i-1]+a[i-2]+a[i-3];
  }

  while(cin>>n,n){
    cout << (a[n]/10/365 + 1) << endl;
  }
}

Measured memory_bytes: 1160
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#define fileoutput ofstream f;f.open("output.txt");if(!f.is_open()){cout<<"faild";return 0;}cout.rdbuf(f.rdbuf());
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ld long double
#define mod 1000000007
#define inf 2e9
#define sz 1005
using namespace std;

int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0)cout << n / 2;
	else cout << (n / 2) + 1;
	return 0;
}

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

#define mod 1000000007

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n; cin>>n;
	vector<ll> vec(n);
	for(int i = 0; i < n; i++){
		cin>>vec[i];
	}
	sort(vec.rbegin(), vec.rend());
	ll res = 0, h = 0;
	while(vec[0] > 0){
		ll sifir = 0, bir = 0;
		for(int i = 0; i < n; i++){
			if(vec[i]%2) bir++;
			else sifir++;
			vec[i] /= 2;
		}
		ll v = 1;
		for(int u = 0; u < h; u++){
			v = (v*2)%mod;
		}
		res = (res + ((bir%mod * sifir%mod) % mod)*v%mod)%mod;
		h++;
	}
	cout<<res;
	return 0; 
}


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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(x) x.begin(), x.end()

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}

void read() {
	string s;
	cin >> s;
	cout << s[0] << s[1] << s[2];
}

void run() {

}

void write() {

}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	read();
	run();
	write();
	return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> p2;
#define sz(a) ll(a.size())
void solve(){
	ll x;
	cin>>x;
	if(x>=30)
		cout<<"Yes";
	else
		cout<<"No";
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output.txt", "w", stdout);
    #endif
    clock_t z=clock();
    ll qc=1;
    //cin>>qc;
    for(ll i=1;i<=qc;i++){
        solve();
    }
    debug("Total Time:%.4Lf\n",(ld)(clock()-z)/CLOCKS_PER_SEC);
}

Measured memory_bytes: 3780
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

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

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

//container util

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

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;



int GCD(int a, int b){
    if(a < b) swap(a, b);
    if(b == 0) return a;
    return GCD(b, a%b);
}

ll a[100010];
int main() {
    //cout << fixed << setprecision(15);

    int N; cin >> N;
    int cnt=0;

    ll minV =1e9;
    for(int i=0; i<N; ++i){
        ll v; cin >> v;
        if(v<0){
            cnt++;
        }
        a[i] = v;
        minV = min(minV, abs(v));
    }
    ll ans=0;
    for(int i=0; i<N; ++i){
        ans += abs(a[i]);
    }

    if(cnt%2==0){
        cout << ans << endl;
    }else{
        cout << ans-2*minV << endl;
    }




    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define ll long long
//#define int ll
#define INF INT_MAX/10

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[100100];
int R[100100];

int main() {
  int N; cin >> N;
  int sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> Input[i];
    sum += Input[i];
    R[i] = sum;
  }
  int ans = INF;
  for (int i = 0; i < N; i++) {
    ans = min(ans, abs(R[N-1] - R[i] - R[i]));
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<stack>
#include<map>
#include<set>
#include<string>
#include <sstream>
#include<bitset>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int gcd(int x,int y){
  int mi,ma;
  ma = max(x,y);
  mi = min(x,y);
  //cout << "ma" << ma << "mi" << mi << endl;
  if(ma % mi == 0){
    return mi;
  }
  else{
    return gcd(mi,ma % mi);
  }

}

int main(){
  long ii,jj,kk;
  vector<int> a;
  int x,y;

  cin >> x >> y;

  cout << gcd(x,y) << endl;
  
  return 0;
}



Measured memory_bytes: 3088