akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (n, m) = scan!(usize, usize);

    println!(
        "{}",
        if m > 2 * n {
            n + (m - 2 * n) / 4
        } else {
            m / 2
        }
    );
}


Measured memory_bytes: 4352
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>

#define ll long long
#define repeat(i, x) for(register ll i = 0; i < x; i++)

using namespace std;

int main()
{
  int N; cin >> N;
  vector<int> P(N);
  vector<int> Q(N);
  vector<int> length(N);
  int a = 0;
  int b = 0;

  for (register int i = 0; i < N; i++) {
    cin >> P[i];
    length[i] = i+1;
  }
  for (register int i = 0; i < N; i++) {
    cin >> Q[i];
  }

  int count = 0;

  do {
    count++;
    if(length == P) {
      a = count;
    }

    if (length == Q) {
      b = count;
    }

  } while(next_permutation(length.begin(), length.end()) && (a==0 || b==0));

  cout << abs(a - b) << endl;
}

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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<LL> PQ_DESC;
typedef priority_queue<LL, VL, greater<LL>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;
typedef priority_queue<VL> PQ_DESC_VL;
typedef priority_queue<VL, vector<VL>, greater<VL>> PQ_ASC_VL;
typedef priority_queue<PLL> PQ_DESC_PLL;
typedef priority_queue<PLL, vector<PLL>, greater<PLL>> PQ_ASC_PLL;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF*(LL)INF;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

void Main()
{
    int n;cin>>n;
    VL a(n);
    REP(i,n){
        cin>>a[i];
    }

    VL x(n);
    REP(i,n-1){
        if(a[i] == a[i+1]){
            x[i]=0;
        }
        if(a[i] < a[i+1]){
            x[i]=1;
        }
        if(a[i] > a[i+1]){
            x[i]=2;
        }
    }

    LL m = 1000;
    LL s = 0;
    REP(i,n-1){
        if(x[i]==1){
            LL kai=m/a[i];
            s+=kai;
            m-=kai*a[i];
        }
        if(x[i]==2){
            m+=s*a[i];
            s=0;
        }

    }
    if(s>0){
        m += s*a[n-1];
    }
    cout<<m<<endl;
    
	return;
}

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

Measured memory_bytes: 3668
import sys
def input(): return sys.stdin.readline().rstrip()

def max(a, b):
    if a >= b:
        return a
    else:
        return b

def main():
    n = int(input())
    h = map(int, input().split())

    ans, bef, cnt = 0, 0, 0

    for i in h:
        if i <= bef:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
        bef = i
    print(max(ans, cnt))

if __name__ == '__main__':
    main()


Measured memory_bytes: 11484
import java.io.*;
import java.util.Arrays;
class Main{
	public static void main(String[] args) throws IOException {
		int i,cnt=0;
		int[] n = new int[5];
		String[] str = new String[5];
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		str = in.readLine().split(" ");
		for(i=0;i<3;i++){
			n[i]=Integer.parseInt(str[i]);
		}
		for(i=n[0];i<=n[1];i++){
			cnt+=(n[2]%i==0 ? 1 : 0);
		}
		System.out.println(cnt);
	}
}

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

int main() {
  string S;
  cin >> S;
  int count = 0;
  for (int i = 0; i < S.size(); i++) {
    if (i % 2 == 0) {
      if (S.at(i) == '1') {
        count++;
      }
    }
    else {
      if (S.at(i) == '0') {
        count++;
      }
    }
  }
  if (count < S.size() - count) {
    cout << count << endl;
  }
  else {
    cout << S.size() - count << endl;
  }
}

Measured memory_bytes: 512
#include<iostream>
#define int long long
using namespace std;
const int N=2e5+2;
const int inf=3e18+2;
int ar[N],sum[N];
signed main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n,i,j,k,l,x,ans,cur,now;
  cin>>n>>x;
  ans=inf;
  //cout<<ans<<endl;
  for(i=1;i<=n;i++){
    cin>>ar[i];
    sum[i]=sum[i-1]+ar[i];
  }
  bool cac=true;
  for(i=1;i<=(n+1)/2;i++){
    j=n;
    cur=x*n+i*x;
    cac=true;
    now=7;
    while(j){
      if(cac){
        k=max(j-2*i,0ll);
        if(cur+5*(sum[j]-sum[k])<=inf){
          cur+=5*(sum[j]-sum[k]);
          j=k;
          cac=false;
        }
        else{
          cac=true;
          break;
        }
      }
      else{
        k=max(j-i,0ll);
        if(cur+now*(sum[j]-sum[k])<=inf){
          cur+=now*(sum[j]-sum[k]);
          j=k;
          cac=false;
          now+=2;
        }
        else{
          cac=true;
          break;
        }
      }
    }
    //cout<<i<<' '<<cur<<' ';
    if(!cac){
      ans=min(ans,cur);
    }
  }
  cout<<ans;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
