akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<vector<int>> bingo(3, vector<int>(3));
    vector<int> cntRow(3);
    vector<int> cntCol(3);
    vector<int> cntCros(2);
    for(int i = 0; i < 3; ++i)
    {
        int a1,a2,a3;
        cin >> a1 >> a2 >> a3;
        bingo[i][0] = a1;
        bingo[i][1] = a2;
        bingo[i][2] = a3;
    }
    int n;
    cin >> n;
    for(int i = 0; i < n; ++i)
    {
        int t;
        cin >> t;
        for(int j = 0; j < 3; ++j)
        {
            for(int k = 0; k < 3; ++k)
            {
                if(bingo[j][k] == t)
                {
                    cntRow[k] += 1;
                    cntCol[j] += 1;
                    if((k==0 && j==0)
                    || (k==2 && j==2))
                    {
                        cntCros[0]+=1;
                    }
                    if((k==0 && j==2)
                    || (k==2 && j==0))
                    {
                        cntCros[1]+=1;
                    }
                    if((k==1 && j==1))
                    {
                        cntCros[0] +=1;
                        cntCros[1] +=1;
                    }
                }
            }
        }
    }
    bool result = false;
    for(int t : cntCol)
    {
        if(t >= 3) result |= true;
    }
    for(int t : cntRow)
    {
        if(t >= 3) result |= true;
    }
    for(int t : cntCros)
    {
        if(t >= 3) result |= true;
    }
    if(result)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, L;
    cin >> N >> L;
    int aji = 0;
    int sum = 0;
    int min = 500;
    int min_aji = 0;
    for (int i = 1; i <= N; i++)
    {
        aji = L + i - 1;
        sum += aji;
        if(min>=abs(aji))
        {
            min = abs(aji);
            min_aji = aji;
        }
    }

    cout << sum - min_aji << endl;
}


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

using namespace std;

using ll = long long;
using ld = long double;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

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

	int a, b;
	cin >> a >> b;

	int ans = a + b, ans2 = a - b, ans3 = a * b;
	cout << (max(max(ans, ans2), ans3)) << endl;
	return 0;
}


Measured memory_bytes: 256
//#include "pch.h"
//#include "stdafx.h"
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>

using namespace std;

/*-----------------------------------------------------------------------------
　ライブラリ
 -------------------------------------------------------------------------------*/
#if 0
 // 3次元
vector<vector<vector<SDWORD>>> XXX(AAA, vector<vector<SDWORD>>(BBBB, vector<SDWORD>(CCC, -1)));
#endif

#if 0
// 2分探索
auto position = lower_bound(getValue.begin(), getValue.end(), 0);	// 0以上の要素位置を探す
int idx_lower = distance(getValue.begin(), position);				// 0以上の要素インデックス
int eraseNum = MIN(idx_lower, delCnt);								// 要素位置が個数になる
#endif

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))

#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define MIN(a, b)				((a) < (b) ? a : b)
#define MAX(a, b)				((a) > (b) ? a : b)
#define CeilN(x, n)				(((((DWORD)(x))+((n)-1))/n)*n)	/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))					/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						

#define ArrayLength(x)			( sizeof( x ) / sizeof( x[ 0 ] ) )
#define	ArrayEnd(a)				(&(a)[ArrayLength(a)])			
#define	ArrayLast(a)			(&(a)[ArrayLength(a) - 1])		
#define MAX_DWORD				(0xFFFFFFFF)
#define	MAX_SDWORD				((SDWORD)0x7FFFFFFF)
#define	MIN_SDWORD				((SDWORD)0x80000000)
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define	MIN_QWORD				((QWORD)0x0000000000000000)
#define	MAX_SQWORD				((SQWORD)0x7FFFFFFFFFFFFFFF)
#define	MIN_SQWORD				((SQWORD)0x8000000000000000)
#define M_PI					3.14159265358979
#define deg_to_rad(deg)			(((deg)/360)*2*M_PI)
#define rad_to_deg(rad)			(((rad)/2/M_PI)*360)

#define	BitSetV(Val,Bit)		((Val) |= (Bit))			
#define	BitTstV(Val,Bit)		((Val) & (Bit))				
typedef short					SWORD;
typedef long					SDWORD;
typedef long long				SQWORD;
typedef unsigned short			WORD;
typedef unsigned long			DWORD;
typedef unsigned long long int	QWORD;
typedef pair<int, int> P;

/*-----------------------------------------------------------------------------
　パラメータ定義
 -------------------------------------------------------------------------------*/
#define N_MAX	(100000)
#define K_MAX	(10)
#define M_MAX	(1000)
#define H_MAX	(1000)
#define W_MAX	(1000)
 /*-----------------------------------------------------------------------------
 　処理
  -------------------------------------------------------------------------------*/
  // メイン
int main()
{
	string a;
	cin >> a;
	if (a[0] == a[1] || a[1] == a[2] || a[2] == a[3]) {
		cout << "Bad";
	} else {
		cout << "Good";
	}

	cout << endl;
	return 0;
}


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

int main()
{
    string s;
    cin >> s;
    if (s.at(s.size() - 1) == 's')
    {
        cout << s + "es" << endl;
    }
    else
    {
        cout << s + 's' << endl;
    }
}

