akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(9), 0);
//int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv ./prog.exe") >> 8), 0);
int main() {
    Int N; cin >> N;
    N++; // includes zero
    deque<int> A, B;
    int num = 1;
    for (int i = 60; i >= 0; i--) {
        if (!A.empty()) {
            A.push_back(num);
            B.push_back(num);
            num++;
        }
        if (A.empty() && (N & (1LL << i))) {
            if (N & (1LL << (i - 1))) {
                A.push_back(1); A.push_back(2); B.push_back(2); B.push_back(1);
                num += 2;
            } else {
                A.push_back(1); B.push_back(1);
                num++;
            }
            i--;
        } else if (N & (1LL << i)) {
            A.push_back(num);
            B.push_front(num);
            num++;
        }
    }
    A.insert(end(A), begin(B), end(B));
    cout << A.size() << '\n';
    for (int i = 0; i < A.size(); i++) {
        cout << A[i] << " \n"[i + 1 == A.size()];
    }
    cout << '\n';
    return 0;
}

Measured memory_bytes: 3656
#include <stdio.h>

int main(void){
    int n,l;
    int aji[101] = {};
    int i,e;
    int tmp,tmp1;
    int sum = 0;
    scanf("%d %d", &n, &l);
    
    for(i = 1; i <= n; i++){
        aji[i] = l + i - 1;
    }
    
    if(aji[1] < 0){
        tmp = -aji[1];
    }else{
        tmp = aji[1];
    }
    
    e = 1;
    for(i = 2; i <= n; i++){
        if(aji[i] < 0){
            tmp1 = -aji[i];
        }else{
            tmp1 = aji[i];
        }
        
        if(tmp1 < tmp){
            tmp = tmp1;
            e = i;
        }
    }
    
    for(i = 1; i <= n; i++){
        if(i != e){
            sum += aji[i];
        }
    }
    
    printf("%d\n", sum);
    
    return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> ans(N+1,0);
  for(int x=1;;x++){
    if(x*x>N){
      break;
    }
    for(int y=1;;y++){
      if(x*x+y*y+x*y>N){
        break;
      }
      for(int z=1;;z++){
        if(x*x+y*y+z*z+x*y+y*z+z*x>N){
          break;
        }
        ans.at(x*x+y*y+z*z+x*y+y*z+z*x)++;
      }
    }
  }
  for(int i=1;i<=N;i++){
    cout << ans.at(i) << endl;
  }
  return 0;
}


Measured memory_bytes: 3536
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

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

	vector< vector< pair<int, int> > > ord(N);	//y, id
	for (int ii = 0; ii < M; ++ii){
		int p, y;
		cin >> p >> y;
		p--;
		ord[p].push_back(make_pair(y, ii));
	}

	for (int ii = 0; ii < N; ++ii){
		sort(ord[ii].begin(), ord[ii].end());
	}

	vector < pair<int, int> > ID(M);
	for (int ken = 0; ken < N; ++ken){
		for (int id = 0; id < ord[ken].size(); ++id){
			int idx = ord[ken][id].second;
			ID[idx] = make_pair(ken, id);
		}
	}

	for (int ii = 0; ii < M; ++ii){
		int ken = ID[ii].first + 1;
		int id = ID[ii].second + 1;
		printf("%06i%06i\n", ken, id);
	}

	return 0;
}


Measured memory_bytes: 9408
#include<iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include<unordered_map>
using namespace std;
const long long int mod1=1000000007;
const long long int mod2 = -1;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pp pop_back                                       
#define ff first
#define ss second
#define ll long long int
#define ull unsigned long long int
#define ordered_set tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define ordered1 tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define inf mod1
#define all(x) x.begin(),x.end()
ll gcd(ll a, ll b){
    ll c;
     while(b){
        c = b;
        b = a % b;
        a = c;
     }
     return a;
}
ll power1(ll a, ll b){
     if(b == 0) return 1;
     else if(b % 2) return a * power1(a, b - 1);
     else {
        ll temp = power1(a, b / 2);
        return temp * temp;
     }
}
ll power2(ll a, ll b, ll m){
     a %= m;
     if(b == 0) return 1;
     else if(b % 2) return (a * power2(a, b - 1, m)) % m;
     else{
        ll temp = power2(a, b / 2, m);
        return (temp * temp) % m;
     }
}
ll mod(ll x, ll p){
return (x % p + p) % p;
}
ll lcm(ll x, ll y){
return (x * y)/gcd(x, y);
}
int main(){
    fast;
    ll tt = 1;
    //cin >> tt;
    while(tt--){
        ll n, k;
        cin >> n >> k;
        ll a[n];
        for(int i = 0; i < n; i++){
            cin >> a[i];
            a[i]--;
        }
        ll vis[n] = {};
        vis[0] = 1;
        ll cur = 0;
        ll dis[n] = {};
        dis[0] = 0;
        while(!vis[a[cur]]){
            //cout << cur << " ";
            dis[a[cur]] = dis[cur] + 1;
            cur = a[cur];
            vis[cur] = 1;
        }
        if(k <= dis[a[cur]]){
            ll j = k;
            ll out = 0;
            while(j--){
                out = a[out];
            }
            cout << out + 1;
            return 0;
        }
        k -= dis[a[cur]];
        k %= (dis[cur] - dis[a[cur]] + 1);
        //cout << k << endl;
        ll out = a[cur];
        while(k--){
            out = a[out];
        }
        cout << out + 1<< endl;

    }
}


Measured memory_bytes: 8284
package main

import (
	"fmt"
)