const int MAX = 100005;
const ll MOD = 1000000007;

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

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

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n,k;
	cin >> n >> k;
	vector<int> a(n);
	REP(i,n) cin >> a[i];
	sort(ALL(a));
	COMinit();
	ll max_sum = 0;
	FOR(i,k-1,n){
		max_sum += a[i] * COM(i,k-1) % MOD;
	}
	reverse(ALL(a));
	ll min_sum = 0;
	FOR(i,k-1,n){
		min_sum += a[i] * COM(i,k-1) % MOD;
	}
	cout << (max_sum - min_sum) % MOD << '\n';
	return 0;
}



Measured memory_bytes: 2944
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
x  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

for a in range(-500, 500):
    for b in range(-500, 500):
        if (a ** 5) - (b **5) == x:
            print(a, b)
            exit()
"""
for a in range(1, 10**9):
    b = abs((a**5 - x)**(1/5))
    #print(a, b, (b.is_integer()))

    if b.is_integer():
        b = int(b)
        if (a ** 5) - (-b ** 5) == x:
            print(a, -b)
        else:
            print(-a, b)

        break
"""


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

int main() {
    int N; cin >> N;
    vector<int> A(N);
    for(auto &in : A) cin >> in;
    multiset<int> ms;
    for(int i = N - 1; i >= 0; --i) {
        auto it = ms.upper_bound(A[i]);
        if(it != ms.end()) ms.erase(it);
        ms.insert(A[i]);
    }
    cout << ms.size() << '\n';
    return 0;
}


Measured memory_bytes: 5376
#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int N;
    cin >> N;
    int i;
    int h[100005] = {};
    int dp[100005] = {};
    for(i = 0; i < N; i++){
        cin >> h[i];
    }
    for(i = 1; i <= N; i++){
        dp[i] = dp[i-1] + abs(h[i] - h[i-1]);
        if(i >= 2){
            dp[i] = min(dp[i], dp[i - 2]+ abs(h[i] - h[i-2]));
        }
    }
    cout << dp[N-1];
}


Measured memory_bytes: 1532
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <iomanip>
#include <unordered_set>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vll> vvll;
typedef map<int,int> mii;
typedef set<int> si;
#define rep(i,n) for(ll i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define arep(i,v) for(auto i : v)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define fi first
#define se second
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template <class T> inline void dump(T &v){irep(i, v){cout<<*i<<((i==--v.end())?'\n':' ');}}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
constexpr ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
constexpr ld EPS = 1e-11;


int main() {
    
    int n;
    cin>>n;
    set<int> s;
    rep(i,n){
        int a;
        cin>>a;
        s.insert(a);
    }
    int m;
    cin>>m;
    rep(i,m){
        int a;
        cin>>a;
        s.insert(a);
    }
    irep(i,s){
        fin(*i);
    }
}


Measured memory_bytes: 21752
# vim: set fileencoding=utf-8:
import sys
import collections
INF = 10000000
queue = collections.deque()  # appendleft(), pop()
n = int(input())
graph = [[0] * (n+1) for _ in range(n+1)]
yet = [i for i in range(1, n+1)]
ans = [-1] * (n+1)
for i in range(1, n+1):
    tmp = [int(ele) for ele in input().split()]
    for adjc in tmp[2:]:
        graph[i][adjc] = 1

d = [INF] * (n+1)
d[1] = 0


def main():
    global queue, d
    queue.appendleft(1)
    bfs(queue)
    d = list(map(lambda x: -1 if x == INF else x, d))
    for i in range(1, n+1):
        print(str(i) + " " + str(d[i]))


def bfs(queue):
    global graph, yet
    if len(queue) == 0:
        return

    n = queue[-1]
    yet.remove(n)

    # 各ノードとの隣接状態をみていく
    for i, adjacency in enumerate(graph[n]):
        if adjacency == 1 and i in yet and i not in queue:  # 隣接 かつ 未探索 かつ queueにもない 待ち行列に加える
            queue.appendleft(i)
            # 隣接していれば、自分自身までの最短コストに1を加えたものとの min() を計算する
            d[i] = min(d[i], d[n] + 1)
    else:
        queue.pop()
        bfs(queue)


if __name__ == "__main__":
    main()