Measured memory_bytes: 3592
import math
N = int(input())
result = float(N) / 1.08
result_int_floor = math.floor(result)
result_int_ceil = math.ceil(result)
if(math.floor(result_int_floor * 1.08) == N):
    print(result_int_floor)
elif(math.floor(result_int_ceil * 1.08) == N):
    print(result_int_ceil)
else:
    print(":(")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
//#pragma GCC diagnostic error "-Wconversion"
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define mp(a, b) make_pair(a, b)
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = (1e9 + 7);
using namespace std;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
ll dp[100010];
ll gcd(ll x, ll y){
  return y == 0 ? x : gcd(y, x % y);
}
ll lcg(ll x, ll y){
  return x * y / gcd(x, y);
}
ll digits(ll x){
  ll length = 0;
  while (x > 0){
    x /= 10;
    length++;
  }
  return length;
  if (x == 0) return 0;
}
map<ll, ll> factor(ll n){
  map<ll, ll> ans;
  ll a = 2;
  while (n >= a * a){
    if (n % a == 0){
      ans[a]++;
      n /= a;
    }
    else a++;
  }
  ans[n]++;
  return ans;
}
template<class T> inline bool chmin(T& a, T b){
  if (a > b){
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b){
  if (a < b){
    a = b;
    return true;
  }
  return false;
}

int main(){
  cout << fixed << setprecision(15);
  //int ans = 0;
  //string ans = "No";

  string s; cin >> s;
  sort(all(s));
  char ans = 'a';
  rep(i, s.size()){
    if(s[i] == ans) ans++;
  }
  if (ans == '{'){
    cout << "None" << endl;
    return 0;
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
#include<stdio.h>

int main(void){
  int n, vsum = 0, csum = 0;
  
  scanf("%d", &n);
  int val[n], cos[n];
  for(int i = 0;i < n;i++){
    scanf("%d", &val[i]);
  }
  for(int i = 0;i < n;i++){
    scanf("%d", &cos[i]);
    if(val[i] > cos[i]){
      vsum += val[i];
      csum += cos[i];
    }
  }
  printf("%d\n", vsum - csum);
  return 0;
}

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

int main(){
  int n,k;
  cin >> n >> k;
  vector<long long> h(n);
  rep(i,n){cin >> h[i];}
  sort(h.begin(),h.end());
  reverse(h.begin(),h.end());
  if(k!=0){
    long long ans = 0;
    for(long long i = k; i < h.size(); i++){
      ans += h[i];
    }
    cout << ans << endl;
    return 0;
  }
  
  cout << accumulate(h.begin(),h.end(),0LL) << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<math.h>
#include<stdbool.h>
#include<set>
#define N 1000000007
using namespace std;
typedef long long ll;
int num[100001];
int main(void) {
	int x, ans = 1, sum = 1, num = 0;
	cin >> x;
	for (int i = 2;i <= 31;i++) {
		sum = 1;
		num = 0;
		while (sum*i <= x) {
			sum *= i;
			num++;
		}
		if (num >= 2)ans = max(ans, sum);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n,m,a,b;
	cin>>n>>m>>a>>b;
	if(n%a==0&&m%b==0)cout<<"No"<<endl;
	else{
		cout<<"Yes"<<endl;
		vvi out(n,vi(m));
		if(m%b){
			rep(i,n){
				vi t(m+1);
				rep(j,m-b+1)t[j+b]=t[j]-1;
				t[m]=1;
				for(int j=m-b;j>0;j-=b)t[j]=t[j+b]+1;
				rep(j,m)out[i][j]=t[j+1]-t[j];
			}
		}else{
			rep(i,m){
				vi t(n+1);
				rep(j,n-a+1)t[j+a]=t[j]-1;
				t[n]=1;
				for(int j=n-a;j>0;j-=a)t[j]=t[j+a]+1;
				rep(j,n)out[j][i]=t[j+1]-t[j];
			}
		}
		rep(i,n)rep(j,m)cout<<out[i][j]<<" \n"[j==m-1];
	}
}







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

int main()
{
    int n, m;
    int A[100][100];
    int b[100];

    cin >> n >> m;

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            cin >> A[i][j];
        }
    }
    for (int i = 0; i < m; i++)
    {
        cin >> b[i];
    }

    for (int i = 0; i < n; i++)
    {
        int tmp = 0;
        for (int j = 0; j < m; j++)
        {
            tmp += A[i][j] * b[j];
        }
        cout << tmp << endl;
    }
}



Measured memory_bytes: 3104
#include <iostream>

using namespace std;

const int NMAX = 9;
bool visited[NMAX], graph[NMAX][NMAX];
int n, m, ans;

void dfs(int currentNode, int numVisited) {
    if (numVisited == n) {
        ans++;
    }

    visited[currentNode] = true;
    for (int i = 1; i <= n; i++) {
        if (graph[currentNode][i] && !visited[i]) {
            dfs(i, numVisited + 1);
        }
    }
    visited[currentNode] = false;
}

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

    int a, b;

    for (int i = 0; i < m; i++) {
        cin >> a >> b;
        graph[a][b] = graph[b][a] = true;
    }

    dfs(1, 1);

    cout << ans << endl;
}


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

int main(){
  int n;
  string s;

  cin >> n;
  cin >> s;

  int a[400000] = {0}, b[400000] = {0};
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'E') {
      cnt1++;
      a[i] = cnt1;
      b[i] = cnt2;
    }
    else if (s[i] == 'W') {
      cnt2++;
      a[i] = cnt1;
      b[i] = cnt2;
    }
  }

  int min = a[n-1] - a[0];
  for (int i = 1; i < n; i++) {
    int sum = a[n-1] - a[i] + b[i-1];
    if (min > sum) {
      min = sum;
    }
  }

  cout << min << endl;

  return 0;
}

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

