akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using i64 = long long;

class Dinic {
    using i64 = long long;
    struct Edge {
        int to;
        i64 cap;
        int rev;
        Edge(int t, i64 c, int r) : to(t), cap(c), rev(r) {}
    };

    static constexpr i64 inf = 1000000000000000;
    std::vector<std::deque<Edge>> g;
    std::vector<int> level;
    std::vector<unsigned> iter;
    int size;

    void bfs(int s) {
        for (int i = 0; i < size; i++) level[i] = -1;
        level[s] = 0;

        std::deque<int> q { s };

        while (!q.empty()) {
            auto curr = q.front();
            q.pop_front();
            for (auto & e : g[curr]) {
                if (e.cap > 0 && level[e.to] < 0) {
                    level[e.to] = level[curr] + 1;
                    q.push_back(e.to);
                }
            }
        }
    }

    i64 dfs(int v, int t, i64 f) {
        if (v == t) return f;

        for (unsigned i = 0; i < g[v].size(); i++) {
            iter[v] = i;
            auto &e = g[v][i];

            if (e.cap > 0 && level[v] < level[e.to]) {
                i64 d = dfs(e.to, t, std::min(f, e.cap));
                if (d > 0) {
                    e.cap -= d;
                    g[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }

        return 0;
    }

public:
    explicit Dinic(int s) :
        g(s),
        level(s),
        iter(s),
        size(s) {}

    void add_edge(int from, int to, i64 cap) {
        g[from].emplace_back(to, cap, g[to].size());
        g[to].emplace_back(from, 0, g[from].size() - 1);
    }

    i64 calc(int s, int t) {
        i64 flow = 0;
        while (true) {
            bfs(s);
            if (level[t] < 0) return flow;

            for (auto &el : iter) el = 0;

            i64 f = dfs(s, t, inf);
            while (f > 0) {
                flow += f;
                f = dfs(s, t, inf);
            }
        }
    }
};

int main() {
    int n;
    std::cin >> n;
    int s = n, t = s + 1;
    const i64 inf = std::numeric_limits<i64>::max() / 200;
    Dinic d(n + 2);
    i64 total = 0;
    for (int i = 1; i <= n; i++) {
        i64 in;
        std::cin >> in;
        if (in >= 0) {
            total += in;
            d.add_edge(i - 1, t, in);
        } else {
            d.add_edge(s, i - 1, -in);
        }

        for (int j = 2; j * i <= n; j++) {
            d.add_edge(i - 1, j * i - 1, inf);
        }
    }

    std::cout << total - d.calc(s, t) << std::endl;

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    string s;
    cin >> n >> s;
    if (n % 2 != 0) {
        cout << "No" << endl;
        return;
    }
    REP(i,0,n/2) {
        if (s[i] != s[i + n/2]) {
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}

int main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(x) x.begin(),x.end()
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

int x,n;
vector<int>p;
ll solve(){
   ll ans=0;
   

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

    cin>>x>>n;
    p.resize(n);
    set<int>s;
    rep(i,n){
        cin>>p[i];
        s.insert(p[i]);
    }
    if(s.count(x)==0){
        cout<<x<<endl;
        return 0;
    }
    else{
        int a=x-1,b=x+1;
        while(1){
            if(s.count(a)==0){
                cout<<a<<endl;
                return 0;
            }
            if(s.count(b)==0){
                cout<<b<<endl;
                return 0;
            }
            a--;
            b++;
        }
    }
    return 0;
}

Measured memory_bytes: 3652
a = [None]*3
b = [None]*3

for i in range(3):
    a_,b_ = map(int,input().split())
    a[i] = str(a_)
    b[i] = str(b_)

c = a
c.extend(b)

count = [str(c.count('1')),str(c.count('2')),str(c.count('3')),str(c.count('4'))]

if count.count('1')==2 and count.count('2')==2:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 3064
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;


class Solve
{
  public Solve() { }
  public static int Main()
  {
    new Solve().calc();
    return 0;
  }


  Scanner cin;

  void calc()
  {
    cin = new Scanner();
    string S = cin.next();
    int len = S.Length;
    int halfLen = len / 2;
    bool isParindrome = true;
    

    for (int i=0; i<halfLen; i++)
    {
      if (S[i] != S[len - 1 - i])
      {
        
        isParindrome = false;
        break;
      }
    }

    if (!isParindrome)
    {
      Console.WriteLine("No");
      return;
    }

    string first = S.Substring(0, halfLen);
    string second = S.Substring(halfLen + 1);

    string result = first == second ? "Yes" : "No";

    Console.WriteLine(result);
  }
}
class Modulo
{
  private const int M = 1000000007;
  private readonly int[] m_facs;
  public int Mul(int a, int b)
  {
    return (int)(Math.BigMul(a, b) % M);
  }
  public Modulo(int n)
  {
    m_facs = new int[n + 1];
    m_facs[0] = 1;
    for (int i = 1; i <= n; ++i)
    {
      m_facs[i] = Mul(m_facs[i - 1], i);
    }
  }
  public int Fac(int n)
  {
    return m_facs[n];
  }
  public int Pow(int a, int m)
  {
    switch (m)
    {
      case 0:
        return 1;
      case 1:
        return a;
      default:
        int p1 = Pow(a, m / 2);
        int p2 = Mul(p1, p1);
        return ((m % 2) == 0) ? p2 : Mul(p2, a);
    }
  }
  public int Div(int a, int b)
  {
    return Mul(a, Pow(b, M - 2));
  }
  public int Ncr(int n, int r)
  {
    if (n < r) { return 0; }
    if (n == r) { return 1; }
    int res = Fac(n);
    res = Div(res, Fac(r));
    res = Div(res, Fac(n - r));
    return res;
  }
}

class Scanner
{
  string[] s;
  int i;

  char[] cs = new char[] { ' ' };

  public Scanner()
  {
    s = new string[0];
    i = 0;
  }

  public string next()
  {
    if (i < s.Length) return s[i++];
    string st = Console.ReadLine();
    while (st == "") st = Console.ReadLine();
    s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
    if (s.Length == 0) return next();
    i = 0;
    return s[i++];
  }

  public int nextInt()
  {
    return int.Parse(next());
  }
  public int[] ArrayInt(int N, int add = 0)
  {
    int[] Array = new int[N];
    for (int i = 0; i < N; i++)
    {
      Array[i] = nextInt() + add;
    }
    return Array;
  }

  public long nextLong()
  {
    return long.Parse(next());
  }

  public ulong nextULong()
  {
    return ulong.Parse(next());
  }

  public long[] ArrayLong(int N, long add = 0)
  {
    long[] Array = new long[N];
    for (int i = 0; i < N; i++)
    {
      Array[i] = nextLong() + add;
    }
    return Array;
  }

  public double nextDouble()
  {
    return double.Parse(next());
  }


  public double[] ArrayDouble(int N, double add = 0)
  {
    double[] Array = new double[N];
    for (int i = 0; i < N; i++)
    {
      Array[i] = nextDouble() + add;
    }
    return Array;
  }
}


Measured memory_bytes: 11092
#pragma region GNUC
//以下を参考にした
//https://yukicoder.me/wiki/auto_vectorization
#ifdef __GNUC__
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#endif
#pragma endregion

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>

#include <string>
#include <cstring>
#include <vector>
#include <valarray>
//#include <array>//x C++ (G++ 4.6.4)

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <cassert>//assert();
#include <fstream>
#include <random>
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)

/////////
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#define PII pair<int,int>
/////////
using namespace::std;

// 最大公約数
template<class T>
inline T gcd(T a, T b){return b ? gcd(b, a % b) : a;}
//inline T gcd(T a, T b){return b == 0 ? a : gcd(b, a % b);}

// 最小公倍数
template<class T>
inline T lcm(T a, T b){return a / gcd(a, b) * b;}
//inline T lcm(T a, T b){return a * b / gcd(a, b);}
////////////////////////////////

void solve(){
	string c;
	string boin="aiueo";
	cin >> c;
	for(int i=0;i<(int)boin.size();++i){
		if( c[0] == boin[i] ){
			cout << "vowel" << flush;
			return;
		}
	}
	cout << "consonant" << flush;
}

signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	//std::cout << std::fixed;//小数を10進数表示
	//cout << setprecision(16);//小数点以下の桁数を指定
	
	solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> l4;
//typedef pair<double, double> dd;
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " = " << x << " "

const int N = 2e3+100;
string s[3];
bool work[3][3][N];
bool solve(int i, int j, int k)
{
  for (int ii = 0; ii < s[j].length() && (k+ii) < s[i].length(); ++ii)
    if (s[j][ii] != '?' && s[i][k+ii] != '?' && s[j][ii] != s[i][k+ii])
      return false;
  return true;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  while (cin >> s[0] >> s[1] >> s[2])
    {
      for (int i = 0; i < 3; ++i)
	for (int j = 0; j < 3; ++j)
	  if (i != j)
	    for (int k = 0; k <= s[i].length(); ++k)
	      work[i][j][k] = solve(i, j, k);
      vector<int> perm({0, 1, 2});
      int ans = s[0].length() + s[1].length() + s[2].length();
      do
	{
	  for (int d1 = 0; d1 <= s[perm[0]].length(); ++d1)
	    {
	      if (!work[perm[0]][perm[1]][d1]) continue;
	      for (int d2 = 0; d2 <= max(s[perm[1]].length(), s[perm[0]].length()); ++d2)
		{
		  if (d2 < s[perm[1]].length() && !work[perm[1]][perm[2]][d2]) continue;
		  int d3 = d1+d2;
		  if (d3 < s[perm[0]].length() && !work[perm[0]][perm[2]][d3]) continue;
		  ans = min(ans,
			    max((int) s[perm[0]].length(),
				(int) max(s[perm[1]].length()+d1 ,
					  s[perm[2]].length()+d1+d2
					  )
				)
			    );
		}
	    }
	}
      while (next_permutation(perm.begin(), perm.end()));
      cout << ans << '\n';
      //      printf("%d\n", ans);
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;


typedef long long int lli;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<float, float> ff;
typedef vector<ii> vii; 
typedef vector<ff> vff;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    string s;cin>>s;
    char prev = s[0];
    int ans = 1;
    for (int i = 1; i < n; i++)
    {
        if(s[i]!=prev){
            prev = s[i];
            ans++;
        }
    }
    
    cout<<ans<<endl;
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  
  vector<int> a(N);
  vector<int> xa(N);
  
  for (int i = 0; i < N; i++) {
  	cin >> a.at(i);
    xa.at(i) = a.at(i);
  }
  
  vector<int> rank(N);
  int max;
  int maxN;
  
  for (int i = 0; i < N; i++) {
    max = 0;
  	for (int j = 0; j < N; j++) {
      if (xa.at(j) >= max) {
        max = xa.at(j);
        maxN = j;
      }
    }
    rank.at(i) = maxN;
    xa.at(maxN) = 0;
  }
  
  int alice = 0;
  int bob = 0;
  int turn = 1;
  
  for (int i = 0; i < N; i++) {
  	if (turn == 1) 
      alice += a.at(rank.at(i));
    else 
      bob += a.at(rank.at(i));
    turn *= -1;
   }
  
  cout << alice - bob << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define INT_MAX INT64_MAX
#define INT_MIN INT64_MIN
#define CLK clock_t clk = clock();//Start of main
#define OCLK cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';//End of main
#define MOD 1000000007
/* DEFINE cout */
#define pln cout << "===============================\n"
#define on cout<<"\n"
#define os cout<<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define bitcount __builtin_popcount
/* DEFINE cout */
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);//fastio
using namespace std;
struct hash_pair { // use pair as key in unordered_map<pair<int,int>,int,hash_pair>;
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
bool prime[10000001];
int P=MOD-2;
int factorial[10000001]={0};
int powerFunction(int x,int y){
    int res = 1;
    int p = MOD;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
void sieveFunction(int maxLimit){
    memset(prime, true, sizeof(prime));
    prime[0] = prime[1]=false;
    for(int i=2; maxLimit >= i ; i++){
        if(prime[i]){
            for(int j=2*i ; maxLimit >= j ; j+=i)
                prime[j]=false;
        }
    }
}
void factorialFunction(int maxLimit){
    factorial[0]=1;
    for(int i=1 ; i <= maxLimit ; i++)
        factorial[i]=(factorial[i-1]*i)%MOD;
    return;
}
int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
int fun(int num){
    int ans = 0;
    int temp = 5;
    while(num/temp){
        ans += num/temp;
        temp *= 5;
    }
    return ans;
}
signed main(){
    int n;
    cin >> n;
    //12 10 8 6 4 2
    //6 5 4 3 2 1
    //13 11 9 7 5 3 1
    //25 15 5
    //5 3 1
    //4 2
    if(n % 2 == 0){
        n /= 2;
        cout << fun(n) << endl;
    }else{
        cout << 0 << endl;
    }
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define MAXN 200005
#define REP(temp, init_val, end_val) for (int temp = init_val; temp <= end_val; ++temp)
#define REPR(temp, init_val, end_val) for (int temp = init_val; temp >= end_val; --temp)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> intpair;
int read(){
    int f = 1, x = 0;
    char c = getchar();
    while (c < '0' || c > '9'){if(c == '-') f = -f; c = getchar();}
    while (c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();
    return f * x; 
}
inline int lowbit(int x){
    return x & (-x);
}
inline int modadd(int x, int y){
    return (x + y >= MOD ? x + y - MOD: x + y);
}
inline int sgn(int x){
    return (x < 0 ? -1: (x > 0 ? 1: 0));
}
template<typename T>
T gcd(T a, T b){
    return (!b) ? a: gcd(b, a % b);
}
int poww(int a, int b){
    int res = 1;
    while (b > 0){
        if (b & 1) res = 1ll * res * a % MOD;
        a = 1ll * a * a % MOD, b >>= 1;
    }
    return res;
}
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
const int ddx[] = {-1, -1, -1, 0, 0, 1, 1, 1}, ddy[] = {-1, 0, 1, -1, 1, -1, 0, 1};

/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/

int n, m;
int fa[100005], siz[100005];
int Find(int x){ return x == fa[x] ? x: (fa[x] = Find(fa[x])); }
int Union(int x, int y){
    x = Find(x), y = Find(y);
    if (x == y) return 0;
    if (siz[x] > siz[y]) fa[y] = x, siz[x] += siz[y];
    else fa[x] = y, siz[y] += siz[x];
    return 1;
}
void init(){
    n = read(), m = read();
    REP(i, 1, n) fa[i] = i, siz[i] = 1;
}
void solve(){
    int tot = n;
    REP(i, 1, m){
        int u = read(), v = read();
        tot -= Union(u, v);
    }
    printf("%d\n", tot - 1);
}
int main(){
    int T = 1;
    while (T--){
        init();
        solve();
    }
    return 0;
}

Measured memory_bytes: 4544
import sys

n = int(input())
qq = 0

for i in range(9):
    for j in range(9):
        if (i + 1) * (j + 1) == n:
            print("Yes")
            qq = (i + 1) * (j + 1)
            sys.exit()

if qq == 0:
    print("No")

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

typedef long long ll;
typedef unsigned long long ull;

int main() {
  ll a, b;
  cin >> a >> b;

  if (a+b >= 10) {
    cout << "error" << endl;
  } else {
    cout << a+b << endl;
  }
  
  return 0;
}

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

using namespace std;

vector<int> a[3];

void parse(string str){
	if(str[0]=='*'){
//		star++;
	}else{
		int cnt=str.size()-1;
		int id=str[0]-'a';
		a[id].push_back(cnt);
	}
}

int dif[7];
int val[7];
int L;

bool used[7];

int N,M;

bool dfs(int id){
	if(id==3){
		return true;
	}
	for(int i=0;i<L;i++){
		vector<int> tmp;
		int k=0;
		int x=val[i];
		for(int j=i;j<L;j++){
			if(k==a[id].size()) break;
			if(used[j]) continue;
			if(val[j]==x+a[id][k]){
				tmp.push_back(j);
				k++;
			}
		}
		if(k!=a[id].size()){
			continue;
		}
		for(int j=0;j<tmp.size();j++){
			used[tmp[j]]=true;
		}
		bool flg=dfs(id+1);
		if(flg) return true;
		for(int j=0;j<tmp.size();j++){
			used[tmp[j]]=false;
		}
	}
	return false;
}

bool check(){
	for(int i=0;i+N<L;i++){
		if(val[i]==val[i+N]) return false;
	}
	if(val[L-1]-val[0]>M-1) return false;
	for(int i=0;i<L;i++) used[i]=false;
//	printf("dfs\n");
	bool flg=dfs(0);
	return flg;
}

double C(int n,int r){
	if(r<0||r>n) return 0;
	double res=1;
	for(int i=1;i<=r;i++){
		res*=(n-i+1);
		res/=i;
	}
	return res;
}

double res;

void calc(){
//	printf("calc ");
	val[0]=0;
	for(int i=1;i<L;i++){
		val[i]=val[i-1]+dif[i-1];
	}
//	for(int i=0;i<L;i++) printf("%d ",val[i]);
//	printf("\n");
	bool flg=check();
	if(flg==false) return;
	double all=C(N*M,L);
	double cur=0;
	int cnt=0;
	for(int i=0;i<L-1;i++) if(dif[i]==2) cnt++;
	int sum=0;
	for(int i=0;i<L-1;i++) if(dif[i]!=2) sum+=dif[i];
//	printf("%d %d\n",cnt,sum);
	if(cnt==0){
		cur=M-sum;
	}else{
		for(int i=cnt*2;i<=M-1-sum;i++){
			double ad=C(i-cnt-1,cnt-1);
			ad*=(M-sum-i);
			cur+=ad;
//			printf("+=(%d %d)=%f\n",i-cnt-1,cnt-1,C(i-cnt-1,cnt-1));
		}
	}
	for(int i=0;i<L;i++){
		if(i!=0&&dif[i-1]==0) continue;
		int num=0;
		for(int j=i;j<L;j++){
			if(val[i]==val[j]) num++;
			else break;
		}
		cur*=C(N,num);
	}
//	printf("res+=%f\n",cur/all);
	res+=cur/all;
}

void dfs2(int i){
	if(i==L-1){
		calc();
		return;
	}
	for(int j=0;j<=2;j++){
		dif[i]=j;
		dfs2(i+1);
	}
}

double solve(){
	if(L==1) return 1;
	res=0;
	dfs2(0);
	return res;
}

void init(){
	for(int i=0;i<3;i++) a[i].clear();
}

int main(){
	int T=1;
	while(true){
		init();
		cin>>N>>M>>L;
		if(N==0) break;
		for(int i=0;i<L;i++){
			string str;
			cin>>str;
			parse(str);
		}
		for(int i=0;i<3;i++) sort(a[i].begin(),a[i].end());
//		for(int i=0;i<3;i++){
//			for(int j=0;j<a[i].size();j++) printf("%d ",a[i][j]);
//			printf("\n");
//		}
		double ans=solve();
	//	cout<<setprecision(9)<<ans<<"\n";
	//	printf("case %d %.9f\n",T,ans);
		printf("%.9f\n",ans);
		T++;
//		if(T==2) break;
	}
	return 0;
}

Measured memory_bytes: 1268
n,k=map(int,input().split())
p=list(map(int,input().split()))
maxk=0
count=0
for i in range(k):
  count+=p[i]
if n>k:
  for i in range(k,n):
    count=int(count-p[i-k]+p[i])
    maxk=max(maxk,count)
  maxk=(maxk + k)/2
  print(maxk)
else:
  count=(count + k)/2
  print(count)

Measured memory_bytes: 24804
#include<bits/stdc++.h>
    #define ll long long
    #define f   first
    #define s   second
    #define pb          push_back
    #define mod         1000000007
    #define hell        998244353
    #define inf         1000000000000000000LL
    using namespace std;
    ll n,k,m,l,mx,sum,q,P;
    ll pref[2000005];
    void solve()
    {   ll a,b,x,y,c;
        cin>>n>>P;
        string s;
        cin>>s;
        ll ans=0;
        if(P==5 || P==2)
        {
            for(int i=1;i<=n;i++)
            {
                if((s[i-1]-'0')%P==0)
                    ans+=i;
            }
        }
        else
        {
            map<int,int> hm;
            hm[0]=1;
            ll p=1;
            ll rem=0;
            for(int i=n-1;i>=0;i--)
            {
                rem=((s[i]-'0')*p+rem)%P;
                hm[rem]++;
                p=(p*10)%P;
            }
            for(auto x:hm)
            {
                ll y=x.s;
                ans+=(y*(y-1))/2;
            }
        }
        cout<<ans;
        
           
    }    
    int main()
    {  
        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
        //cout<<primes.size();
        ll t=1;
        //cin>>t;
        while(t--)
            solve();

    }


Measured memory_bytes: 916
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 1012345678;
int A[1006][1006], dp[1006][1006][9];
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	for (int i = 0; i < H; ++i) {
		string S;
		cin >> S;
		for (int j = 0; j < W; ++j) {
			if (S[j] != '.') {
				A[i + 1][j + 1] = S[j] - '0';
			}
		}
	}
	for (int i = 1; i <= H; ++i) {
		for (int j = 1; j <= W; ++j) {
			for (int k = 0; k < 9; ++k) {
				dp[i][j][k] = inf;
			}
		}
	}
	dp[1][1][0] = A[0][0] + A[1][0];
	dp[1][1][1] = A[0][0] + A[0][1];
	for (int i = 1; i <= H; ++i) {
		for (int j = 1; j <= W; ++j) {
			if (j < W) {
				dp[i][j + 1][0] = min(dp[i][j + 1][0], A[i + 1][j + 1] + min({ dp[i][j][1] + A[i - 1][j + 1], dp[i][j][4] + A[i - 1][j + 1], dp[i][j][7] }));
				dp[i][j + 1][1] = min(dp[i][j + 1][1], A[i][j + 2] + min({ dp[i][j][1] + A[i - 1][j + 1], dp[i][j][4] + A[i - 1][j + 1] , dp[i][j][7] }));
				dp[i][j + 1][2] = min(dp[i][j + 1][2], A[i][j + 2] + A[i + 1][j + 1] + min({ dp[i][j][1], dp[i][j][4], dp[i][j][7] }));
				dp[i][j + 1][3] = min(dp[i][j + 1][3], A[i + 1][j + 1] + min({ dp[i][j][0] + A[i][j + 1] + A[i - 1][j + 1], dp[i][j][2] + A[i - 1][j + 1], dp[i][j][3] + A[i][j + 1] + A[i - 1][j + 1], dp[i][j][5] + A[i - 1][j + 1], dp[i][j][6] + A[i][j + 1], dp[i][j][8] }));
				dp[i][j + 1][4] = min(dp[i][j + 1][4], A[i][j + 2] + min({ dp[i][j][0] + A[i][j + 1] + A[i - 1][j + 1], dp[i][j][2] + A[i - 1][j + 1], dp[i][j][3] + A[i][j + 1] + A[i - 1][j + 1], dp[i][j][5] + A[i - 1][j + 1], dp[i][j][6] + A[i][j + 1], dp[i][j][8] }));
				dp[i][j + 1][5] = min(dp[i][j + 1][5], A[i][j + 2] + A[i + 1][j + 1] + min({ dp[i][j][0] + A[i][j + 1] , dp[i][j][2], dp[i][j][3] + A[i][j + 1], dp[i][j][5], dp[i][j][6] + A[i][j + 1], dp[i][j][8] }));
			}
			if (i < H) {
				dp[i + 1][j][0] = min(dp[i + 1][j][0], A[i + 2][j] + min({ dp[i][j][0] + A[i + 1][j - 1], dp[i][j][3], dp[i][j][6] + A[i + 1][j - 1] }));
				dp[i + 1][j][1] = min(dp[i + 1][j][1], A[i + 1][j + 1] + min({ dp[i][j][0] + A[i + 1][j - 1], dp[i][j][3], dp[i][j][6] + A[i + 1][j - 1] }));
				dp[i + 1][j][2] = min(dp[i + 1][j][2], A[i + 2][j] + A[i + 1][j + 1] + min({ dp[i][j][0], dp[i][j][3], dp[i][j][6] }));
				dp[i + 1][j][6] = min(dp[i + 1][j][6], A[i + 2][j] + min({ dp[i][j][1] + A[i + 1][j] + A[i + 1][j - 1], dp[i][j][2] + A[i + 1][j - 1], dp[i][j][4] + A[i + 1][j], dp[i][j][5], dp[i][j][7] + A[i + 1][j] + A[i + 1][j - 1], dp[i][j][8] + A[i + 1][j - 1] }));
				dp[i + 1][j][7] = min(dp[i + 1][j][7], A[i + 1][j + 1] + min({ dp[i][j][1] + A[i + 1][j] + A[i + 1][j - 1], dp[i][j][2] + A[i + 1][j - 1], dp[i][j][4] + A[i + 1][j], dp[i][j][5], dp[i][j][7] + A[i + 1][j] + A[i + 1][j - 1], dp[i][j][8] + A[i + 1][j - 1] }));
				dp[i + 1][j][8] = min(dp[i + 1][j][8], A[i + 2][j] + A[i + 1][j + 1] + min({ dp[i][j][1] + A[i + 1][j], dp[i][j][2], dp[i][j][4] + A[i + 1][j], dp[i][j][5], dp[i][j][7] + A[i + 1][j], dp[i][j][8] }));
			}
		}
	}
	int ans = *min_element(dp[H][W], dp[H][W] + 9);
	cout << ans << endl;
	return 0;
}


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

int main(){
  int n, k;
  cin>>n>>k;
  std::set<int> a;
  for(int i = 0; i < k; i++){
    int d;
    cin>>d;
    for(int j = 0; j < d; j++){
      int x;
      cin>>x;
      a.insert(x);
    }
  }
  cout<<n-a.size();
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vvd= vector<vd>;
using vc= vector<char>;
using vb= vector<bool>;
using vl= vector<ll>;
#define rep(i,x,n) for(int i=x; i<n; i++)
#define all(x) x.begin(), x.end()

int main(){
  ll n,ans=0;
  cin >> n;
  vl a(n+1);
  vl b(n);
  rep(i,0,n+1)cin >> a[i];
  rep(i,0,n)cin >> b[i];

  rep(i,0,n){
    if(a[i]<b[i]){
      ans+= min(a[i+1]+a[i], b[i]);
      a[i+1]= max(0LL, a[i+1]-(b[i]-a[i]));
    }else{
      ans+= b[i];
    }
  }
  cout << ans;
  
  return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <stdbool.h>

int main(void){
    bool bExists = false;
    int data[5], dist;

    scanf("%d", &data[0]);
    scanf("%d", &data[1]);
    scanf("%d", &data[2]);
    scanf("%d", &data[3]);
    scanf("%d", &data[4]);
    scanf("%d", &dist);

    for(int i = 4 ; i >= 0 ; i--)
    {
        for (int j = 0 ; j < 5 ; j++)
        {
            if( i == j ) continue;
            if( j > i) continue;
            if( data[i] - data[j] > dist )
            {
                bExists = true;
            }
        }
    }

    if(bExists)
    {
        printf(":(");
    }
    else
    {
        printf("Yay!");
    }
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;
public class Main {
   public static void main(String[] args) {
      Scanner sc=new Scanner(System.in);
      int a=sc.nextInt();
      int b=sc.nextInt();
      int area=a*b;
      int peri=(a+b)*2;
      System.out.println(area+" "+peri);
   }
}


Measured memory_bytes: 26196
#include "bits/stdc++.h"
using namespace std;

int main()
{
	int n, x, mi, ans;
	cin >> n >> x;
	vector<int> v;
	v.push_back(x);
	mi = x;
	for (int i = 0; i < n; i++)
	{
		int ii;
		cin >> ii;
		v.push_back(ii);
		mi = min(mi, ii);
	}
	for (int i = 0; i < n; i++)
	{
		v[i] -= mi;
		if (v[i] == 0)
		{
			v.erase(v.begin() + i);
			i--;
		}
	}
	ans = v[0];
	for (int i = 1; i < n; i++)
	{
		ans = __gcd(ans, v[i]);
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

#define PI 3.14159265
#define int long long
#define pb push_back
//#define mp make_pair
#define smax(x , y) x = max(x , y)
#define smin(x , y) x = min(x , y)

const int maxn = 1e5+10;

map<int , bool> mp;
int ans;

main(){
	int n; cin >> n;
	while(n--){
		int x; cin >> x;
		if(mp[x] == true){
			mp[x] = false;
			ans--;
		}
		else{
			mp[x] = true;
			ans++;
		}
	}
	return cout << ans << endl , 0;
}  

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

using namespace std;

int main()
{
	string a,b,c;
	cin >> a >> b >> c;
	int sizeA=a.length(),sizeB=b.length(),sizeC=c.length();
	if (a[sizeA-1]==b[0] && b[sizeB-1]==c[0])
		cout << "YES";
	else cout << "NO";

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,  ll>;

const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    ll g = GCD(a, b);
    return a / g * b;
}

int main(){
	ll n; cin >> n;
	vector<ll> t(n), a(n);
	for(int i = 0; i < n; ++i){
		cin >> t[i] >> a[i];
    }
    ll l=1, r=1;
    for(int i = 0; i < n; ++i){
      ll j1=l/t[i];
      if(l% t[i]!=0)++j1;
     ll j2 = r/a[i];
     if(r%a[i]!=0){++j2;}
     ll j =max(j1, j2);
      {l=t[i]*j;r=a[i]*j;}
      // cout << l <<" " << r << endl;
    }
    cout << l+r << endl;
}

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

unsigned long Return4to3(unsigned long a,unsigned long b,unsigned long c,unsigned long d){
  return (a*b*c + a*b*d + a*c*d + b*c*d);
}

unsigned long Return5to3(unsigned long a,unsigned long b ,unsigned long c,unsigned long d,unsigned long e){
  return (a*b*c + a*b*d + a*b*e +  a*c*d + a*c*e + a*d*e + b*c*d + b*c*e + b*d*e + c*d*e);
}

int main(void){
  int N,i=0;
  scanf("%d",&N);
  char s[10];
  unsigned long mi=0,ai=0,ri=0,ci=0,hi=0;
  int m=0,a=0,r=0,c=0,h=0;
  //s = (char *)malloc((N+1) * sizeof(char));
  for(i = 0; i < N; i++) {
    scanf(" %s", &s);
    if(s[0] == 'M'){
      mi++;
      m=1;
    }
    if(s[0] == 'A'){
      ai++;
      a=1;
    }
    if(s[0] == 'R'){
      ri++;
      r=1;
    }
    if(s[0] == 'C'){
      ci++;
      c=1;
    }
    if(s[0] == 'H'){
      hi++;
      h=1;
    }
  }
  if(m+a+r+c+h < 3){
    printf("0\n");
    fflush(stdout);
  }else if(m+a+r+c+h == 3){
    if(m*a*r == 1){
      printf("%lu\n", mi*ai*ri);
      fflush(stdout);
    }else if(m*a*c == 1){
      printf("%lu\n", mi*ai*ci);
      fflush(stdout);
    }else if(m*a*h == 1){
      printf("%lu\n", mi*ai*hi);
      fflush(stdout);
    }else if(m*r*c == 1){
      printf("%lu\n", mi*ci*ri);
      fflush(stdout);
    }else if(m*r*h == 1){
      printf("%lu\n", mi*hi*ri);
      fflush(stdout);
    }else if(m*c*h == 1){
      printf("%lu\n", mi*ci*hi);
      fflush(stdout);
    }else if(a*r*c == 1){
      printf("%lu\n", ci*ai*ri);
      fflush(stdout);
    }else if(a*r*h == 1){
      printf("%lu\n", hi*ai*ri);
      fflush(stdout);
    }else if(a*c*h == 1){
      printf("%lu\n", ci*ai*hi);
      fflush(stdout);
    }else if(r*c*h == 1){
      printf("%lu\n", ri*ci*hi);
      fflush(stdout);
    }
  }else if(m+a+r+c+h == 4){
    if(m*a*r*c==1){
      printf("%lu\n",Return4to3(mi,ai,ri,ci));
      fflush(stdout);
    }else if(m*a*r*h==1){
      printf("%lu\n",Return4to3(mi,ai,ri,hi));
      fflush(stdout);
    }else if(m*a*c*h==1){
      printf("%lu\n",Return4to3(mi,ai,ci,hi));
      fflush(stdout);
    }else if(m*r*c*h==1){
      printf("%lu\n",Return4to3(mi,ci,ri,hi));
      fflush(stdout);
    }else if(a*r*c*h==1){
      printf("%lu\n",Return4to3(ci,ai,ri,hi));
      fflush(stdout);
    }
  }else if(m+a+r+c+h == 5){
    printf("%lu\n",Return5to3(mi,ai,ri,ci,hi));
    fflush(stdout);
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <map>
using namespace std;
int main() {
  int s;
  cin >> s;
  int i = 1;
  map<int,int> m;
  while (1) {
    if (m[s] != 0) {
      cout << i << endl;
      break;
    }
    m[s] = i;
    if (s % 2 == 0) {
      s /= 2;
    } else {
      s = 3 * s + 1;
    }
    i++;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
#define int long long
#define str string
#define rep(i,j) for(int i=0;i<(int)(j);i++)
typedef long long ll;
typedef long double ld;
const long long inf = 4523372036854775807;
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct S {//辺の情報を入れる変数
	int from, to, cost;
};
struct H {
	int x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(ld a, ld b, ld c, ld d) {
	return sqrt(pow(a - c, 2) + pow(b - d, 2));
}//rad＝座標上の2点間の距離
int ari(int a, int b, int c) {
	return (a + b)*c / 2;
}//等差数列の和
bool suf(ld a, ld b, ld c, ld d) {
	if (b <= c || d <= a) return 0;
	return 1;
}//[a,b),[c,d)
int fact(int i) {
	int sum = 1;
	for (int j = 2; j <= i; j++)
		sum *= j;
	return sum;
}//階乗(正）
 //---------------------------------------------------
 //+++++++++++++++++++++++++++++++++++++++++++++++++++
int n, k, s;
int a[200000], b[200000];
signed main() {
	cin >> n >> k;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n;) {
		int j = i;
		while (j < n&&a[i] == a[j]) {
			j++;
		}
		b[s++] = j - i;
		i = j;
	}
	sort(b, b + s);
	int sum = 0;
	for (int i = 0; i < s-k; i++) {
		sum += b[i];
	}
	cout << sum << endl;
	getchar(); getchar();
}

Measured memory_bytes: 3328
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={-1,-1,-1,0,0,1,1,1};
vl dy={1,-1,0,1,-1,1,0,-1};
int main(){
  ll n,q;cin>>n>>q;
  string s;cin>>s;
  vl count(n);
  count[0]=0;
  for(ll i=1;i<n;i++){
    if(s[i]=='C'&&s[i-1]=='A')count[i]=count[i-1]+1;
    else count[i]=count[i-1];
  }
  rep(i,q){
    ll l,r;cin>>l>>r;
    //if(l-2<0)cout<<count[r-1]<<endl;
     cout<<count[r-1]-count[l-1]<<endl;

  }
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <cstdlib> // abs(x-y)
#include <iomanip> // 出力の桁数指定
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
  string s;
  cin >> s;
  int a = 0;
  int z = 0;

  rep (i, 0, s.size()) {
    if (s.at(i) == 'A') {
      a = i;
      break;
    }
  }
  for (int j = s.size() -1; j > 0; j--) {
    if (s.at(j) == 'Z') {
      z = j;
      break;
    }
  }
  cout << z - a + 1 << endl;
}


Measured memory_bytes: 640
#include "bits/stdc++.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define int ll
typedef pair<int,int> pii;
#define fi first
#define se second
#define Sort(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/4
#define INTINF INT_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
template<class T> inline bool chmax(T &a, T b){if(a < b){a = b;return true;}return false;}
template<class T> inline bool chmin(T &a, T b){if(a > b){a = b;return true;}return false;}
/*----------------------------------------------------------------*/
// const int MOD = 998244353;
const int MOD = 1000000007;


/*----------------------------------------------------------------*/
signed main(){


	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;

	vector<pii> p;

	p.push_back(pii(1,0));
	pii now = pii(0,0);
	for(auto c:s){
		if(now.fi == c-'0'){
			now.se++;
		}else{
			p.push_back(now);
			now = pii(c-'0',1);
		}
	}
	p.push_back(now);
	if(now.fi == 0)p.push_back(pii(1,0));
	// for(auto x:p)cerr << x.fi << " , " << x.se << endl;
	
	if(p.size() <= 2*k+1){
		cout << s.size() << endl;
		return 0;
	}


	int cnt = 0;
	rep(i,2*k+1){
		cnt += p[i].se;
	}
	int maxi = cnt;
	int i = 0;
	while(2*k + 2*(i+1) < p.size()){
		cnt -= p[2*i].se;
		cnt -= p[2*i+1].se;
		cnt += p[2*k + 1 + 2*i].se;
		cnt += p[2*k + 2 + 2*i].se;
		chmax(maxi,cnt);
		i++;
	}
	cout << maxi << endl;


	
	return 0;
}
/*----------------------------------------------------------------*/

// g++ -std=gnu++17 code1.cpp
// sudo pip3 install --upgrade online-judge-tools
// rm -r -f test;oj dl https://code-festival-2017-qualb.contest.atcoder.jp/tasks/code_festival_2017_qualb_b
// rm -r -f test;oj dl https://abc124.contest.atcoder.jp/tasks/abc124_d

Measured memory_bytes: 5380
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;


int main()
{	
	int n,m;
	ll a,sum=0;
	priority_queue<int>q;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		q.push(a);
	}
	for(int i=0;i<m;i++)
	{
		int k=q.top();
		k/=2;
		q.pop();
		q.push(k);
	}
	for(int i=0;i<n;i++)
	{	
		sum+=q.top();
		q.pop();
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 892
#include <iostream>

void swap(int *x,int *y){
    int temp;
    temp = *x;
    *x = *y;
    *y = temp;
}

int main(int argc, char const *argv[]) {
  int a=0,b=0,c=0;
  std::cin >> a >> b >> c;
  if(a > b){
    swap(&a,&b);
  }
  if(b > c){
    swap(&b,&c);
  }
  if(a > b){
    swap(&a,&b);
  }
  std::cout << a << " " << b << " " << c << std::endl;
  return 0;
}

Measured memory_bytes: 3084
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
const int MAXN = 1001000;
const int MOD = 1000000007;
const long long INF = 20000000000L;

long long sum[MAXN];

int main()
{
	long long n, a;
	memset(sum, 0, sizeof(sum));

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

	long long ans = INF;
	for (int i = 1; i < n; ++i)
		ans = min(ans, abs(sum[n] - sum[i] - sum[i]));
	cout << ans << endl;

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

Measured memory_bytes: 8064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC161
{
    class Program
    {
        static void Main(string[] args)
        {
            a();
        }

        public static void a()
        {
            int[] abc = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int a = abc[2], b = abc[0], c = abc[1];
            Console.WriteLine("{0} {1} {2}", a, b, c);
        }
    }
}


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

int main() {
   long long a, b, c, d, e, f, g;
   cin >> a >> b >> c >> d >> e >> f >> g;
   cout << b + max( a/2*2 + d/2*2 + e/2*2 + 3 * (a%2 && d%2 && e%2),  3 * (a>0 && d>0 && e>0) + (a-1)/2*2 + (d-1)/2*2 + (e-1)/2*2 );
}


Measured memory_bytes: 256
#include<stdio.h>

char str[21];
char az[21];
char*sp,*azp;
short i;

int main(void){
scanf("%s",str);
sp = str;
azp = az;
while(*sp){
if(i){
if(*sp == 'Z'){
	i = 0;
	*azp = 'A';
	azp++;
	*azp = 'Z';
	azp++;
}
}else
if(*sp == 'A')i = 1;
sp++;
}
if(*az)printf("%s\n",az);
else printf("-1\n");
return 0;
}

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

using namespace std;

int f(int n, int m) {
    if (m == 0) return 1;
    int res = f(n, m/2);
    res = (long long) res * res % 1000000007;
    if (m & 1) res = (long long) res * n % 1000000007;
    return res;
}

int main() {
    int n, m;
    cin >> n >> m;
    cout << f(n, m) << endl;
}


Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
int a,b,c,x,i,j,k,ans=0;
int A[51][51][51];
int main(){
	cin>>a>>b>>c>>x;
	for(i=0;i<=a;i++){
		for(j=0;j<=b;j++){
			for(k=0;k<=c;k++){
				A[i][j][k]=500*i+100*j+50*k;
				if(A[i][j][k]==x){
				ans++;
			}
			}
		}
	}
	cout<<ans;
	return 0;
}

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

using namespace std;

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

  int sum = 0, l, r;
  for (int i = 0; i < N; i++) {
    cin >> l >> r;
    sum += (r - l + 1);
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=sum(B)
old=-2
for a in A:
    if a==old+1:
        ans+=C[old-1]
    old=a
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    long long int N, M, x;
	cin >> N >> M;
	vector <long long int> A(N + 1, 0);
	vector <long long int> B(N + 1, 0);
	for (int i = 0; i < M; i++) {
		cin >> x;
		A[x] = 1;
	}

	int j = 0; 
	for (int i = 0; i <= N; i++) {
		if (i == 0) {
			B[i] = 1;
		}
		else if (i == 1) {
			if (A[i] == 1) {
				B[i] = 0;
				j++;
			}
			else {
				B[i] = 1;
			}
		}
		else {
			if (A[i] == 1) {
				B[i] = 0;
				j++;
				if (j >= M) j = M - 1;
			}
			else {
				B[i] += B[i - 1];
				B[i] %= 1000000007;
			    B[i] += B[i - 2];
				B[i] %= 1000000007;
			}
			
		}
	}
	cout << B[N] << endl;
	return 0;
}



Measured memory_bytes: 1792
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cassert>
using namespace std;
const int Maxn = 10010;
struct Road
{
	int x, y, v;
	bool operator < (const Road &e) const
	{
		return v > e.v;
	}
}road[Maxn];
int n, m, k;
int root[Maxn];
int getRoot(int x)
{
	int ret = x;
	while (root[ret] != -1) ret = root[ret];
	while (x != ret)
	{
		int tx = root[x];
		root[x] = ret;
		x = tx;
	}
	return ret;
}
bool flag[Maxn];
vector<int> vec;
void kruskal()
{
	memset(root, -1, sizeof(root));
	vec.clear();
	for (int i = 0; i < n - 1; ++i)
	{
		int x = getRoot(road[i].x), y = getRoot(road[i].y);
		assert(x != y);
		//cout << x <<" " << y << " " << road[i].v <<" " << flag[x] <<" " << flag[y]<<endl;
		if (flag[x] && flag[y]) vec.push_back(road[i].v), root[x] = y;
		else if(flag[x]) root[y] = x;
		else if(flag[y]) root[x] = y;
		else root[x] = y;
	}
}
int main()
{
	int cas = 1;
	while (scanf("%d%d%d", &n, &m, &k) != EOF)
	{
		if (n == 0) break;
		printf("Case %d: ", cas++);
		for (int i = 0; i + 1 < n; ++i)
			scanf("%d%d%d", &road[i].x, &road[i].y, &road[i].v);
		sort(road, road + n - 1);
		memset(flag, 0, sizeof(flag));
		for (int i = 0; i < m; ++i)
		{
			int x;
			scanf("%d", &x);
			flag[x] = 1;
		}
		kruskal();
		int ans = 0;
		assert(vec.size() >= k); 
		for (int i = 1; i <= k; ++i)
			ans += vec[vec.size() - i];
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1484
#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
#include<string>
#define rep(i,n) for (int i=0; i<n; i++)
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> W(N);
  int sum = 0;
  rep(i,N) {
    cin >> W[i];
    sum += W[i];
  }
  
  int ans = 1000;
  for (int i=1; i<N-1; i++) {
    int s1 = 0;
    int s2 = 0;
    for (int j=0; j<=i; j++) {
      s1 += W[j];
    }
    ans = min(ans,abs(sum-s1*2));
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string disp(bool x){
    return x ? "AC" : "WA";
}

int main(){
    string s; cin >> s;
    
    bool ans = true;
    if(s[0] != 'A') ans = false;

    int ct = 0;
    rep(i,s.size()){
        
        if(s[i] == 'C'){
            if(i == 1 or i == s.size()-1) ans = false;
            ct++;
            if(ct>1) ans = false;
        }
    }
    if(ct == 0) ans = false;
    
    Rep(i,1,s.size()){
        string alph = "ABDEFGHIJKLMNNOPQRSTUVWXYZ";
        rep(j,25){
            if(s[i] == alph[j]) ans = false;
        }
    }
    
    cout << disp(ans) << endl;
}
    
    






Measured memory_bytes: 256
#include<iostream>
#include <bits/stdc++.h>
#include<algorithm>
#include <cstring>
#define endl "\n"
#define SRK ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define EPS 1e-6
typedef long long ll;
using namespace std;


int main()
{
    SRK;
    int n,x,t;
    cin >> n >> x >> t;
    if (n % x == 0)
    {
        cout << (n/x) * t << endl;
    }
    else
    {
        cout << ((n/x)+1) * t << endl;
    }
}


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

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

typedef long long ll;
int main(int argc, char const *argv[])
{
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int N, M; cin >> N >> M;
    string res = "No";
    if (N == M) res = "Yes";
    cout << res << endl; 
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    ll ans = 0;
    rep(i, n - 1) ans += (i + 1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
package main
 
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
 
func main() {
	scanner := bufio.NewScanner(os.Stdin)
	const initialBufSize = 4096
	const maxBufSize = 1000000
	scanner.Buffer(make([]byte, initialBufSize), maxBufSize)
	scanner.Split(bufio.ScanWords)
	var K int64
	scanner.Scan()
	K, _ = strconv.ParseInt(scanner.Text(), 10, 64)
	fmt.Println(solve(K))
}
func solve(K int64) int {
	sum := 0
	for a := 1; a <= int(K); a++ {
		for b := 1; b <= int(K); b++ {
			for c := 1; c <= int(K); c++ {
				sum += gcd(gcd(a, b), c)
			}
		}
	}
	return sum
}
func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

Measured memory_bytes: 1776
#include <stdio.h>

int total[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};

int Sum(int x) {
  int i, sum = 0;

  if(x < 0) {
    return 0;
  }

  for(i = 0; i < x; i ++) {
    sum += total[i];
  }

  return sum;
}

int main() {
  int month, day;
  while(scanf("%d %d", &month, &day)) {
    if(month == 0) {
      break;
    }

    switch((Sum(month - 1) + day)%7) {
      case 0:
        printf("Wednesday\n");
        break;

      case 1:
        printf("Thursday\n");
        break;

      case 2:
        printf("Friday\n");
        break;

      case 3:
        printf("Saturday\n");
        break;

      case 4:
        printf("Sunday\n");
        break;

      case 5:
        printf("Monday\n");
        break;

      case 6:
        printf("Tuesday\n");
        break;
    }
  }

  return 0;
}

Measured memory_bytes: 0