Measured memory_bytes: 6100
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
map<P,ll> mp;
const ll MAX = 2000010;//設定して

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

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;//＊１
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}
//階乗
long long factor(ll n,ll k){
  if (n<k) return 0;
  if (n<0 || k<0) return 0;
  return (fac[n]*finv[k])%mod;
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
//aの逆元求めるならn=mod-2
long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(){
   int x,y;
   cin>>x>>y;
   COMinit();     
   ll n=2*y-x,m=2*x-y;
   if(n<0||m<0||n%3!=0||m%3!=0)cout<<0<<endl;
   else cout<<COM((n+m)/3,n/3)%mod<<endl;
}



Measured memory_bytes: 47232
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// const ll INF = 1LL <<60;
// const int INF = 10000;

//最大公約数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

const int MAX = 510000;
const int MOD = 1000000007;

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

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

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


//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}

long long modpow(long long res,long long a, long long n, long long mod) {
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
// ここから開始
int main(){
  string s;
  cin>>s;
  ll sum = 0;
  ll ans = 0;
  for(int i = 0; i < s.length(); i++){
    if(s[i]=='B') sum++;
    else if(s[i]=='W') ans+=sum;
  }
  cout<<ans<<endl;
  return 0;
}



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

using namespace std;

#define int long long

void solve()
{
	int a, b;
	cin >> a >> b;
	
	cout << a * b / __gcd(a, b);
}

main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t = 1;
//	cin >> t;

	while(t--)
	{
		solve();
	}
}

Measured memory_bytes: 256
// #define STOPIT
#include <bits/stdc++.h>
#define loop(n) for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

/*
v1 = p1 - p0, v2 = p2 - p0 とします。
det(v1,v2) が正なら半時計、負なら時計回りです。
0 なら、内積 v1*v2 をチェックです。
それが負ならバック、0 以上 v1*v1 以下ならオン、それ以外はフロントです。
*/

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int x0, y0, x1, y1;
  std::cin >> x0 >> y0 >> x1 >> y1;
  auto v1 = std::make_pair(x1-x0, y1-y0);

  auto det = [&] (auto&& p, auto&& q) {
    int a,b,c,d;
    std::tie(a,b) = p;
    std::tie(c,d) = q;
    return a*d - b*c;
  };

  auto inp = [&] (auto&& p, auto&& q) {
    int a,b,c,d;
    std::tie(a,b) = p;
    std::tie(c,d) = q;
    return a*c + b*d;
  };

  int L = inp(v1,v1);

  int q; std::cin >> q;
  loop(q) {
    int x2, y2; std::cin >> x2 >> y2;
    std::pair<int,int> v2{ x2-x0, y2-y0 };
    int d = det(v1,v2);
    if (0 < d) {
      std::cout << "COUNTER_CLOCKWISE" << std::endl;
    } else if (d < 0) {
      std::cout << "CLOCKWISE" << std::endl;
    } else {
      int i = inp(v1,v2);
      if (i < 0) {
        std::cout << "ONLINE_BACK" << std::endl;
      } else if (L < i) {
        std::cout << "ONLINE_FRONT" << std::endl;
      } else {
        std::cout << "ON_SEGMENT" << std::endl;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3236
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
const int INF = 1001001001;

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n) {
		if (n & 1) {
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y) swap(x, y);

	while (0 < y) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool is_prime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2) {
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++) {
		if (isPrime[i]) {
			Type j = i + i;
			while (j <= n) {
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binary_search_judge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binary_search(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok)) {
		int mid = (ng + ok) / 2;
		if (binary_search_judge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

double expected_value(int x)
{
	double ans = 0;
	for (int i = 1; i <= x; i++) {
		ans += i * (1.0 / x);
	}
	return ans;
}

int main()
{	
	int n, k;
	cin >> n >> k;

	vector<int> p(n);
	for (int i = 0; i < n; i++) cin >> p[i];

	vector<double> s(n + 1);
	for (int i = 1; i < n + 1; i++) {
		s[i] = s[i - 1] + expected_value(p[i - 1]);
	}

	double ans = 0;
	for (int i = 0; i < n - k + 1; i++) {
		ans = max(ans, s[i + k] - s[i]);
	}
	cout << fixed << setprecision(12) << ans << endl;
}

Measured memory_bytes: 2560
import java.util.Objects;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int R = sc.nextInt();
        int S = sc.nextInt();
        int P = sc.nextInt();
        String T = sc.next();
        String[] t = T.split("");
        String[] ret = new String[N];
        for (int i = 0; i < t.length; i++) {
            if (i < K) {
                switch (t[i]) {
                    case "r":
                        ret[i] = "p";
                        break;
                    case "p":
                        ret[i] = "s";
                        break;
                    case "s":
                        ret[i] = "r";
                        break;
                    default:
                        break;
                }
            } else {
                switch (t[i]) {
                    case "r":
                        if (!Objects.equals(ret[i - K], "p")) {
                            ret[i] = "p";
                        } else {
                            ret[i] = "";
                        }
                        break;
                    case "p":
                        if (!Objects.equals(ret[i - K], "s")) {
                            ret[i] = "s";
                        } else {
                            ret[i] = "";
                        }
                        break;
                    case "s":
                        if (!Objects.equals(ret[i - K], "r")) {
                            ret[i] = "r";
                        } else {
                            ret[i] = "";
                        }
                        break;
                    default:
                        break;
                }
            }
        }
        int count = 0;
        for (String string : ret) {
            switch (string) {
                case "r":
                    count += R;
                    break;
                case "s":
                    count += S;
                    break;
                case "p":
                    count += P;
                    break;
                default:
                    break;
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 35068
#include <bits/stdc++.h>
using namespace std;
int read();
int n, a[100005];

bool cmp(int x, int y) { return x > y; }

int main() {
    n = read();
    for (int i = 1; i <= n; ++i) a[i] = read();
    sort(a + 1, a + 1 + n, cmp);
    for (int i = 1; i <= n; ++i)
        if (i + 1 > a[i + 1]) {
            int b = (a[i] - i) & 1;
            if (!b)
                for (int j = i + 1; a[j] == i; ++j) b ^= 1;
            return puts(b ? "First" : "Second"), 0;
        }
    return 0;
}

int read() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') f = (c == '-') ? -1 : f, c = getchar();
    while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}


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

int main(void)
{
	int res = 0, tmp;
	int n, m;
	cin >> n >> m;
	
	for (int i = 0; i < n; i++){
		int sum = 0;
		for (int j = 0; j < m; j++){
			cin >> tmp;
			sum += tmp;
		}
		res = max(res, sum);
	}
	
	cout << res << endl;
	
	return 0;
}

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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    int n;
    cin >> n;
    map<char, int> mp;
    for(int i = 0; i < n; i++){
        char c;
        cin >> c;
        mp[c]++;
    }
    if(mp.size() == 4) cout << "Four" << endl;
    else if(mp.size() == 3) cout << "Three" << endl;
    
    return 0;
}

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

void solve(string S){
  int mymin = INT_MAX;
  REP(i, S.size() - 2) {
    mymin = min(mymin, abs(753 - (((S[i] - '0')*100) + ((S[i+1] - '0')*10) + (S[i+2] - '0'))));
  }

  cout << mymin << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    string S;
  cin >> S;
    solve(S);
    return 0;
}


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

int main(){

int N, M, ans=0;
cin >> N >> M;
int X[M], Y[M-1];
for(int i=0; i<M; i++){
  cin >> X[i];
}

sort(X, X+M);
for(int i=0; i<M-1; i++){
  Y[i] = X[i+1]-X[i];
}
sort(Y, Y+M-1);

if(N==1){
  for(int i=0; i<M-1; i++){
    ans += Y[i];
  }
  cout << ans << endl;
  return 0;
}
if(N>=M){
  cout << ans << endl;
  return 0;
}

for(int j=0; j<M-N; j++){
  ans += Y[j];
}

cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n)  FOR(i, 0, n)
#define ASC(c) sort((c).begin(), (c).end())
#define DESC(c) sort((c).begin(), (c).end(), greater<int>())

#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
    int r, d, x; cin >> r >> d >> x;
    int next = 0;
    REP(i, 10) {
        next = r * x - d;
        cout << next << endl;
        x = next;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define MSET(x,y) memset(x,y,sizeof(x))
#define M 3005
using namespace std;
int n,m,dp[M][M],fr[M][M];
char s[M],t[M];
int main()
{
    scanf("%s %s", s+1, t+1);
    n = strlen(s+1);
    m = strlen(t+1);

    REP(i,1,n) REP(j,1,m) {
        if (s[i] == t[j]) {
            dp[i][j] = dp[i-1][j-1] + 1;
            fr[i][j] = 3;
        } else if (dp[i-1][j] >= dp[i][j-1]) {
            dp[i][j] = dp[i-1][j];
            fr[i][j] = 1;
        } else {
            dp[i][j] = dp[i][j-1];
            fr[i][j] = 2;
        }
    }

    string ans = "";
    int x=n, y=m;
    while (x && y) {
        if (fr[x][y] == 3) ans += s[x];

        int tmp = fr[x][y];
        if (tmp & 1) x--;
        if (tmp & 2) y--;
    }
    reverse(ans.begin(), ans.end());
    printf("%s\n", ans.c_str());
    return 0;
}


Measured memory_bytes: 74160
#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

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

	if (a == b){
		cout << "a == b" << endl;
		return 0;
	}

	a < b ? cout << "a < b" << endl : cout << "a > b" << endl;

	return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

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

const int INF = 100001010;

int main(){
    int a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;
    int ans = 0;
    if (a + b < 2*c){
        ans = a * x + b * y;
    }else{
        int t = min(x, y);
        ans += 2 * t * c;
        x -= t;
        y -= t;
        if (x){
            if (a < 2*c) ans += x * a;
            else ans += 2 * c * x;
        }else{
            if (b < 2*c) ans += y * b;
            else ans += 2 * c * y;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3556
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String x = sc.next();
		String y = sc.next();
		char xc = x.charAt(0);
		char yc = y.charAt(0);

		if(xc > yc) {
			System.out.println(">");
		}else if(xc == yc) {
			System.out.println("=");
		}else {
			System.out.println("<");
		}
	}

}


Measured memory_bytes: 22612
S = list(map(int,list(input())))
N = len(S)
i = 0
cnt = 0
kaisuu = 0
while(kaisuu<N):
	kaisuu += 1
	if(N==0 or N==1 or i+1>len(S)-1):
		break
	elif(S[i]!=S[i+1]):
		del S[i+1]
		del S[i]
		cnt += 1
		if(i!=0):
			i -= 1
		else:
			i = 0
	else:
		i += 1
print(2*cnt)

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

int dp[310][310]; //dp[i][j] は区間[i, j)で叩き出せる数
vector<int> w;

int rec(int l, int m){ //区間DP
    if(dp[l][m] != -1) return dp[l][m];
    
    if(abs(l - m) <= 1) return 0;
    
    int res = 0;
    
    if(abs(w[l] - w[m - 1]) <= 1 && rec(l + 1,m - 1) == m - l - 2) res = m - l;
    
    for(int mid = l + 1; mid < m; mid++){
        res = max(res, rec(l, mid) + rec(mid, m));
    }
    return dp[l][m] = res;
}

int main(){
    while(true){
        int k; cin >> k;
        if(k == 0) break;
        w.resize(k);
        for(int i = 0; i < k; i++){
            cin >> w[i];
        }
        memset(dp, -1, sizeof(dp));
        cout << rec(0, k) << endl;
    }

}


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

int main(int argc, char const *argv[])
{
    int d=-1000000;
    int w=1000000;
    int K,X;
    cin>>K>>X;

    for (int i = max(d,X-K+1); i < min(w,K+X); i++)
    {
        cout<<i<<((i!=min(w,K+X-1)-1)?'\t':'\n');
    }
    
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
using namespace std;
typedef  long long  ll;
const int maxn = 2e5 + 5;
const int inf = 0x3f3f3f3f;

int main() {
    int a,b;
    cin>>a>>b;
    if (a<=0 && b>=0) puts("Zero");
    else if (a>=0) puts("Positive");
    else {
        int t = b - a + 1;
        if (t & 1) puts("Negative");
        else puts("Positive");
    }
    return 0;
}

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

int main(){
  double n; int a=0, b=0; cin >>n;
  vector<int>v(n);
  for(int i=0; i<n; i++)
  {cin >>v[i]; a+=v[i];}

  double c=a/n; int p;
  if(floor(2*c)-2*floor(c)){p=floor(c)+1;}
  else{p=floor(c);}

  for(int i=0; i<n; i++)
  {b+=(v[i]-p)*(v[i]-p);}

  cout <<b;

return 0;
}

Measured memory_bytes: 256
def calc_digit_sum(num):
    x = num
    digit_sum = 0

    while x > 0:
        digit_sum += x % 10
        x //= 10

    return digit_sum

N = int(input())

if N % calc_digit_sum(N) == 0:
    is_harshad_number = "Yes"
else:
    is_harshad_number = "No"

print(is_harshad_number)


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <cstring>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#define int long long
using namespace std;
signed main(){
    int n;
    cin>>n;
    int a[114514];
    for(int i=0;i<n;i++)cin>>a[i];
    while(1){
        int minimum=10000000000;
        int memory=0;
        for(int i=0;i<n;i++){
            if(a[i]!=0&&a[i]<minimum){
                minimum=a[i];
                memory=i;
            }
        }
        bool k=true;
        for(int i=0;i<n;i++){
            if(i!=memory)a[i]=a[i]%minimum;
            if(a[i]!=0&&i!=memory)k=false;
        }
        if(k==true){
            cout<<a[memory]<<endl;
            break;
        }
    }
    return 0;
}


















Measured memory_bytes: 1024
from sys import stdin
import math

N, D = stdin.readline().rstrip().split()

input_line = int(N)
dis = int(D)
cnt = 0

for i in range(input_line):
	s = stdin.readline().rstrip().split()
	X = int(s[0])
	Y = int(s[1])
	result = math.sqrt(X**2 + Y**2)

	# print(result)

	if result <= dis :
		cnt += 1

print(cnt)

Measured memory_bytes: 68708
// AOJ 0595
#include<cstdio>
#include<string>
#define rep(i,a) for( int i = 0; i != (a); ++i )

const int mod = 10007;
const std::string JOI = "JOI";

int N;
char s[1001];
int dp[1001][1<<3];

int main()
{
	scanf( "%d%s", &N, s );
	
	dp[0][0] = 1;
	rep( i, N )
		rep( j, 1<<3 )
			rep( k, 1<<3 )
				if( j >> JOI.find( s[i] ) & 1 && (i || !i && j&1) && (!i||j&k) )
					dp[i+1][j] = (dp[i+1][j] + dp[i][k]) % mod;

	int ans = 0;
	rep( i, 1<<3 )
		ans = (ans + dp[N][i]) % mod;

	printf( "%d\n", ans );

	return 0;
}

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

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define MOD 1000000007

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 powmod(ll t, ll times) {
	ll tcp = times;
	while(tcp > 0) {
		t *= 10;
		t %= 2019;
		tcp--;
	}
	return t;
}

int main() {
	string s;
	cin >> s;
	int slen = s.length();
	vector<int> t(slen);
	rep(i, s.length()) {
		t[i] = (s[i] - '0');
	}
	vector<ll> hoge(slen);
	ll fuga = 1;
	hoge[slen-1] = fuga;
	for(int i = slen-2; i >= 0; i--) {
		fuga *= 10;
		fuga %= 2019;
		hoge[i] = fuga;
	}
	vector<ll> piyo(slen+1);
	map<ll,int> mp;
	for(int i=slen; i>=0; i--) {
		if(i == slen) piyo[i] = 0;
		else {
			piyo[i] = (piyo[i+1] + t[i] * hoge[i]) % 2019;
			//piyo[i] = 10 * piyo[i+1] + t[i];
		}
		mp[piyo[i]]++;
	}
	//rep(i,slen) cout << piyo[i] << " ";
	//cout << endl;
	ll ans = 0;
	for(auto k : mp) {
		ans += k.second * (k.second - 1) / 2;
	}
	cout << ans << endl;
	/*rep(i, slen) {
		hoge[i] = temp; 
		temp *= 10;
		temp %= 2019;
	}
	rep(i, slen) cout << hoge[i] << " ";
	cout << endl;
	/*ll ans = 0;
	rep(i,slen) {
		ll sum = 0;
		int j = i+4;
		sum += 100 * t[i] + 10*t[i+1] + t[i+2];
		while(j <= slen) {
			sum *= 10;
			sum %= 2019;
			sum += t[j-1];
			if(sum % 2019 == 0) {
				ans++;
				j += 4;
				sum = 0;
				sum += t[j]*100 + t[j+1]*10 + t[j+2]*1;
			}
			else if(sum % 2019 < 2) {
				sum *= 1000;
				sum += t[j]*100 + t[j+1]*10+t[j+2];
				j += 4;
			}
			else if(sum % 2019 < 20) {
				sum *= 100;
				sum += t[j]*10 + t[j+1];
				j += 3;
			}
			else if(sum % 2019 < 201) {
				sum *= 10;
				sum += t[j];
				j += 2;
			}
			else j++;
		}
	}
	cout << ans << endl;
	/*ll sum = 0;
	int times = 1;
	for(int right = slen-1; right >=0; right--) {
		while(left >= -1 && sum + powmod(t[left],times)%2019 == 0) {
			sum += powmod(t[left],times);
			sum %= 2019;
			left--;
			times++;
		}

		res += right - left;

		if(left == right) {
			left--;
			times++;
		}
		else {
			sum /= 10;
			times--;
		}
	}
	*/
	/*vector<ll> acc(slen+1);
	acc[0] = 0;
	for(int i=1; i<=slen; i++) {
		acc[i] = acc[i-1] + t[i-1];
	}*/


  return 0;
}


Measured memory_bytes: 7552
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//value at the index->find_by_order(index), index->order_of_key(elme) [both in O(logn)]
//mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
//cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
#define setbits(x)      __builtin_popcountll(x)
#define leadzero(x)     __builtin_clz(x)
#define trailzero(x)    __builtin_ctz(x)
#define bitsparity(x)   __builtin_parity(x)
#define mod             1000000007
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll              long long 
#define pre(y,x)        fixed<<setprecision(y)<<x
#define dbg1(x)         cerr << "|" << #x << ": " << (x) << "|\n";
#define dbg2(x,y)       cerr << "|" << #x << ": " << (x) << "|" << #y << ": " << (y) << "|\n";
#define dbg3(x,y,z)     cerr << "|" << #x << ": " << (x) << "|" << #y << ": " << (y) << "|" << #z << ": " << (z) << "|\n";
#define ff              first
#define ss              second
#define pb              push_back
#define eb              emplace_back
#define popb            pop_back
#define endl            '\n'
#define all(v)          v.begin(), v.end()
typedef pair<int, int> pii; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pii> vii;
typedef vector<pll> vll; 
typedef vector<ll> vl; 
typedef vector<vl> vvl;
typedef vector<string> vs;
ll power(ll a,ll b){if(b==0) return 1;ll res=1;while(b>0){if(b&1) res *= a;a *= a;b >>=1;}return res;}
int is(int n){if(n==1) return 0;for(int i=2;i*i<=n;i++){if(n%i==0) return false;}return true;}
bool ispoweroftwo(ll x){ return (x&&!(x&(x-1)));}
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
const int inf = 1e9;
const double pi = acos(-1);
const ll INF = 1e18;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline void solve(){
		ll n;
		cin >> n ;
		ll a[n], ans=1;
		for(int i=0; i<n; ++i) {
			cin >> a[i];
			if(a[i] == 0) {
				cout << "0" ;
				return;
			}
		}
		for(int i=0; i<n; ++i) {
			if(a[i]<=1000000000000000000/ans) {
				ans *= a[i];
			} else {
				cout << "-1" ;
				return;
			}
		}
		cout << ans << endl;
		
}	
int main(){
		FIO;
//		int t; cin >> t;
//		while(t--)
		solve();
		return 0;	
}
/*

*/

Measured memory_bytes: 4432
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
map<string, bool> mark;
int n, ans;
string s;
int main() {
	cin >> n;
	while (n--) {
		cin >> s;
		if (mark[s] == 0) {
			ans++;
			mark[s] = 1;
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 19104
#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>

#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 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;

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

void solve() {
    int a,b,c;
    cin >> a >> b >> c;
    if  (b-a == c-b) cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

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

using namespace std;
typedef long long nagai;

vector<vector<pair<int, nagai>>> g;

vector<nagai> d;
const nagai inf = 1e18;

struct cmp
{
	bool operator()(int a, int b)
	{
		if (d[a] != d[b])
			return d[a] < d[b];
		return a < b;
	}
};

vector<nagai> dij(int from)
{
	d.assign(g.size(), inf);
	d[from] = 0;
	set<int, cmp> st;
	st.insert(from);
	while (st.size())
	{
		int x = *st.begin();
		st.erase(st.begin());
		for (auto p : g[x])
		{
			auto b = p.first;
			auto c = p.second;
			if (c + d[x] < d[b])
			{
				st.erase(b);
				d[b] = c + d[x];
				st.insert(b);
			}
		}
	}
	return d;
}

nagai mod = 1e9 + 7;

vector<nagai> cntways(vector<nagai>& d, vector<vector<int>>& g, int from)
{
	vector<nagai> ans(d.size());
	ans[from] = 1;
	vector<int> ord(d.size());
	iota(ord.begin(), ord.end(), 0);
	sort(ord.begin(), ord.end(), [&](int a, int b)
			{
				return d[a] < d[b];
			});
	for (int x : ord)
	{
		for (int y : g[x])
		{
			ans[y] += ans[x];
			if (ans[y] >= mod)
				ans[y] -= mod;
		}
	}
	return ans;
}

bool intersects(nagai a, nagai b, nagai c, nagai d)
{
	a = max(a, c);
	b = min(b, d);
	return b > a;
}

int main()
{
	int n, m;
	ios::sync_with_stdio(false);
	cin >> n >> m;
	int s, t;
	cin >> s >> t;
	--s, --t;
	g.resize(n);
	for (int i = 0; i < m; ++i)
	{
		int a, b, c;
		cin >> a >> b >> c;
		--a, --b;
		g[a].emplace_back(b, c);
		g[b].emplace_back(a, c);
	}
	auto ds = dij(s), dt = dij(t);
	vector<vector<int>> gs(n), gt(n);
	for (int i = 0; i < n; ++i)
	{
		for (auto p : g[i])
		{
			auto x = p.first;
			auto y = p.second;
			if (ds[i] + y == ds[x])
				gs[i].push_back(x);
			if (dt[i] + y == dt[x])
				gt[i].push_back(x);
		}
	}
	auto cnts = cntways(ds, gs, s), cntt = cntways(dt, gt, t);
	nagai len = ds[t];
	nagai cntall = cnts[t] * cnts[t] % mod;
	for (int i = 0; i < n; ++i)
	{
		if (ds[i] + dt[i] != len)
			continue;
		if (ds[i] == dt[i])
		{
			cntall -= cnts[i] * cnts[i] % mod * cntt[i] % mod * cntt[i] % mod;
			if (cntall < 0)
				cntall += mod;
		}
		for (int j : gs[i])
		{
			if (ds[j] + dt[j] != len)
				continue;
			if (dt[j] + (ds[j] - ds[i]) != dt[i])
				continue;
			if (intersects(ds[i], ds[j], dt[j], dt[i]))
			{
				cntall -= cnts[i] * cnts[i] % mod * cntt[j] % mod * cntt[j] % mod;
				if (cntall < 0)
					cntall += mod;
			}
		}
	}
	cout << cntall << endl;
}


Measured memory_bytes: 27512
#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define mod 1000000007
#pragma GCC optimize ("-O3")
#define mod2 998244353
#define MAXN 1000000000
#define v32 vector<int>
#define v64 vector<lli>
#define v1024 vector <vector <int>>
#define v4096 vector <vector <lli>>
#define vt vector
#define f(x, y, z) for (lli x = y; x < z; x++)
#define fd(x, y, z) for (lli x = y; x > z; x--)
#define lb lower_bound
#define ld long double
#define m64 map<lli,lli>
#define m32 map<int,int>
#define m64it map<lli,lli>::iterator
#define m32it map<int,int>::iterator
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ist insert
#define endl "\n"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define p_q priority_queue 
#define min_p_q priority_queue <int,vt <int>,greater <int>>
using namespace std;
using namespace __gnu_pbds; 
template <typename T> 
void DEBUG_ARR(vt<T> a,char c)
{
	f(i,0,a.size())cout<<a[i]<<c;
	cout<<"\n";
}

lli tmod(lli x,lli m){return (x%m+m)%m;}//USE AT YOUR OWN RISK
lli power(lli x, lli y) 
{
    lli res = 1;  
   
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1; 
        x = (x*x)%mod;  
    }
    if(res<0)
       res+=mod; 
    return res; 
}
string n;
lli k;
lli dp[105][5][2];
lli solve(int pos,int remain,int tight){
    if(pos==n.size()){
        if(remain==0)
        return dp[pos][remain][tight]=1;
        else return dp[pos][remain][tight]=0;
    }
    if(dp[pos][remain][tight]==-1){
        if(tight){
            if(remain==0)return dp[pos][remain][tight]=1;
            if(n[pos]=='0')
            dp[pos][remain][tight]=solve(pos+1,remain,tight);
            else dp[pos][remain][tight]=solve(pos+1,remain,0)+(n[pos]-'0'-1)*(n[pos]-'0'-1>0)*solve(pos+1,remain-1,0)+solve(pos+1,remain-1,1);
        }
        else{
            if(remain==0)return dp[pos][remain][tight]=1;
            dp[pos][remain][tight]=solve(pos+1,remain,tight)+9*solve(pos+1,remain-1,tight);
        }
    }
    return dp[pos][remain][tight];
}
int main() 
{ 
    fastio;
    memset(dp,-1,sizeof dp);
    cin>>n>>k;
    cout<<solve(0,k,1)<<"\n";
    return 0; 	
}


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

int main() {
  int N;
  cin>>N;
  vector<int> p(N);
  for(int i=0;i<N;i++){
    cin>>p[i];
  }
  for(int i=0;i<N;i++){
    int a;
    cin>>a;
    p[i]-=a;
  }
  int A=0;
  for(int i=0;i<N;i++){
    if(p[i]>0){
      A+=p[i];
    }
  }
  cout<<A<<endl;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <complex>
#include <algorithm>
#include <cstdio>
#include <climits>
#include <cmath>

using namespace std;

typedef complex<double> P;
int n;
class Circle{
public:
  P cp;
  double r;
};

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b))<EPS)

const double INF=-1;
const int band=5;
int main(){
  int n;
  while(cin>>n&&n!=0){
    int xsortedIdxs[100001];
    int ysortedIdxs[100001];
    vector<Circle> cs;
    vector<pair<double,int> > xsorted;
    vector<pair<double,int> > ysorted;
    double x,y,r;
    for(int i = 0; i < n; i++){
      Circle c;
      cin>>r>>x>>y;
      c.r=r;
      c.cp=P(x,y);
      cs.push_back(c);
      xsorted.push_back(make_pair(x,i));
      ysorted.push_back(make_pair(y,i));
    }
    sort(xsorted.begin(),xsorted.end());
    sort(ysorted.begin(),ysorted.end());
    for(int i = 0; i < n; i++){
      xsortedIdxs[xsorted[i].second]=i;
      ysortedIdxs[ysorted[i].second]=i;
    }
    double minDist=INF;
    for(int i = 0; i < n; i++){
      // x,zÀW»ê¼êÉÂ¢ÄA
      // ©ªÌê©ç-10,+10ÌÆ±ëðTõ
      int xsidx=xsortedIdxs[i];
      int ysidx=ysortedIdxs[i];
      for(int j = xsidx; j < min(xsidx+band,n);j++){
	int idx=xsorted[j].second;
	if(i==idx)continue;
	double d=abs(cs[idx].cp-cs[i].cp)
	  -cs[idx].r-cs[i].r;
	if(EQ(minDist,INF)||minDist>d)
	  minDist=d;
      }
      for(int j = xsidx; j >= max(0,xsidx-band); j--){
	int idx=xsorted[j].second;
	if(i==idx)continue;
	double d=abs(cs[idx].cp-cs[i].cp)
	  -cs[idx].r-cs[i].r;
	if(EQ(minDist,INF)||minDist>d)
	  minDist=d;
      }
      for(int j = ysidx; j < min(ysidx+band,n);j++){
	int idx=ysorted[j].second;
	if(i==idx)continue;
	double d=abs(cs[idx].cp-cs[i].cp)
	  -cs[idx].r-cs[i].r;
	if(EQ(minDist,INF)||minDist>d)
	  minDist=d;
      }
      for(int j = ysidx; j >= max(0,ysidx-band); j--){
	int idx=ysorted[j].second;
	if(i==idx)continue;
	double d=abs(cs[idx].cp-cs[i].cp)
	  -cs[idx].r-cs[i].r;
	if(EQ(minDist,INF)||minDist>d)
	  minDist=d;
      }
    }
    printf("%.8f\n",minDist);
    //cout<<minDist<<endl;
  }

  return 0;
}

Measured memory_bytes: 6600