int main()
{
    int n,d;
    cin>>d>>n;
    if(d ==0){
        if(n<100){
            cout<<n;
        }
        else{
            cout<<101;
        }
    }
    else if(d == 1){
        if(n<100){
            cout<<n*100;
        }
        else{
            cout<<101*100;
        }
    }
    else if(d == 2){
        if(n<100){
            cout<<n*10000;
        }
        else{
            cout<<101*10000;
        }
    }
    return 0;
}


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

using namespace std;

#ifdef Lin1043
    #define DEBUG(msg, ...) printf("(%s #%d) " msg, __FUNCTION__, __LINE__, __VA_ARGS__)
    #define massert(...) assert(...)
#else
    #define DEBUG(...)
    #define massert(...)
#endif

#define rep(i , l , r) for(int i = (l) , ___ = (r) ; i <= ___ ; ++i )
#define per(i , r , l) for(int i = (r) , ___ = (l) ; i >= ___ ; --i )

struct iopener
{
    iopener()
    {
#ifdef Lin1043
        freopen("./in" , "r" , stdin);
#endif
    }
} iop;

typedef long long LL;

template<typename T>inline bool chkmin(T &x , const T &y) { return x > y ? (x = y , 1) : 0; }
template<typename T>inline bool chkmax(T &x , const T &y) { return x < y ? (x = y , 1) : 0; }

template<typename T>inline T read(T &f)
{
    f = 0; int x = 1 ; char c = getchar();
    while(!isdigit(c)) x = (c == '-' ? -1 : 1) , c = getchar();
    while(isdigit(c)) (f *= 10) += c & 15 , c = getchar();
    return f = x * f;
}

const int N = 100000 + 5;

int n , p = -1; 
LL L , A[N];

void solve(int x)
{
    rep(i , 1 , x - 1)
        printf("%d\n" , i);
    per(i , n - 1 , x)
        printf("%d\n" , i);
}

int main()
{
    read(n) , read(L);
    rep(i , 1 , n) read(A[i]);
    rep(i , 1 , n - 1)
    {
        if(A[i] + A[i + 1] >= L)
        {
            p = i ; break ;
        }
    }
    if(p == -1)
        puts("Impossible");
    else
        puts("Possible") , solve(p);
    return 0;
}



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

int main() {
string S;
cin >> S;
vector<string> dotw={"SUN","MON","TUE","WED","THU","FRI","SAT"};
int ans;
for (int i=0;i<7;i++){
    if(S==dotw.at(i)){
        ans = 7-i;
    }
}
cout << ans << endl;
}

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

using namespace std;
typedef pair <int, int> ii;

const int N = (1 << 19);
int a[N], n, ans[N];
ii F[N];

ii combine(ii A, ii b) {
	vector <int> v; v.clear();
	v.push_back(A.first); v.push_back(A.second);
	v.push_back(b.first); v.push_back(b.second);
	sort(v.begin(), v.end(), [](int i, int j) {
		return (a[i] > a[j]);
	});
	return {v[0], v[1]};
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n;
	for (int i = 0; i < (1 << n); ++i) {
		cin >> a[i];
		F[i] = {i, 0};
	}
	for (int mask = 1; mask < (1 << n); ++mask) {
		set <ii> V; V.clear();
		V.insert({-a[mask], mask});
		for (int i = 0; i < n; ++i) if (mask & (1 << i)) {
			V.insert({-a[F[mask ^ (1 << i)].first], F[mask ^ (1 << i)].first});
			V.insert({-a[F[mask ^ (1 << i)].second], F[mask ^ (1 << i)].second});
		}
		F[mask] = {(*V.begin()).second, (*++V.begin()).second};
	}
	for (int i = 1; i < (1 << n); ++i) {
		ans[i] = a[F[i].first] + a[F[i].second];
		ans[i] = max(ans[i], ans[i - 1]);
		cout << ans[i] << endl;
	}

	return 0;
}

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