func main() {
	var n, heigt, maxHeight int
	fmt.Scan(&n, &maxHeight)

	count := 1
	for i := 1; i < n; i++ {
		fmt.Scan(&heigt)

		if maxHeight <= heigt {
			maxHeight = heigt
			count++
		}
	}

	fmt.Println(count)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
#define mod 1000000007
int main(void){
    int a,b; cin >> a >> b;
    cout << max(a+b,max(a-b,a*b)) << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
int n,suu[4],s[3],s2[3];
void func(int,int);
int main(void)
{
	char ss[3]="-+";
	scanf("%d",&n);
	suu[3]=n%10;
	n=n/10;
	suu[2]=n%10;
	n=n/10;
	suu[1]=n%10;
	suu[0]=n/10;
	func(0,suu[0]);
	printf("%d%c%d%c%d%c%d=7\n",suu[0],ss[s2[0]],suu[1],ss[s2[1]],suu[2],ss[s2[2]],suu[3]);
	return 0;
}
void func(int nn,int sum)
{
	int i;
	if(nn==3)	{
		if(sum==7)	{
			for(i=0;i<3;i++)	{
				s2[i]=s[i];
			}
		}
	}
	else {
		s[nn]=0;
		func(nn+1,sum-suu[nn+1]);
		s[nn]=1;
		func(nn+1,sum+suu[nn+1]);
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int N,M,a,b;
vector<vector<bool>> path;
vector<bool> passed;

int dfs(int now, int depth) {
  if(passed[now]) return 0;
  if(depth == N) return 1;
  passed[now] = true;
  int ans = 0;
  for(int i = 0; i < N; i++){
    if(path[now][i]) ans += dfs(i, depth+1);
  }
  passed[now] = false; // set false again for reuse
  return ans;
}


int main() {
  cin >> N >> M;
  path = vector<vector<bool>>(N, vector<bool>(N, false));
  passed = vector<bool>(N, false);
  while(cin >> a >> b) {
  	path[a-1][b-1] = path[b-1][a-1] = true;
  	// 0から始まるように-1した
  }
  cout << dfs(0, 1);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int gcd(int a, int b) {  
  return b != 0 ? gcd(b, a % b) : a;
}//MAX
int lcm(int a, int b) { 
   return a * b / gcd(a, b);
   }
//MIN

 main() {
    int a,b,c;
   cin >> a >> b >>c;
   int che = b+c;
   if(che>a){
      cout << che-a<<endl;
   }
   else{
      cout << 0 << endl;
   }
 }


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <bitset>
#include <cstring>

using namespace std;

#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define F first
#define S second

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

const int MOD = 1e9+7;
const int INF = 1e9+7;

#define MAX 100000

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

	int n, k; cin >> n >> k;
	vi v(n);
	for(auto& p: v) cin >> p;

	vi dp(k+1, false);

	for(int i = 1; i <= k; i++){
		for(int j = 0; j < n; j++){
			if(v[j] > i)
				break;
			if(dp[i-v[j]] == false){
				dp[i] = true;
				break;
			}
		}
	}

	cout << (dp[k] ? "First\n" : "Second\n");


	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <tuple>
#include <cassert>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define mp(a,b) make_pair((a), (b))
#define mt(a,b,c) make_tuple((a),(b),(c))

typedef long long ll;

int main(){
    long long int n,k; cin >> n >> k;
    vector<long long int> h(n);
    rep(i,n) cin >> h[i];
    sort(all(h));
    long long int sum = 0;
    rep(i,n-k) sum += h[i];
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define MAX 2000000000;

int main(){
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  
  int ans = MAX;
  int num = max(x, y);
  for (int i = 0; i <= num; i++){
    int a_num = max(x - i, 0);
    int b_num = max(y - i, 0);
    int p = 2 * c * i + a * a_num + b * b_num;
    if (ans > p) ans = p;
  }
  cout << ans << endl;
}

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

int main() {

	int W, H, x, y, r;

	cin >> W >> H >> x >> y >> r;

	if (x >= 0 && y >= 0 && (x + r) <= W && (y + r) <= H) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	//system("pause");
	return 0;
}


Measured memory_bytes: 3116
a=input().split()
s=input()
b=s.lower()
s=s.upper()
N=int(a[0])
K=int(a[1])
list=[]
n=0
while True:
    if n==K-1:
        list.append(b[n])
    else:
        list.append(s[n])
    n=n+1
    if n==N:
        break
list1="".join(list)
print(list1)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

const double EPS = 1E-8;
typedef vector<double> vec;
typedef vector<vec> mat;

vec gauss_jordan(const mat& A, const vec& b) {
    int n = (int)A.size();
    mat B(n, vec(n + 1));
    // init
    rep(i ,n) rep(j, n) B[i][j] = A[i][j];
    rep(i, n) B[i][n] = b[i];
    
    rep(i, n) {
        // 注目している変数の係数の絶対値が大きい式をi番目に持ってくる
        int pivot = i; // 要点
        rep3(j, i, n) if (abs(B[j][i]) > abs(B[pivot][i])) pivot = j;
        swap(B[i], B[pivot]);
        // 解がないか一意でない
        if (abs(B[i][i]) < EPS) return vec();
        // 注目している変数の係数を1にする
        rep3(j, i + 1, n + 1) B[i][j] /= B[i][i];
        // j番目の式からi番目の変数を消去
        rep(j, n) if (i != j) rep3(k, i + 1, n + 1) B[j][k] -= B[j][i] * B[i][k];
    }
    
    vec x(n);
    rep(i, n) x[i] = B[i][n];
    return x;
}

int main() {
    int a, bb, c, d, e, f;
    while (cin >> a >> bb >> c >> d >> e >> f) {
        mat A(2, vec(2));
        vec b(2);
        A[0][0] = a; A[0][1] = bb;
        A[1][0] = d; A[1][1] = e;
        b[0] = c;
        b[1] = f;
        auto v = gauss_jordan(A, b);
        cout << fixed << setprecision(3) << v[0] << " " << v[1] << '\n';
    }
    
}



Measured memory_bytes: 3204
#include <stdio.h>

int main(void){
	int a,b,d,r;
	double f;
	scanf("%d %d",&a,&b);
	d=a/b;
	r=a%b;
	f=(double)a/b;
	printf("%d %d %.8f\n",d,r,f);
	return 0;
}

Measured memory_bytes: 640
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MASS_MAX		300										// 最大マス数
#define D_SIZE_MAX		D_MASS_MAX * 3							// 最大サイズ

// 内部変数
static FILE *szpFpI;											// 入力
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス(９倍)
static int siMCnt;												// マス数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 一致チェック
int
fChkSame(
	int piSCol					// <I> 開始列
	, int piSRow				// <I> 開始行
)
{
	int i, j;

	for (i = 0; i < siMCnt; i++) {
		for (j = i + 1; j < siMCnt; j++) {

			// マス位置
			int liX1 = piSCol + j;
			int liY1 = piSRow + i;
			int liX2 = piSCol + i;
			int liY2 = piSRow + j;

			// 一致チェック
			if (sc2Mass[liY1][liX1] != sc2Mass[liY2][liX2]) {
				return -1;
			}
		}
	}

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, j, liRet;
	char lc1Buf[1024];

	// マス数 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d", &siMCnt);

	// マス - 取得
	for (i = 0; i < siMCnt; i++) {
		fgets(sc2Mass[i], sizeof(sc2Mass[i]), szpFpI);
	}

	// マス - ９倍化
	for (i = 1; i <= 2; i++) {
		for (j = 0; j < siMCnt; j++) {
			memcpy(&sc2Mass[j][i * siMCnt], sc2Mass[j], siMCnt);
		}
	}
	for (i = 1; i <= 2; i++) {
		for (j = 0; j < siMCnt; j++) {
			memcpy(sc2Mass[i * siMCnt + j], sc2Mass[j], siMCnt * 3);
		}
	}

	// 一致数 - 取得
	int liCnt = 0;
	for (i = 0; i < siMCnt; i++) {
		liRet = fChkSame(siMCnt + i, siMCnt);
		if (liRet == 0) {
			liCnt += siMCnt;
		}
	}

	return liCnt;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// １行出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}



Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <string>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;

int main(){
    int n;
    string s;
    cin >> n >> s;
    vector<int> left(n,0),right(n,0);

    left[0] = 0;
    if(s[0] == 'W')left[0]++;
    reps(i,1,n){
        left[i] = left[i-1];
        if(s[i] == 'W')left[i]++;
    }

    right[n-1] = 0;
    if(s[n-1] == 'E')right[n-1]++;
    for(int j = n-2;j >= 0; j--){
        right[j] = right[j+1];
        if(s[j] == 'E') right[j]++;
    }

    // rep(i,n) cout << left[i] << endl;
    // cout << endl;
    // rep(i,n) cout << right[i] << endl;
    // cout << endl;

    int ans = right[1];
    ans = min(ans,left[n-1]);

    rep(i,n-1){
        ans = min(ans,right[i+2] + left[i]);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 6152
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main()
{
  string s;
  cin >> s;
  vector<int>c(26,0);
  for(unsigned int i = 0; i < s.size(); i++){
    int idx = s[i] - 'A';
    c[idx]++;
  }
  int flg = 1;
  for(int i = 0; i < 26; i++){
    if(c[i] != 0 && c[i] != 2 ){
      flg = 0;
    }
  }
  
  if(flg){
    cout << "Yes";
  } else{
    cout << "No";
  }
  return 0;
}


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

int main() {
	int n;
	cin>>n;
	int sum;
	
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		sum+=(y-x+1);
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
#define pb push_back

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE

	// For getting input from input.txt file
	freopen("input1.txt", "r", stdin);

	// Printing the Output to output.txt file
	freopen("output1.txt", "w", stdout);

#endif
	/*Always stress test, for n=0, n=1, n=10^9,what if n<k and so on */
	/* Please remember 10^7 se bada array is not possible */
	/* Always use pen and paper, don't just look at the screen*/
	/* Try finding a pattern on pen and paper until y0u get it*/
	ll t = 1;
	// cin >> t;
	while (t--)
	{
		ll n;
		cin >> n;
		ll a[n];
		ll cnt = 0;
		for (int i = 0; i < n; ++i)
		{
			cin >> a[i];
			if (a[i] % 2 && (i + 1) % 2)
			{
				cnt++;
			}
		}
		cout << cnt << endl;
	}
}



Measured memory_bytes: 3564
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

int main(){
    int N,ans=0;
    cin >> N;
    vector<int>p(N);
    
    for(int i =0;i < N;i++)
        cin >> p.at(i);

    for(int i = 1;i < N-1;i++){
        if(p.at(i) > p.at(i-1)){
            if(p.at(i) < p.at(i+1))
                ans++;
        }else if(p.at(i) < p.at(i-1)){
            if(p.at(i) > p.at(i+1))
                ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
 
int main() {
  int N, L;
  cin >> N >> L;
  vector<string> words(N);
  
  for(int i = 0; i < N; i++) {
    cin >> words.at(i);
  }
  
  sort(words.begin(), words.end());
  
  for(int i = 0; i < N; i++) {
    cout << words.at(i);
  }
  cout << endl;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define P pair<int , int>
#define V vector<int>
#define VLL vector<long long>
#define M map<int, int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>

#define MAX_N 200000
int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
	int N, K;  cin >> N >> K;
	V p(N);  VECCIN(p);

	double keep = 0;
	for(int i = 0 ; i < K ; i++)
				keep += (double)(p[i] + 1) / 2;

	double ans = keep;
	for(int i = K ; i < N ; i++){
		keep += (double)(p[i] + 1) / 2 - (double)(p[i - K] + 1) / 2;
		ans = max(ans, keep);
	}

	printf("%.8lf\n", ans);
	
	return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ui = unsigned int;
using ul = unsigned long;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define loop(i, n) for (ui i = 0; i < n; i++)
struct BIT
{
private:
    vector<ul> bit;
    ui n;
    inline ul sum(ui x)
    {
        ul ret = 0;
        while (x > 0)
        {
            ret += bit[x];
            x -= x & -x;
        }
        return ret;
    }

public:
    BIT(ui n0, vector<ul> &A) : bit(n0 + 1, 0), n(n0)
    {
        for (ui i = 1; i <= n; i++)
            bit[i] = A[i - 1];
        for (ui i = 1; i < n; i++)
            bit[i + (i & -i)] += bit[i];
    }
    inline ul sum(ui l, ui r)
    {
        return sum(r + 1) - sum(l);
    }
    inline void add(ui i, ul x)
    {
        i++;
        while (i <= n)
        {
            bit[i] += x;
            i += i & -i;
        }
    }
};
#define scan(x) scanf("%ld", &x)
#define putout(a) printf("%ld\n", a)
int main()
{
    ui N, Q;
    cin >> N >> Q;
    vector<ul> A(N);
    loop(i, N) scan(A[i]);
    BIT data(N, A);
    loop(i, Q)
    {
        ui a;
        ul b, c;
        scan(a);
        scan(b);
        scan(c);
        if (a == 0)
            data.add(b, c);
        else
            putout(data.sum(b, c - 1));
    }
    return 0;
}


Measured memory_bytes: 12140
#include<bits/stdc++.h>
using namespace std;
#define int long long
struct node
{
	int x,h;
}t[1000001];
bool cmp(node a,node b){return a.x<b.x;}
signed main()
{
	int n,d,a;
	scanf("%lld%lld%lld",&n,&d,&a);
	for(int i=1;i<=n;i++)
		scanf("%lld%lld",&t[i].x,&t[i].h);
	sort(t+1,t+n+1,cmp);
	long long add=0,ans=0;
	priority_queue<pair<int,int> ,vector<pair<int,int> >,greater<pair<int,int> > >q;
	for(int i=1;i<=n;i++)
	{
		while(!q.empty()&&t[i].x-q.top().first>2*d)
		{
			add-=1ll*q.top().second*a;
			q.pop();
		}
		int delta=t[i].h-add;
		if(delta>0)
		{
			int tmp=(delta+a-1)/a;
			ans+=tmp;
			add+=tmp*a;
			q.push(make_pair(t[i].x,tmp));
		}
	}
	printf("%lld",ans);
	return 0;
}


Measured memory_bytes: 6516
#include<iostream>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if(a!=b||a!=c)
	{
		if(b==c)
			cout<<a;
		else if(a==b)
			cout<<c;
		else
			cout<<b;
	} 
	else if(a==b)
		cout<<c;
	else
		cout<<b;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/ruby
def lightsout(x,y)
  #now=Time.now.to_f
  succ=0
  a=Array.new(x*y)
  a.length.times{|i| a[i]=Array.new(2)}

  #create problem
  x.times{|i|
    y.times{|j|
      a[i+j*x][0]=1<<(i+j*x)
      a[i+j*x][1]= 0 +
        (1<<(i+j*x)) +
        (i>0   ? 1<<(i-1+j*x) : 0) +
        (i<x-1 ? 1<<(i+1+j*x) : 0) +
        (j>0   ? 1<<(i+(j-1)*x) : 0) +
        (j<y-1 ? 1<<(i+(j+1)*x) : 0) +
        0
    }
  }

  #solve
  (x*y).times{|i|
    if a[i][1]&1<<i==0
      (i+1).step(x*y-1) {|j|
        if a[j][1]&1<<i!=0
          a[i],a[j]=a[j],a[i]
          succ=1
          break
        end
      }
      if succ==0 then break end
      succ=0
    end

    (x*y).times{|j|
      if i!=j && a[j][1]&1<<i!=0
        a[j][0]^=a[i][0]
        a[j][1]^=a[i][1]
      end
    }

    #$stderr.printf("%d/%d passes\r",i+1,x*y)
  }
  #$stderr.puts

	gets.to_i.times{
		prob=[];ans=[0]*x*y
		y.times{prob+=gets.split.map(&:to_i)}
		(x*y).times{|i|if prob[i]>0 then (x*y).times{|j|ans[j]^=a[j][0][i]}end}
		y.times{|i|puts ans[i*x,x].map(&:to_s).join(' ')}
	}

=begin
  #output as C
  print <<"EOM"
#include <stdio.h>
int table[#{x*y}][#{x*y}]={
EOM

  a.each{|b|
    print "  {"
    a.length.times{|c|
      print "#{b[0][c]},"
    }
    print "},\n"
  }

  print <<"EOM"
};
int prob[#{x*y}], ans[#{x*y}];

main(b,c,i,j){
  for(scanf("%d",&c);b<=c;b++){
    for(i=0;i<#{x*y};i++)
      scanf("%d",prob+i),ans[i]=0;
    for(i=0;i<#{x*y};i++)
      if(prob[i])
        for(j=0;j<#{x*y};j++)
          ans[j]^=table[i][j];
    for(j=0;j<#{y};printf("\\n"),j++)
      for(i=0;i<#{x};i++)
        printf(i<#{x-1}?"%d ":"%d",ans[i+j*#{x}]);
  }
  return 0;
}
EOM
$stderr.printf("%.3f ms\n",Time.now.to_f-now)
=end
end

lightsout(10,10)

Measured memory_bytes: 2628
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    long n = Long.parseLong(sc.next());
    pw.println((n * n - n) / 2);
  }
}


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

#define ll             long long
#define LL             long long
#define pii            pair<int, int>
#define pll            pair<ll, ll>
#define pil            pair<int, ll>
#define pli            pair<ll, int>
#define vi             vector<int>
#define vl             vector<ll>
#define vii            vector<pii>
#define vll            vector<pll>
#define vil            vector<pil>
#define vli            vector<pli>
#define pb             push_back
#define ppb            pop_back
#define mp             make_pair
#define ff             first
#define ss             second
#define sz(x)          (int)x.size()
#define TN             typename
#define all(v)         v.begin(), v.end()
#define fill(a, b)     memset(a, b, sizeof(a))
#define endl           '\n'

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> T lcm(T a, T b) {return a * (b / gcd(a, b));}
template <TN T> T sqr(T a) {return a * a;}
template <TN T> T cube(T a) {return a * a * a;}
template <TN T> inline void smin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void smax(T &a, T b) {a = a > b ? a : b;}

template <TN T> inline void Int(T &n) {
	n = 0; int f = 1; register int ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
	for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
	n = n * f;
}

#define error(args...) {vector <string> _v = split(#args, ','); err(_v.begin(), args); cout << endl;}
vector <string> split(const string &s, char c) {
	vector <string> v;
	stringstream ss(s); string x;
	while (getline(ss, x, c)) v.emplace_back(x);
	return move(v);
}
void err(vector <string> :: iterator it) {}
template <typename T, typename... Args>
void err(vector <string> :: iterator it, T a, Args... args) {
	cout << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << ", ";
	err(++it, args...);
}

inline int in() {int n; scanf("%d", &n); return n;}
inline ll Lin() {ll n; scanf("%lld", &n); return n;}
inline double Din() {double n; scanf("%lf", &n); return n;}

inline int add(int a, int b, int mod) {a += b; return a >= mod ? a - mod : a;}
inline int sub(int a, int b, int mod) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b, int mod) {return (ll)a * b % mod;}

const int N          = 2e5 + 5;
const ll  Mod        = (ll)1e9 + 7;
const int inf        = (int)2e9;
const ll  Inf        = (ll)1e18;
const int mod        = (int)1e9 + 7;

struct S {
	int w, s, v;
	void read() {
		w = in(), s = in(), v = in();
	}
	bool operator <(const S& b) const {
		return w + s < b.w + b.s;
	}
};

int solve() {
	int n = in();
	vector<S> a(n);
	for (int i = 0; i < n; i++) {
		a[i].read();
	}
	sort(all(a));
	int mx_s = 20123;
	vl dp(mx_s, 0);
	for (S block : a) {
		for (int i = min(block.s, mx_s - block.w); i >= 0; i--) {
			smax(dp[i + block.w], dp[i] + block.v);
		}
	}
	ll ans = 0;
	for (int i = 0; i < mx_s; i++) {
		//error(dp[i]);
		smax(ans, dp[i]);
	}
	printf("%lld\n", ans);
	return 0;
}

int main() {
	int test = 1, tc = 0;
	//scanf("%d", &test);
	while (test--) {
		//printf("Case %d: ", ++tc);
		solve();
	}
	return 0;
}





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

Measured memory_bytes: 128
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
    
        var sc = new Scanner(System.in);
    
        long n = Long.parseLong(sc.next());
        int x = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        
        var a = new long[m+1];
        var set = new HashSet<Long>();
        a[0] = x;
        set.add(a[0]);
        int r = -1;
        for(int i = 1; i <= m; i++){
            a[i] = a[i-1] * a[i-1] % m;
            if(!set.add(a[i])){
                r = i;
                break;
            }
        }
        int l = -1;
        for(int i = 0; i < m; i++){
            if(a[i] == a[r]){
                l = i;
                break;
            }
        }
        
        long ans = 0;
        long b = Math.min(n, l);
        for(int i = 0; i < b; i++){
            ans += a[i];
        }
        long n2 = n - l;
        long c = n2 / (r-l);
        for(int i = l; i < r; i++){
            ans += a[i] * c;
        }
        long d = l + (n2 % (r-l));
        for(int i = l; i < d; i++){
            ans += a[i];
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 41376
#include <iostream>
#include <string>
using namespace std;
int main(void){
  int A,P;
  int ans=0;
  int sum=0;
  cin >>A>>P;
  int a=(A*3+P);
  while(1){a=a-2;
      if(a<0){break;}
      ans=ans+1;
  }
      cout << ans <<endl;
      return 0;
      
      


      
  }

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<pair<int,int> > a(n);
	for(int i=0;i<n;i++)
	{
		int aa;
		cin >> aa;
		a[i]=make_pair(aa,i+1);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++)
		cout << a[i].second << (i==n-1 ? "\n":" ");




}


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

int main() {
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;
  if(b-a<=k&&c-a<=k&&d-a<=k&&e-a<=k) {
    if(c-b<=k&&d-b<=k&&e-b<=k&&d-c<=k&&e-c<=k&&e-d) {
      cout << "Yay!" << endl;
    }
  }
  else {
    cout << ":(" << endl;
  }
}


Measured memory_bytes: 256
use proconio::input;

fn main(){
    input!{
        mut A: String,
        mut B: String
    }
    if A.len()>B.len() {
        print!("GREATER");
    }else if A.len()<B.len(){
        print!("LESS")
    }else{
        if A==B {
            print!("EQUAL");
        }else{
            while A.len()>=0{
                let top_of_A = A.remove(0);
                let top_of_B = B.remove(0);
                if top_of_A>top_of_B{
                    print!("GREATER");
                    break
                }else if top_of_A<top_of_B{
                    print!("LESS");
                    break
                }
            }
        }
    }
}

Measured memory_bytes: 2132
#include <stdio.h>

int main(void)
{
  int n, k;
  scanf("%d %d", &n, &k);
  char s[n + 1];
  scanf("%s", s);
  
  int grp = 1;
  for (int i = 1; i < n; i++){
    if (s[i - 1] != s[i]) grp++;
  }
  
  int sum;
  if (k >= grp / 2) sum = n - 1;
  else sum = n - grp + 2 * k; 
  
  printf("%d", sum);
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
  int x,y,g[]={0,1,2,1,3,1,3,1,1,3,1,3,1};
  scanf("%d%d",&x,&y);
  printf("%s\n",(g[x]==g[y])?"Yes":"No");
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(v) v.begin(), v.end()
#define mem(arr) memset(arr, 0, sizeof(arr))
#define ff first
#define ss second
#define int long long int
const int MOD = 1e9 + 7;
const int INF = 1e18;
const int N = 1e6 + 1;
vector<int> g[N];
vector<int> vis(N);
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tc = 1;
    while(tc--){
        int n, x, t;
        cin >> n >> x >> t;
        cout << (t * ((n + x - 1) / x)) << '\n';
    }
}

Measured memory_bytes: 34572
#include<iostream>

using namespace std;
int main(){
  int n,sum,hit;
  while(1){
  cin >> n;
  sum=0;
  if(n==0)break;
  for(int i=0;i<n/4;i++){
    cin >>hit;
    sum+=hit;

  }
cout << sum <<endl;

}
  

  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
signed main()
{
    int n , a , ans = 0;
    
    cin >> n;
    for(int i=1 ;i<=n ;i++ ){
        cin >> a;
        
        if(i%2 == 1 && a%2 == 1){
            ans ++;
        }
    }
    
    cout << ans << endl;
    
    return (0);
}

Measured memory_bytes: 3524
N = int(input())
ichi = [1,2,3,4,5,6,7,8,9]
ni = [2,4,6,8,10,12,14,16,18]
san = [i for i in range(3, 30, 3)]
yon = [i for i in range(4, 40, 4)]
go = [i for i in range(5, 50, 5)]
roku = [i for i in range(6, 60, 6)]
nana = [i for i in range(7, 70, 7)]
hachi =[i for i in range(8, 80, 8)]
kyu = [i for i in range(9, 90, 9)]

if N in ichi+ni+san+yon+go+roku+nana+hachi+kyu:
    print('Yes')
else:
    print("No")


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

inline int read()
{
	int sum=0,ff=1; char ch=getchar();
	while(!isdigit(ch))
	{
		if(ch=='-') ff=-1;
		ch=getchar();
	}
	while(isdigit(ch))
		sum=sum*10+(ch^48),ch=getchar();
	return sum*ff;
}

int n,m;

int main()
{
	n=read();
	m=read();
	for ( int i=1;i<=m;i++ )
	{
		int x=read();
		n-=x;
	}
	if(n<0) printf("-1\n");
	else printf("%d\n",n);
}

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

void ioinit() { ios::sync_with_stdio(0); cin.tie(0); }

int main() {
  ioinit();
  int R,G,B,N,sum=0;
  cin >> R >> G >> B >> N;
  for(int r = 0; r <= N/R; r++){
    for(int g = 0; g <= (N-R*r)/G; g++){
      if((N-r*R-g*G) % B == 0) sum++;
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(9), 0);
//int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv ./prog.exe") >> 8), 0);
const Int INF = 1e18;
vector<Int> X, Y, P;
Int N, D[30][30], curr, cnt, ans[30];
void recur(int xory, int i) {
    if (i == N && xory == 1) return;
    if (i == N) { recur(1, 0); return; }
    recur(xory, i + 1);
    if (D[i][cnt] != 0) {
        auto& Z = (xory == 0 ? X : Y);
        Int a = 0;
        for (int t = 0; t < N; t++) {
            D[t][cnt + 1] = min(D[t][cnt], abs(Z[i] - Z[t]));
            a += D[t][cnt + 1] * P[t];
        }
        ans[cnt + 1] = min(ans[cnt + 1], a);
        cnt++;
        recur(xory, i + 1);
        cnt--;
    }
}
int main() {
    cin >> N;
    X.resize(N), Y.resize(N), P.resize(N);
    for (int i = 0; i < N; i++) cin >> X[i] >> Y[i] >> P[i];
    for (int i = 0; i < N; i++) {
        D[i][0] = min(abs(X[i]), abs(Y[i]));
        curr += D[i][0] * P[i];
    }
    for (int i = 0; i <= N; i++) {
        ans[i] = INF;
    }
    ans[0] = curr;
    recur(0, 0);
    for (int i = 0; i <= N; i++) {
        cout << (ans[i] == INF ? 0 : ans[i]) << '\n';
    }
    return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define REP(i,n) for(int i=0; i<(n); i++)
#define LL long long;
#define ULL unsigned long long;
using namespace std;

int main() {
	string s;
	char u, v;
	int t = 0;
	cin >> s;

	u = s[0];

	FOR(i, 1, (int)s.size()) {
		v = s[i];
		if(u != v) {
			t++;
			u = v;
		}
	}

	cout << t << endl;
}

Measured memory_bytes: 512
#include<stdio.h>
int selectionSort(int A[],int N);

int main(){
  int A[100];
   int N,i,result;
   
 scanf("%d",&N);
 for(i=0;i<N;i++){
   scanf("%d",&A[i]);
 }
 
   result=selectionSort(A,N);
 
 for(i=0;i<N;i++){
   
  if(i>0)printf(" ");
  printf("%d",A[i]);
  
 }
 printf("\n");
 printf("%d\n",result);
 
 return 0;
}

int selectionSort(int A[],int N){
  int i,j;
  int tench,result=0;
  int minj;
 
 for(i=0;i<N-1;i++){
   
  minj=i;
  
  for(j=i;j<N;j++){
    
    if(A[j]<A[minj]){
      
     minj=j;
    }
    
  }
  tench=A[i];
  
  A[i]=A[minj];
  A[minj]=tench;
  
  if(i!=minj){
    result++; }
 }
 return result;
}



Measured memory_bytes: 2108
// Problem : B - String Palindrome
// Contest : AtCoder Beginner Contest 159
// URL : https://atcoder.jp/contests/abc159/tasks/abc159_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cp-editor)

#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
using mapl = map < ll , ll >;
using mapc = map < char , ll >;
using vectorl = vector < ll >;
using vectors = vector < string >;
const int N = 2e5 + 10;
const ll inf = 1e15 + 42;
#define pb push_back
#define endl "\n"
const ll mod = 1000000007;

ll i=0,j=0,k=0,t=0,n=0;

char x='a',y='a',z='a';
string s="",s1="";

vectorl pr;
void seive(int n){ 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++){ 
        if (prime[p] == true){ 
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
    for (int p=2; p<=n; p++) 
      if (prime[p]) 
          pr.push_back(p);
} 

double log_base(ll x, ll base) {
    return ((log(x)*1.0) / (log(base)*1.0));
}

bool ispal(string s){
	for(i=0;i<s.length();i++){
		if(s[i]!=s[s.length()-1-i])
			return 0;
	}
	return 1;
}

ll power_without_mod(ll a,ll b){
    ll ans=1;
    while(b>0){
        if(b&1){
            ans=ans*a;
        }
        a = a * a;
        b >>= 1;
    }
    return ans;
}

ll power(ll a,ll b){
	a%=mod;
	ll ans=1;
	while(b>0){
		if(b&1){
			ans=ans*a%mod;
		}
		a = a * a%mod;
		b >>= 1;
	}
	return ans;
}
// if mod is prime: calculate x^(n mod (m-1))
// if  is string   find number calculating with mod of (m-1)

//for ex:
// string b = "100000000000000000000000000"; 
  
//     ll remainderB = 0; 
//     ll MOD = 1000000007; 
  
//     // Reduce the number B to a small number 
//     // using Fermat Little 
//     for (int i = 0; i < b.length(); i++) 
//         remainderB = (remainderB * 10 + b[i] - '0') % (MOD - 1); 
  
//     cout << power(a, remainderB, MOD) << endl; 


void solve(){
	string s;
	cin>>s;
	ll flag=0;
	if(s.length()%2!=0){
		if(ispal(s)){
			string s2="",s3="";
			ll a=(s.length()-1)/2;
			ll b=(s.length()+3)/2;
			for(i=0;i<a;i++){
				s2+=s[i];
			}
			for(i=b-1;i<s.length();i++){
				s3+=s[i];
			}
			
			if(ispal(s2) && ispal(s3)){
				flag=1;
			}
		}
	}
	if(flag){
		cout<<"Yes"<<endl;
	}
	else
		cout<<"No"<<endl;
}

int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    // ll t;
    // cin>>t;
    // while(t--){
    	solve();
    // }
    return 0;
}





Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {
    static long[] prefix;
    public static void preCompute(long[] arr){
        prefix = new long[arr.length];
        prefix[0] = arr[0];
        for(int i = 1; i < prefix.length; i++){
            prefix[i] = prefix[i-1] + arr[i];
        }
    }

    public static long queryRange(int i, int j) {
        if(i == 0)
            return prefix[j];

        return prefix[j] - prefix[i-1];
    }

    public static long sum(long[] arr, int i, int j) {
        long sum = 0;
        for(int k = i; k <= j; k++){
            sum += arr[k];
            
        }
        return sum;
    }

    static long solve(long[] arr, int i, int j,long[][] dp){
        if(i== j)
            return 0;
        if(dp[i][j] != -1)
            return dp[i][j];

        long ans = Long.MAX_VALUE;
        
        for(int k = i; k < j; k++){
          ans =  Math.min(ans, solve(arr,i,k,dp) + solve(arr, k+1, j,dp) + queryRange(i,k) + queryRange(k+1,j));
        }

        return  dp[i][j] = ans;
        
    }
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer token;
        int n = Integer.parseInt(br.readLine().trim());
        long[] arr = new long[n];
        token = new StringTokenizer(br.readLine().trim()," ");
        for(int i = 0; i < arr.length; i++){
            arr[i] = Long.parseLong(token.nextToken());
        }
        
        long[][] dp = new long[arr.length][arr.length];
       for(int i = 0; i < dp.length; i++)
           Arrays.fill(dp[i],-1);
        preCompute(arr);
       System.out.println(solve(arr, 0, arr.length-1,dp));
    }
}

Measured memory_bytes: 24600
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<cstring>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
#include<time.h>
#include<cassert>
#include<functional>
#include<numeric>
#include <tuple>

using namespace std;
using ll = long long;
using ld = long double;
#define int long long
#define all(a) (a).begin(),(a).end()
#define EPS (1e-7)
#define fs first
#define sc second
#define xx first
#define yy second.first
#define zz second.second
#define H pair<int, int>
#define P pair<int, pair<int, int>>
#define Q(i,j,k) mkp(i,mkp(j,k))
#define rep(i,n) for(int (i) = 0 ; (i) < (n) ; (i)++)
#define rng(i,s,n) for(int (i) = (s) ; (i) < (n) ; (i)++)
#define req(i,n) for(int (i) = (n) - 1 ; (i) >= 0 ; (i)--)
#define mkp make_pair
#define mem0(x) memset(x,0,sizeof(x))
#define vec vector
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define crdcomp(b) sort(all((b)));(b).erase(unique(all((b))),(b).end())
#define ssp(i,n) (i==n-1?"\n":" ")
#define ctoi(c) (int)(c-'A')
#define itoc(c) (char)(c+'A')
#define pb push_back
#define cauto const auto&
#define itn int
#define pri_que priority_queue
#define pp(x,y) pb(H{x,y})
#define ppp(x,y,z) pb(Q(x,y,z))
const int mod = 1e9 + 7;
const int Mod = 998244353;
const ll inf = 3 * 1e18;
const int Inf = 15 * 1e8;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
ll read() { ll u, k = scanf("%lld", &u); return u; }
string reads() { string s; cin >> s; return s; }
ll gcd(ll i, ll j) { return j ? gcd(j, i % j) : i; }
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
ll bitcount(ll x) {
	int sum = 0; for (int i = 0; i < 60; i++)if ((1ll << i) & x) sum++;
	return sum;
}
const int fn_ = 600000;
ll fact_[fn_], comp_[fn_];
ll comb(ll x, ll y, ll Mod = mod) {
	if (!fact_[0]) {
		fact_[0] = 1; comp_[0] = 1;
		for (int i = 1; i < fn_; i++) {
			fact_[i] = fact_[i - 1] * i % Mod;
			comp_[i] = mod_pow(fact_[i], Mod - 2, Mod);
		}
	}
	if (x < y) return 0;
	return fact_[x] * comp_[x - y] % Mod * comp_[y] % Mod;
}
//---------------------------------------------------------------
int n;
signed main() {
	cin >> n;
	vec<int>a;
	rep(i, n) a.pb(read());
	rep(i, n) a[i] = inf - a[i] - 1;
	vec<int>b(n + 10, inf);
	rep(i, n) {
		int k = ub(all(b), a[i]) - b.begin();
		b[k] = a[i];
	}
	cout << lb(all(b), inf) - b.begin() << endl;
}

Measured memory_bytes: 1908
n = int(input())
l_a = list(map(int, input().split()))
l_b = list(map(int, input().split()))
l_c = list(map(int, input().split()))

s = 0
for i in range(n - 1):
    s += l_b[l_a[i] - 1]
    if l_a[i] + 1 == l_a[i + 1]:
        s += l_c[l_a[i] - 1]
s += l_b[l_a[-1] - 1]

print(s)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Text;

class Program
{
	static void Main(string[] args)
	{
		string[] input = Console.ReadLine().Split(' ');
		int D = int.Parse(input[0]);
		int[] c = new int[26];
		input = Console.ReadLine().Split(' ');
		for(int i=0; i<26; i++) c[i] = int.Parse(input[i]);
		int[][] s = new int[D][];
		for(int i=0; i<D; i++)
		{
			input = Console.ReadLine().Split(' ');
			s[i] = new int[26];
			for(int j=0; j<26; j++) s[i][j] = int.Parse(input[j]);
		}
		int[] t = new int[D];
		int[] last = new int[26];
		for(int i=0; i<26; i++) last[i] = -1;
		int satisfy = 0;
		for(int i=0; i<D; i++)
		{
			int maxS = s[i][0];
			int idx = 0;
			for(int j=1; j<26; j++)
			if(maxS < s[i][j])
			{
				maxS = s[i][j];
				idx = j;
			} 
			t[i] = idx;
			satisfy += s[i][t[i]];
			last[t[i]] = i;
			for(int j=0; j<26; j++)
			{
				satisfy -= c[j] * (i - last[j]);
			}
			Console.WriteLine(t[i]+1);
			//Console.WriteLine(satisfy);
		}
	}
}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
    int n;
    cin >> n;
  	vi p(n);
  	int sum = 0;
  	rep(i,n) {
      	cin >> p[i];
    	sum += p[i];
    }
	sort(all(p));
 	sum -= p[n-1]/2;
	cout << sum << endl;  
  	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.buffer.readline

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

Th = [T - h * 0.006 for h in H]

answer = -1
dif = 10 ** 15
for i, t in enumerate(Th, 1):
    if abs(A - t) < dif:
        answer = i
        dif = abs(A - t)

print(answer)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;



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

  double L;
  cin >> L;
  L /= 3.0;
  cout << std::fixed << std::setprecision(15) << L*L*L << endl;
}

Measured memory_bytes: 256