int main(){
    int n,d;
    cin >> n >> d;
    int res = 0;
    vector<vector<int>> x(n,vector<int>(d));
    rep(i,n){
        rep(j,d){
            cin >> x[i][j];
        }
    }
    for(int i = 0;i<n-1;i++){
        for(int j = i+1;j<n;j++){
            int sq = 0;
            rep(k,d){
                int s = x[i][k]-x[j][k];
                sq += s * s;
            }
            int s = sqrt(sq) + 0.5;
            if(s*s == sq) res++;
        }
    }   
    cout << res << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MAX 100000
#define MAX_LOG 30
vector<int>G[MAX];
int depth[MAX];
int parent[MAX_LOG][MAX];
int root;
void dfs(int v,int p,int d){
  parent[0][v]=p;
  depth[v]=d;
  for(int i=0;i<G[v].size();i++){
    if(G[v][i]!=p)dfs(G[v][i],v,d+1);
  }
}
void init(int V){
  //parent??¨dfs??????????????????
  dfs(root,-1,0);
  //parent??????????????????
  for(int k=0;k+1<MAX_LOG;k++){
    for(int v=0;v<V;v++){
      if(parent[k][v]<0)parent[k+1][v]=-1;
      else parent[k+1][v]=parent[k][parent[k][v]];
    }
  }
}
int lca(int u,int v){
  if(depth[u]>depth[v])swap(u,v);
  for(int k=0;k<MAX_LOG;k++){
    if((depth[v]-depth[u])>>k&1){
      v=parent[k][v];
    }
  }
  if(u==v)return u;
  for(int k=MAX_LOG-1;k>=0;k--){
    if(parent[k][u]!=parent[k][v]){
    u=parent[k][u];
    v=parent[k][v];
  }
  }
  return parent[0][u];
}
int main(){
  root=0;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int p=0;
    cin>>p;
    while(p--){
      int t;
      cin>>t;
      G[i].push_back(t);
    }
  }
  init(n);
  int p;
  cin>>p;
  while(p--){
    int q,w;
    cin>>q>>w;
    cout<<lca(q,w)<<endl;
  }
}

Measured memory_bytes: 25328
//
// Created by prana on 2020-05-13.
// Facebook Hacker Cup
//

#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <map>
#include <ctime>

using  namespace std;

int main() {

    int n;
    cin >> n;
    vector<pair<string, int>> cases;
    cases.push_back(pair<string, int>("AC", 0));
    cases.push_back(pair<string, int>("WA", 0));
    cases.push_back(pair<string, int>("TLE", 0));
    cases.push_back(pair<string, int>("RE", 0));


    for (int i = 0; i < n; ++i){
        string s;
        cin >> s;
        for (int j = 0; j < 4; ++j){
            if (cases[j].first == s){
                cases[j].second++;
            }
        }
    }

    for (int i = 0; i < 4; ++i){
        cout << cases[i].first << " x " << cases[i].second << endl;
    }



    return 0;
}

Measured memory_bytes: 3176
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair < int , int >
#define F first
#define S second
#define int long long
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize ("Ofast")
using namespace std;
/// khodaya komak kon
/// ya navid navid
const int N=2e5+100;

int32_t main(){
ll a,b,c;
cin >> a >> b >> c;
if (a+b+c>=22){
    cout << "bust";
}
else{
    cout << "win";
}
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };

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

#[allow(unused_macros)]
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, usize1) => {
        read_value!($next, usize) - 1
    };

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

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let s: String = cin
        .bytes() // Bytes
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace()) // c が whitespace である限り skip
        .take_while(|c| !c.is_whitespace()) // c が whitespace でない限り要素を返す
        .collect();
    s.parse().ok().expect("failed parsing")
}

#[allow(non_snake_case)]
fn main() {
    input! {
        mut A:isize,B:isize,mut C:isize,D:isize
    }
    for i in 0..1000 {
        if i % 2 == 0 {
            C -= B;
        } else {
            A -= D;
        }
        if A <= 0 || C <= 0 {
            break;
        }
    }
    if A <= 0 {
        println!("No");
    } else {
        println!("Yes");
    }
}


Measured memory_bytes: 2160
# -*- coding: utf-8 -*-
import heapq

num_product, num_coupon = [int(s) for s in input().split()]
price_list = []
for s in input().split():
  heapq.heappush(price_list, int(s)*-1)

for i in range(num_coupon):
  min = price_list[0]
  heapq.heapreplace(price_list, (min*-1//2)*-1)

sum = 0
for price in price_list:
  sum -= price

print(sum)

Measured memory_bytes: 14180
n = int(input())

b = []
for a in range(n):
    if (a+1) % 3 == 0:
        b.append(a+1)
    elif '3' in str(a+1):
        b.append(a+1)

for a in b:
    print(' ',end='')
    print(a,end='')
print('')


Measured memory_bytes: 6436
n = int(input())

statuses = []

for _ in range(n):
    statuses.append(input())

status_count = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0
}

for status in statuses:
    status_count[status] += 1

for key, value in status_count.items():
    print('{s} x {n}'.format(s=key, n=value))


Measured memory_bytes: 16320
#include <bits/stdc++.h>
using namespace std;
 
pair<int,int> ecnt[1000004];
pair<int,int> ocnt[1000004];
 
 
int main() {
	int n, a[100004];
	cin>>n;
	for(int i=0; i<n; i++)
		cin>>a[i];
	for(int i = 0;i<=100000;i++){
		ecnt[i] = {0, i};
		ocnt[i] = {0, i};
	}
 
	for(int i=0; i<n;i++)	{
		if(i % 2)
			ocnt[a[i]].first += 1;
		else
			ecnt[a[i]].first += 1;
	}
	sort(ecnt, ecnt+100001);
	sort(ocnt, ocnt+100001);
	int eMax = ecnt[100000].second, oMax = ocnt[100000].second;
	if(eMax != oMax)
		cout<<n/2 - ecnt[100000].first + (n+1)/2 - ocnt[100000].first;
	else
		cout<<min(n/2-ecnt[100000].first + (n+1)/2 - ocnt[99999].first,
				  n/2-ecnt[99999].first + (n+1)/2 - ocnt[100000].first);
	return 0;
}

Measured memory_bytes: 5504
fun main(args:Array<String>){
    val (a,b)=readLine()!!.split(" ").map{it.toInt()}
    if (a<=b){
        println(1)
    }else if (a>b){
        when {
            a%b==0 -> {println(a/b)}
            else   -> {println((a/b)+1)}
        }
    }
}

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

namespace codeTester.todayProblem
{
    class ABC060C
    {
        static List<long> nt = new List<long>();
        static List<long> tList = new List<long>();
        static long answer = 0;

        static long T_N_MAX = 1000000000;
        static long T_MAX = 1000000000;

        public static void Main(string[] args)
        {
            Input();
            Logic();
            Output();
        }

        static void Input()
        {
            nt = ReadSpaceSeparatedValues();
            tList = ReadSpaceSeparatedValues();
        }

        public static List<long> ReadSpaceSeparatedValues()
        {
            List<long> values = new List<long>();
            string[] inputs = Console.ReadLine().Split(' ');
            foreach (string input in inputs)
            {
                values.Add(long.Parse(input));
            }

            return values;
        }

        static void Logic()
        {
            long n = nt[0];
            long t = nt[1];
            List<long> tShiftList = tList.Select(n0 => n0).ToList();
            tShiftList.RemoveAt(0);
            tShiftList.Add(T_N_MAX + T_MAX);
            answer = tList.Zip(tShiftList, (n1, n2) => n2 - n1).Aggregate((long)0, (sum, value) => sum + Math.Min(t, value));
        }

        static void Output()
        {
            Console.WriteLine(answer.ToString());
        }

        static void DebugPrint(string msg)
        {
            // 提出時に消す
            // Console.WriteLine(msg);
        }

        static void DebugPrint(string msg, List<long> values)
        {
            // 提出時に消す
            DebugPrint(msg + string.Join(" ", values));
        }
    }
}


Measured memory_bytes: 32928
#include<iostream>
using namespace std;
int main(){
  long int  A,B,K;
  cin >> A >> B >> K;
  if(A>K) A-=K;
  else{
    K-=A;
    A=0;
    if(B>K) B-=K;
    else B=0;
  }
  cout << A << " " << B << endl;
}

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

static class Program
{
    class Magic
    {
        public readonly int A;
        public readonly int B;
        public Magic(int[] args)
        {
            A = args[0];
            B = args[1];
        }
    }

    static int Solve(int H, int N, Magic[] magics)
    {
        var dp = new int[H + 1];
        Func<int, int> get = i => (i >= 0) ? dp[i] : 0;
        for (int i = 1; i <= H; ++i)
        {
            dp[i] = magics.Min(m => get(i - m.A) + m.B);
        }
        return dp[H];
    }

    static void Main(string[] args)
    {
        var V = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int H = V[0], N = V[1];
        var magics = new Magic[N];
        for (int i = 0; i < N; ++i)
        {
            magics[i] = new Magic(Array.ConvertAll(Console.ReadLine().Split(), int.Parse));
        }
        Console.WriteLine(Solve(H, N, magics));
    }
}


Measured memory_bytes: 13340
import bisect
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for _ in range(A)] + [INF]
t = [-INF] + [int(input()) for _ in range(B)] + [INF]
for q in range(Q):
    x = int(input())
    # upper_boundを使う
    b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)
    res = INF
    for S in [s[b-1], s[b]]:  # xを挟んで左側と右側
        for T in [t[d-1], t[d]]:  # xを挟んで右側と左側
            d1, d2 = abs(S-x) + abs(T-S), abs(T-x) + abs(S-T)  # 神社行って寺行くのと, 寺行って神社行く, の2通り
            res = min(res, d1, d2)
    print(res)


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

int main() {
  string s;
  int N;
  cin >> s>> N;
  bool x=true;
  for(int i=0;i<N;i++){
    if(s.at(i)!='1'){
      cout<<s.at(i);
      x=false;
      break;
    }
  }
  if(x)cout <<1;
  return 0;
}

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

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define DEB 0
#define all(x) x.begin(), x.end()

int main(){
  int n;
  string order, mess, tmp;
  cin>>n;
  while(n--){
    cin >> order >> mess;
    for(int i=order.size()-1; i>=0; i--){
      switch(order[i]){
      case 'C':
	mess = mess.substr(1) + mess.substr(0,1);
	break;
      case 'J':
	mess = mess.substr(mess.size()-1) + mess.substr(0,mess.size()-1);
	break;
      case 'E':
	if( mess.size()%2==0 ){
	  mess = mess.substr(mess.size()/2) + mess.substr(0,mess.size()/2);
	}else{
	  mess = mess.substr(mess.size()/2+1) + mess[mess.size()/2] + mess.substr(0,mess.size()/2);
	}
	break;
      case 'A':
	reverse(all(mess));
	break;
      case 'P':
	rep(j,mess.size()){
	  if( '0'<=mess[j] && mess[j]<='9' ){
	    if( mess[j]=='0' ){
	      mess[j] = '9';
	    }else{
	      mess[j]--;
	    }
	  }
	}
	break;
      case 'M':
	rep(j,mess.size()){
	  if( '0'<=mess[j] && mess[j]<='9' ){
	    if( mess[j]=='9' ){
	      mess[j] = '0';
	    }else{
	      mess[j]++;
	    }
	  }
	}
	break;
      }
#if DEB
      cout << ":: " << mess << endl;
#endif
    }
    cout << mess << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
#include<cstring>
#include<stdio.h>
#include<cstdio>
#include<string.h>
#include<cmath>
using namespace std;
int main() {
	int n;
	int rec;
	int ans=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> rec;
		while (rec % 2 == 0) {
			rec /= 2;
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3616
program main
    implicit none
    integer n,q,a,b,c,p,x,i,st_size,s,t
    integer,allocatable::d(:),v(:,:),ans(:),st(:)
    type parr
        integer,allocatable::array(:)
    end type
    type(parr),allocatable::g(:)
    logical,allocatable::f(:)
    read *,n,q
    allocate(d(n))
    allocate(v(n-1,2))
    d=0
    do i=1,n-1
        read *,a,b
        d(a)=d(a)+1
        d(b)=d(b)+1
        v(i,1)=a
        v(i,2)=b
    end do
    allocate(g(n))
    do i=1,n
        allocate(g(i)%array(d(i)))
    end do
    d=0
    do i=1,n-1
        a=v(i,1)
        b=v(i,2)
        d(a)=d(a)+1
        d(b)=d(b)+1
        g(a)%array(d(a))=b
        g(b)%array(d(b))=a
    end do
    deallocate(v)
    allocate(ans(n))
    ans=0
    do i=1,q
        read *,p,x
        ans(p)=ans(p)+x
    end do
    allocate(f(n))
    f=.true.
    allocate(st(n))
    st(1)=1
    st_size=1
    do while(st_size>0)
        s=st(st_size)
        st_size=st_size-1
        f(s)=.false.
        do i=1,d(s)
            t=g(s)%array(i)
            if(f(t))then
                ans(t)=ans(t)+ans(s)
                st_size=st_size+1
                st(st_size)=t
            end if
        end do
    end do
    print '(i0)',ans
end program main

Measured memory_bytes: 21732
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
import java.awt.Point;

public class Main {
    // static int INF = (1 << 30) - 1;
    // static long L_INF = (1L << 62) - 1;
    // static long MOD = (long) 1e9 + 7;

    static class Solver {
        int n;

        // write your code
        void solve(InputReader in, PrintWriter out) {
            n = in.nextInt();
            int[] dp = new int[n + 1];
            dp[0] = 1;
            dp[1] = 1;
            for (int i = 2; i <= n; i++) {
                dp[i] = dp[i - 1] + dp[i - 2];
            }
            out.println(dp[n]);
        }

        void debug(Object... os) {
            System.err.println(Arrays.deepToString(os));
        }
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(in, out);
        out.close();
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

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



Measured memory_bytes: 24544
N = int(input())
A = list(map(int, input().split()))

if __name__ == '__main__':
    print(" ".join(map(str, A)))
    for i in range(1, N):
        target_num = A[i]
        j = i - 1
        while j >= 0 and A[j] > target_num:
            A[j+1] = A[j]
            j -= 1
            A[j+1] = target_num
        print(" ".join(map(str, A)))


Measured memory_bytes: 5600
#pragma region
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion

#pragma region Combination
const int MAX = 1000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
long long COM(int n, int k)
{
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
#pragma endregion


int main()
{
	int x, y; cin >> x >> y;
	if ((x + y) % 3 != 0)cout << 0 << endl;
	else
	{
		COMinit();
		int z = (x + y) / 3;
		int a = x - z;
		cout << COM(z, a) << endl;
	}
}


Measured memory_bytes: 23680
#include <bits/stdc++.h>
#define For(i, begin, end) for(int i=begin;i<end;i++)
#define Rep(i, n) For(i,0,n)
#define Sort(v) sort(v.begin(),v.end())
using namespace std;

int main(){
  string S;
  cin>>S;
  if(S[0]=='9'||S[1]=='9')cout<<"Yes";
  else cout<<"No";

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <queue>
#include <stack>
using namespace std;

typedef long long ll;
#define pb push_back

#define rep(i, n) for (int i=0;i<(n);++i)
#define rep2(i, s, n) for (int i=s;i<(n);++i)
#define INF (1e9+1e9)

class Edge{
public:
    int u, v, cost;
    Edge(int u, int v, int cost):
        u(u), v(v), cost(cost) {}
    bool operator < (const Edge& e) const {
        return cost != e.cost ? cost > e.cost : // for min-priority queue
            u != e.u ? u < e.u : v < e.v;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

/* Johnson Alogrithm */
bool johnson(Graph& G, vector<vector<int> >& d, vector<vector<int> >& p)
{
    int V = G.size();

    vector<int> h(V,0); 
    // Bellman-Ford
    rep(k,V) rep(i,V) for(auto& e:G[i]) if (h[e.v] > h[e.u] + e.cost) {
            h[e.v] = h[e.u] + e.cost;
            if (k == V-1) return true; // negative cycle
        }

    // reweighting
    rep(i,V) for(auto& e:G[i]) e.cost += h[e.u] - h[e.v];

    rep(s, V) {
        // Dijkstra
        priority_queue<Edge> Q;
        d[s][s] = 0;
        Q.push(Edge(s,s,0));
        while(!Q.empty()) {
            Edge e = Q.top(); Q.pop();
            if(d[s][e.v] == INF) continue;
            for(auto& f:G[e.v]) if(d[s][f.v] > d[s][f.u] + f.cost) {
                    d[s][f.v] = d[s][f.u] + f.cost;
                    p[s][f.v] = f.u;
                    Q.push(Edge(f.u, f.v, d[s][f.u] + f.cost));
                }
        }
        // re-calculating
        rep(i,V) if(d[s][i] != INF) d[s][i] += h[i] - h[s];
    }
    return false;
}

int main()
{
    int V,E; cin>>V>>E;
    Graph G(V);
    rep(i,E) {
        int u,v,c; cin>>u>>v>>c;
        G[u].pb(Edge(u,v,c));
    }

    vector<vector<int> > d(V,vector<int>(V,INF)), p(V,vector<int>(V,-2));
    bool neg_cycle = johnson(G,d,p);

    if(neg_cycle) cout << "NEGATIVE CYCLE" << endl;
    else rep(i,V) {
            rep(j,V) {
                if (d[i][j] == INF) cout << "INF";
                else cout << d[i][j];
                if(j != V-1) cout << " ";
            }
            cout << endl;
        }
}

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

int main() {
    //input
    int n, m;
    cin >> n;
    cin >> m;
    vector<vector<int>> sw(m);
    for (int i = 0; i < m; i++) {
        int k;
        cin >> k;
        for (int j = 0; j < k; j++) {
        int s;
        cin >> s;
        sw[i].push_back(s-1);
        }
    }
    
    vector<int> p(m);
    for (int i = 0; i < m; i++) {
        cin >> p[i];
    }
    
    int sum = 0;
    int z = 1 << n;
    for (int i = 0; i < z; i++) {
        int lighton = 0;
        for (int j = 0; j < m; j++) {
        int on = 0;
        for (int ss : sw[j]) {
            if (i & (1 << ss)) on++;
        }
        if (on % 2 == p[j]) lighton++;
        }
        if (lighton == m) sum++;
    }
    cout << sum<< endl;
    return 0;

}

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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		while(!(line = br.readLine()).equals("0")){
			int n = Integer.parseInt(line);
			int count = 0;
			int i=2;
			int res = 0;
			while(count < n){
				if(isPrimeNum(i)){
					count++;
					res += i;
				}
				i++;
			}
			System.out.println(res);
		}

	}
	static boolean isPrimeNum( int x ) {
        if( x == 2 ) return true;
        if( x < 2 || x % 2 == 0 ) return false;
        for( int n = 3; n <= Math.sqrt((double)x); n += 2 )
            if( x % n == 0 ) return false;
        return true;
    }

}

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

using namespace std; 
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>; 

#define INF INT_MAX/2 //(1<<(4*4-1))
#define MOD 10007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

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

  string S;
  cin>>S;

  string a="2019/04/30";
  if(S<=a)cout<<"Heisei"<<endl;
  else cout<<"TBD"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,k,n) for(int i=(k);i<int(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
constexpr int INF = 30;

map<pair<int,int>, int8_t> memo;

int8_t dfs(const vector<vector<int>> &idx, int i, int j) {
  auto itr = memo.find(make_pair(i, j));
  if (itr != end(memo)) return itr->second;
  if (j == 15*19) return 0;
  int oi = j/15;
  int oj = j%15;
  int di[8] = {1, 1, 1, 0, -1, -1, -1, 0};
  int dj[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
  int8_t res = INF;
  REP(k,8) {
    int l = 1;
    vector<int> ei;
    int ni;
    int nj;
    while (1) {
      ni = oi + l*di[k];
      nj = oj + l*dj[k];
      if (ni < 0 || ni >= 19 || nj < 0 || nj >= 15) break;
      if (idx[ni][nj] < 0 || ((i>>idx[ni][nj])&1)) break;
      ei.push_back(idx[ni][nj]);
      ++l;
    }
    if (l > 1) {
      int pi = i;
      for (int ix : ei) {
        pi |= 1 << ix;
      }
      if (ni >= 19 || (ni == 18 && nj >= 0 && nj < 15)) {
        res = min(res, int8_t(dfs(idx, pi, 15*19)+1));
      } else if (ni >= 0 && nj >= 0 && nj < 15) {
        res = min(res, int8_t(dfs(idx, pi, ni*15+nj)+1));
      }
    }
  }
  memo[make_pair(i,j)] = res;
  return res;
}

int main() {
  vector<string> t(19);
  vector<pair<int, int>> vb;
  vector<vector<int>> idx(19, vector<int>(15, -1));
  int si, sj;
  REP(i,19) {
    cin>>t[i];
    REP(j,15) {
      if (t[i][j] == 'X') {
        idx[i][j] = vb.size();
        vb.emplace_back(i,j);
      } else if (t[i][j] == 'O') {
        si = i;
        sj = j;
      }
    }
  }
  int res = dfs(idx, 0, si*15+sj);
  if (res < INF) {
    cout << (int)res << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}

Measured memory_bytes: 8364
import scala.io.StdIn.readLine
object Main extends App {
  val input: Char = readLine.charAt(0)

  val output: String = input match {
    case 'a'|'e'|'i'|'o'|'u' => "vowel"
    case _                   => "consonant"
  }

  println(output)
}


Measured memory_bytes: 21440
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    string S,T,U;
    int A,B;
    cin >> S >> T >> A >> B >> U;
    if(U==S){
        A--;
    }else{
        B--;
    }
    cout << A << ' ' << B << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
    int N, v[50], i;
    cin >> N;
    for (i=0;i<N;i++) cin >> v[i];
    sort(v, v + N);
    
    float res = v[0];
    for (i=1;i<N;i++){
        res = (res + float(v[i])) / 2;
    }
    cout << res << endl;
}



Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if((x >= r && x <= W-r) && (y >= r && y <= H-r))
        printf("Yes\n");
    
    else
        printf("No\n");
return 0;
}



Measured memory_bytes: 2104
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;

#define MOD 998244353
int main(){
    ll n;
    cin >> n;
    ld x[n],y[n],ans=0;
    ld lengh[n][n];
    for (ll i=0;i<n;i++){
        lengh[i][i]=0;
    }
    for (ll i=0;i<n;i++){
        cin >> x[i] >> y[i];
    }
    for (ll i=0;i<n;i++){
        for (ll j=i+1;j<n;j++){
            if (i==j)continue;
            ans+=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))*2;
        }
    }
    
    ll cc=1;
    for (ll i=1;i<n;i++){
        cc*=i;
    }
    cout << setprecision(20) << ans/n << endl;
    
    return 0;
}


Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	v := make([]int, N)
	for i := 0; i < N; i++ {
		v[i] = getInt()
	}
	sort.Ints(v)
	ans := float64(v[0])
	for i := 1; i < N; i++ {
		ans += float64(v[i])
		ans /= 2.0
	}
	out(ans)
}


Measured memory_bytes: 1776
#include <algorithm>
#include <iostream>
using namespace std;
long long n,i,j,ans,sum,num[100005];
string s[100005],now;
int main()
{
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>s[i];
		sort(s[i].begin(),s[i].end());
	}
	sort(s,s+n);
	for(i=0;i<n;i++)
	if(now!=s[i])
	{
		now=s[i];
		num[sum]=1;
		sum++;
	}
	else num[sum-1]++;
	for(i=0;i<sum;i++)ans+=(num[i]*(num[i]-1))/2;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 8064
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


n, *a = map(int, read().split())

ans = 0
for i, v in enumerate(a):
    if (i + 1) % 2 != 0 and v % 2 != 0:
        ans += 1

print(ans)


Measured memory_bytes: 8996
#include<iostream>
using namespace std;
int num[26];
int main()
{
	char ch[141];
	cin >> ch;
	for (int i = 0; ch[i]; ++i){
		if (ch[i] >= 'a'&&ch[i] <= 'z'){
			num[ch[i] - 'a']++;
		}
	}
	for (int i = 0; i < 26; ++i){
		if (num[i] % 2 != 0){ cout << "No" << endl; return 0; }
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rep2(r, aa, bb) for (ll r = (aa)-1; r >= (bb); r--)
#define be(x) (x.begin(), x.end())
#define pb(t) push_back(t)
#define ll long long
#define mp(a, b) make_pair(a, b)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin>>s;
    int count=0;
    vector<int>A(26, 0);
    rep(i,0,s.size()/2){
        if(s[i]!=s[s.size()-i-1])count++;
    }
    cout<<count<<"\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const ll MOD = 1000000007LL;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
int main() {
  IOS;
  ll n, a, b;
  cin >> n >> a >> b;
  ll ans = (bpow(2, n) - 1 + MOD) % MOD;
  ll x = 1, y = 1;
  for (ll i = 1; i <= b; i++) {
    x = x * (n - i + 1) % MOD, y = y * i % MOD;
    if (i == a || i == b) {
      ans = (ans - x * bpow(y, MOD - 2) % MOD + MOD) % MOD;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3648
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Question question = new Question();
        question.solve(sc);
    }

    static class Question {
        public void solve(Scanner sc) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int o = sc.nextInt();
            System.out.printf("%d %d %d", o, n, m);
        }
    }
}


Measured memory_bytes: 21204
import java.util.Scanner;

public class Main{
    public void solve(){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        
        for(int i=0;i<n;i++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            int b = sc.nextInt();
            int p = sc.nextInt();
            
            int kin = x*b + y*p;
            
            if(b>=5 && p>=2){
                kin = (x*b + y*p)*4/5;
            }else{
                if(b<5){
                b=5;
                }
                if(p<2){
                p=2;
                }
                int wari = (x*b + y*p)*4/5;
                
                if(kin>wari){
                    kin = wari;
                }
            }
            System.out.println(kin);
        }
    }
    
    public static void main(String[]args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 23444